Click here to Skip to main content
15,847,653 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I use "DllRegisterServer" function in c++. When I use in cmd "regsvr32 MyDll.dll", I always get a message that action succeeded, but actually the dll file was not registered in registry. It happens only in Windows7. Any idea why? Thanks!

1 solution

Most likely, registry virtualization: instead of under HKLM, the DLL is registered under a 'virtual HKLM Key' for the current user.
Try opening a CMD window as an administrator, and running REGSVR32 from there.

If this is not it, it may be a 32/64 issue. Those are frequent when you use COM Interop from a .NET client.
If the COM server DLL is a 32-bit DLL, and the .NET client is compiled as 'any CPU', the client will run as a 64-bit process in a 64-bit machine, and it will not find the 32-bit DLL.
You can find out whether this is the case using Task Manager.
If this is your case, try compiling the .NET client as a 32-bit only application.

Hope this helps,

Share this answer
NettaD 12-Jun-12 6:34am    
Hi Pablo,
Thanks for your answer. I tried your first solution already, and it also didn't work.
My client application is already 32bit. I'm only compiling the DLL library, and trying to register it in the registry, but in practice it is not registered.
The registration (in registry) is supposed to be done in the function "DllRegisterServer" which is called whike regsvr32 is run.
Do you have another idea?
Pablo Aliskevicius 12-Jun-12 8:23am    
No, those two scenarios are the only ones I've stumbled upon.
It seems that you'll have to search the registry, and see what you find...
Best wishes,
Vitaly Tomilov 13-Jun-12 18:30pm    
Ok, so your DLL is 32-bit. But is your Win 7 64-bit or 32-bit?

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