在调用CreateObject()API期间会加载哪个版本的DLL? [英] Which version of DLL would get loaded during a call to CreateObject() API?

查看:106
本文介绍了在调用CreateObject()API期间会加载哪个版本的DLL?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我们的产品环境中,可以安装和注册相同DLL的两个以上版本。在这种情况下,有人调用CreateObject()函数将加载哪个版本的DLL?

解决方案

它创建基于注册表项,如果CreateObject引用ActiveX辅助函数。


例如,如果你告诉它加载Excel.Sheet,它将在HKEY_CLASSES_ROOT中查找该键:



如果看一下CurVer键,默认值为Excel.Sheet.12:



Excel.Sheet和Excel.Sheet.12的CLSID将指向相同的CLSID,这是运行时查找DLL路径的位置负荷。


In our product environment it is possible to have more than two versions of the same DLL is installed and registered. In such a case when someone makes a call to CreateObject() function which version of the DLL would get loaded?

解决方案

It creates the object based upon the registry keys, if CreateObject to refer to the ActiveX helper function.

For example, if you tell it to load Excel.Sheet, it will look up that key in HKEY_CLASSES_ROOT:

If you look at the CurVer key, the default value will be Excel.Sheet.12:

The CLSID for both Excel.Sheet and Excel.Sheet.12 will point to the same CLSID, and this is where the runtime will look for the path of the DLL to load.


这篇关于在调用CreateObject()API期间会加载哪个版本的DLL?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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