Click here to Skip to main content
15,892,005 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have an ActiveX dll which is 32bit. I have a C# user control project which wraps the ActiveX dll for use in a WPF application. Now the problem is we want to change the application to 64bit. We created a 64bit building target, but we were unable to use the ActiveX dll because it is 32bit. I am considering wrapping the ActiveX dll in an ActiveX exe (out-proc COM), and reference the ActiveX exe in my C# user control. Could somebody provide some guide/walkthrough for wrapping an ActiveX dll in an ActiveX exe? Thanks.
Posted

1 solution

See http://stackoverflow.com/questions/2152449/32-bit-activex-control-in-a-64-bit-net-app[^]

Or also http://support.microsoft.com/kb/896457[^]

The easy answer is that you cannot do that. A 64 application can only host 64 bit control. A 32 bit application can only host 32 bit controls.

So you have the following possibilities:

  • Force your application to be 32 bit
  • Ask for a 64 bit version of your ActiveX control
  • Replace your control by something else (ideally a .NET component)
  • Do not offer that feature in your 64 bit version
  • Start a 32 bit application with a windows with your control (and loose integration)
  • Keep the whole UI (user interface) 32 bit and have inter-communication with your 64 bit application (service) with does not have any interface
  • ...


By the way if you try to use you ActiveX control anyway... It will probably take a lot of time to make it works and it will probably never works as desired... If it would have been easy, then Microsoft would have support it.
 
Share this answer
 
v2
Comments
Raptor81 15-Jul-11 10:15am    
Okay, then let me describe my understanding and correct me know if I am wrong.

1. If I have a win32 DLL written in Visual C++, I can wrap the DLL in an ActiveX exe project and expose the classes and functions in the DLL through a COM interface. I can then use IPC to communicate with this out-proc COM process in my client application (which is 64bit).

2. If I have a 32bit COM component (not an ActiveX control), I can wrap the DLL in an ActiveX exe project and expose the COM classes in the DLL through wrapper COM classes. I can then use IPC to communicate with this out-proc COM process in my client application (which is 64bit).

3. If I have an 32bit ActiveX control, in theory I can create an 32bit ActiveX exe project to host this control, but I would need its own window for this control to show. I can then use IPC to communicate between my 64bit client application and the ActiveX exe process. It is possible to do, but would require significant amount of effort.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900