简体   繁体   English

C ++:无法使用regsvr32注册我的DLL,但通过IDE可以工作

[英]C++: Unable to register my DLL using regsvr32, but via IDE works

I have created a COM ATL DLL in VS2012. 我在VS2012中创建了COM ATL DLL。

When I let the IDE compile it, it will automatically be registered, and I can use it on my developer machine. 当我让IDE对其进行编译时,它将被自动注册,并且可以在开发人员机器上使用它。

I tried registering the DLL on a clean XP machine, and regsvr32.exe returned 我尝试在干净的XP计算机上注册DLL,并返回regsvr32.exe

"LoadLibrary("MyDll.dll") failed. The module was not found." “” LoadLibrary(“ MyDll.dll”)失败。找不到模块。“

I thought I created a normal COM DLL, not a managed DLL, so I thought I could register it using regsv32.exe, not REGASM. 我以为我创建了一个普通的COM DLL,而不是托管DLL,所以我想可以使用regsv32.exe而不是REGASM进行注册。

I have compiled the DLL with the option "Multithreaded (/MT)", so I guess I don't need to have the C++ runtimes installed, right? 我已经用“多线程(/ MT)”选项编译了DLL,所以我想我不需要安装C ++运行时,对吗?

Using ProcMon I saw that regsvr32.exe looks for "atl110.DLL". 使用ProcMon,我看到regsvr32.exe查找“ atl110.DLL”。 Do I need to distribute it, although I selected "Multithreaded (/MT)"? 尽管我选择了“多线程(/ MT)”,但仍需要分发它吗?

Does anybody have any ideas what I might have done wrong? 有人知道我做错了什么吗?

Thank you for the help. 感谢您的帮助。

Edit: Sorry, I mistyped the error message first. 编辑:对不起,我首先输错了错误信息。

I have changed the project properties from 我已经从更改了项目属性

Configuration -> Common -> Usage of ATL: "Dynamic link to ATL" to "Static link to ATL". 配置->通用-> ATL的用法:从“动态链接到ATL”到“静态链接到ATL”。

This did the job. 这完成了工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM