regsvr32不在Windows 7中注册我的DLL [英] regsvr32 doesn't register my DLL in windows 7

查看:90
本文介绍了regsvr32不在Windows 7中注册我的DLL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在c ++中使用"DllRegisterServer"功能.当我在cmd"regsvr32 MyDll.dll"中使用时,我总是收到一条消息,说明操作成功,但是实际上dll文件未在注册表中注册.它仅在Windows7中发生.知道为什么吗?

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!

推荐答案

最有可能的是,注册表虚拟化:该DLL不是在HKLM下而是为当前用户在虚拟HKLM密钥"下注册. /> 尝试以管理员身份打开CMD窗口,然后从那里运行REGSVR32.

如果不是这样,则可能是32/64问题.当您从.NET客户端使用COM Interop时,这些情况很常见.
如果COM服务器DLL是32位DLL,并且.NET客户端被编译为任何CPU",则该客户端将在64位计算机中作为64位进程运行,并且找不到32位DLL.
您可以使用任务管理器"查明是否是这种情况.
如果是这种情况,请尝试将.NET客户端编译为仅32位应用程序.

希望这会有所帮助,

巴勃罗.
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,

Pablo.


这篇关于regsvr32不在Windows 7中注册我的DLL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆