Can a 64-Bit Add-in reference a 32-Bit dll ?

Can a 64-Bit Add-in reference a 32-Bit dll ?

stuartmp
Advocate Advocate
734 Views
2 Replies
Message 1 of 3

Can a 64-Bit Add-in reference a 32-Bit dll ?

stuartmp
Advocate
Advocate
Hi all,

I am witting a Add-in in VB.Net 2008.

I have attach a 32-bit ActiveX Dll that was written in VB6.

The project loads fine in Inventor 2009 32-bit & Inventor 2010 32-bit.

Although I am having trouble getting it to load in Inventor 2009 64-bit & Inventor 2010 64-bit.

I have written many 64-bit Add-ins before and have had no issues.

I am registering the 32-bit ActiveX Dll from VB6 with regsvr32 ABCD.dll

I am registering the Interop.ABCD.dll that vb.Net creates into the Global Assembly Cache

Finally I am registering the vb.Net Addin Dll with C:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727\RegAsm.exe /codebase ABCD.dll

All returned no errors

As I said before the project runs fine in Inventor 2009 32-bit & Inventor 2010 32-bit using
regsvr32 ABCD.dll
registering the Interop.ABCD.dll into the Global Assembly Cache
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\RegAsm.exe /codebase ABCD.dll

So I guess my question is.

Is it possible to create a 64-Bit Add-ins referencing 32-Bit dlls ?

If so where am I going wrong?

Thanks in Advance

Stuart.
0 Likes
735 Views
2 Replies
Replies (2)
Message 2 of 3

jeff.pek
Community Manager
Community Manager
Hi Stuart -

I think the only way you'll be able to do this is by using an out-of-process COM server for your 32-bit code. The 64-bit code can then instantiate it, and the system will take care of marshaling between the now-separate processes. If you're using the ActiveX DLL as a control, this might be a problem, performance-wise, so the feasibility of doing this depends on what job(s) the DLL is performing.

Jeff
0 Likes
Message 3 of 3

stuartmp
Advocate
Advocate
Thanks for response Jeff.

I no nothing about "out-of-process COM server's"

What involved in writing some .net code for this?

I have my project running in 64-Bit using a compiled EXE I created in VB6.

It is a quite a bit slower than the Dll that runs in 32-bit.

If I when to the effort to create the out-of-process COM server would it be any faster that the EXE that I have already created?

if so, I guess I also have to weigh up any performance gains with the work involved creating the out-of-process COM server.

if not, I may as well put that same effort in to converting the VB6 Dll to .net

Thanks again for the response

Stuart
0 Likes