Wednesday, 15 May 2013

visual studio 2010 - Error registering a COM component and using in WPF application -


I have a COM DLL (MyWrapper), in which the COM ATL object is defined. This COM DLL is basically to be the interface between my WPF .exe and native MFC dlls.

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

"Unable to register DLL. Try to enable redirect per user"

I have enabled the option in Linker. DLL compiled and successfully copied to the directory. Then I tried to add the context of the WPF project, he gave me the following error

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

When I delete the pre / post build event and then add context, everything works great. Dependency walker reveals IESHIMS.dll is missing.

I have tried to register DLL using regsvr32, but it gives an error "module 'MyWrapper.dll' was loaded, But call to DllRegisterserver with error code 0x80070715.

Note: On my machine there are admin rights and running Visual Studio as an administrator. Please help.

Thank you

In the PostBilled event, I created a Proxy DLL com And added that in my WPF application dll added it solved my problem

No comments:

Post a Comment