Question

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.

Was it helpful?

Solution

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top