Error registering a COM component and using in WPF application

0

I have a COM DLL (MyWrapper), with a COM ATL Object (class) defined inside. This COM dll is basically to be an interface between my WPF .exe and native MFC DLLs.

Everything works perfectly fine until I put the COM DLL in my source control to check in the code. I put the Pre and post build events to copy the DLL to our desired location. when I compiled I got the error.

Unable to register the dll. Try enabling per user redirection

I enabled the option in linker. The DLL compiled and copied to the directory successfully. Then I tried to add the reference to the WPF project, it gave me the following error

A reference to MyWrapper.dll" could not be added. Please make sure that the file is accessible and that it is a valid assembly or COM component

When I remove the pre/post build events and then add the reference, everything works great. I loaded the DLL in Dependency walker it shows IESHIMS.dll is missing.

I have tried to register the DLL using regsvr32 but that returns an error:

The module 'MyWrapper.dll' was loaded but the call to DllRegisterserver failed with error code 0x80070715.

I have admin rights on my machine and am running Visual Studio as administrator.

visual-studio-2010
dll
com
mfc
dllregistration
asked on Stack Overflow Jun 21, 2013 by WAQ • edited Mar 7, 2020 by halfer

1 Answer

0

In the postBuild events, I created a Proxy dll of the COM and added that dll in my WPF application. This solved my problem.

answered on Stack Overflow Jun 30, 2013 by WAQ

User contributions licensed under CC BY-SA 3.0