Hi,
I'm recompiling for AutoCAD 2013/2014 a solution that works fine with AutoCAD 2012, composed of some ARX projects, one DBX project and one c#.NET project.
The c#.NET project implements an UI and contains a COM wrapper client that requires to "connect" to a ObjectARX project that is the COM wrapper server.
That ARX project contains a rgs file like this:
HKCR
{
ArxName.AppComWr.2 = s 'AppComWrp Class'
{
CLSID = s '{7888DE6F-6301-481c-9C97-1F34F018BE22}'
}
ArxName.AppComWrp = s 'AppComWrp Class'
{
CLSID = s '{7888DE6F-6301-481c-9C97-1F34F018BE22}'
CurVer = s 'ArxName.AppComWr.2'
}
NoRemove CLSID
{
ForceRemove {7888DE6F-6301-481c-9C97-1F34F018BE22} = s 'AppComWrp Class'
{
ProgID = s 'ArxName.AppComWr.2'
VersionIndependentProgID = s 'ArxName.AppComWrp'
ForceRemove 'Programmable'
InprocServer32 = s '%MODULE%'
{
val ThreadingModel = s 'Apartment'
}
val AppID = s '%APPID%'
'TypeLib' = s '{51526A5B-9E7F-41C6-A7EB-879F72721236}'
}
}
}
All compiles ok and can be loaded in AutoCAD. To do so I follow this steps:
1. compiled all the ARX projects and the DBX project.
2. I used "tlbimp ArxName.tlb /machine:64 /keyfile:NetName.snk /reference:Autodesk.AutoCAD.Interop.Common.Dll" to create the ArxNameLib.dll
3. I used "tlbimp DbxName.tlb /machine:64 /keyfile:NetName.snk /reference:Autodesk.AutoCAD.Interop.Common.Dll" to create the DbxNameLib.dll
4. used the two generated interop files in the NET project (like references), compiled it and generated the NetName.dll
5. registered the NetName.dll with: RegAsm.exe NetName.dll /codebase
The c#.NET project tries to initialize COM wrapper client with:
IAcadApplication iAcadApp =disp as IAcadApplication;
object cawrp =iAcadApp.GetInterfaceObject(_appComWrpProgId);
where _appComWrpProgId = "ArxName.AppComWr.2", a string that represents the ProgID of the COM wrapper server defined in rsg file described above.
The problem is that GetInterfaceObject generate the exception:
System.Runtme.InteropServices.COMException(0x8004001F3): Problem in loading application
It seems that the COM server isn't registered but I don't know what is the correct procedure to register it (and I didn't find clear information about it on the web).
I tried to use C:\Windows\SysWOW64\regsvr32.exe to register the ArxName.arx, but it returns error "Can't find specified module" (translated from italian).
All suggestions are welcomed.
Thank you.
Regards,
Tiziano
Solved! Go to Solution.
Solved by VirtualgeoID. Go to Solution.
You could register your server by adding the needed registry values directly, but the error does not look to me like a registration issue. I think it's likely that the problem is due to a missing (at least, not in the Windows search path) dependent DLL or one with the wrong architecture.
Hi Owen,
I'm compiling at 64bit and I observed with Dependency Walker that Autodesk.AutoCAD.Interop.Common.dll and Autodesk.AutoCAD.Interop.dll are both 86bit dll also if taken from ObjectARX 2014\inc-x64. Can it be a problem?
Thank you and best regards
Tiziano De Gottardo
Virtualgeo srl
Assuming you're testing on a properly installed 64-bit AutoCAD, I don't think you need to worry about the AutoCAD managed assemblies at runtime, although I'm curious what lead you to conclude that the assemblies in the inc-x64 folder are "86bit" (I guess you meant "x86"). In any case, a tool like Process Monitor may help pinpoint the reason for the failure.
Hi,
thank you Owen for your help. Sorry for the inattention, you guess correctly, I meant 32 bit (x86). I will take a look with Process Monitor to fix error.
Regards
Tiziano De Gottardo
Virtualgeo srl
Hi,
I solved the problem, the COM registration was not complete; adding it by hand the software works correctly.
Regards
Tiziano De Gottardo
Virtualgeo srl