检查dll是否已注册? [英] Check if a dll is registered or not?

查看:230
本文介绍了检查dll是否已注册?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,

 在C ++中如何检查dll是否已经注册?

 In C++ how to check whether a dll is already registered or not?

谢谢

推荐答案


 在C ++中如何检查是否dll已经注册了吗?

 In C++ how to check whether a dll is already registered or not?

谢谢

假设你在谈论一个COM dll你需要事先了解dll中托管的COM对象。 如果dll在其资源中嵌入了类型库,或者作为单独的文件,您可以使用它来获取信息。 
否则你需要通过其他方式获取信息。

Assuming you are talking about a COM dll you would need to have prior knowledge of the COM objects that are hosted in the dll.  If the dll has a type library embedded in its resources or as a separate file you could use that to obtain information.  Otherwise you would need to obtain the information by some other means.

确定托管哪些COM对象后,包括他们的CLSID,ProgIds,然后可以在IID和类型库ID中搜索注册表以查看这些项是否存在。

After determining which COM objects are hosted, including their CLSIDs, ProgIds, IIDs and type library ID you could then search the registry to see if these items are present.

一个简单的测试是尝试实例化dll服务器托管的COM对象。 如果对CoCreateInstance的调用失败,并显示一条错误,指出该类未注册,则表示该类。 但是,它也可能是
a损坏注册表或未完成注册的结果,因为dll可以托管和注册多个COM对象。

A simple test would be to attempt to instantiate a COM object hosted by the dll server.  If the call to CoCreateInstance fails with an error indicating the class is not registered that is an indication.  However, it could also be the result of a corrupted registry or incomplete registration since a dll can host and register multiple COM objects.


这篇关于检查dll是否已注册?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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