注册的COM DLL可以使用C ++访问,但不能使用vbscript。为什么? [英] Registered COM dll can be accessed using C++, but not using vbscript.Why?
问题描述
我使用c ++(使用ATL)进行简单的编译。 dll已经在系统中注册,因为当我搜索GUID并能够从另一个c ++程序访问它时,我可以找到它。但问题是我无法使用vbscript访问dll。
它总是显示错误ActiveX cant create object。我将对象格式保存为projectname.classname。任何人都可以为我提供解决方案吗?有什么办法可以找到dll的ProgID,这样我就可以创建dll对象吗?
I have simple com dll using c++(using ATL). The dll is already registered in the system as i can i can find it when i search for the GUID and able to access it from another c++ program. But the problem is I am unable to access the dll using vbscript.
Its always showing the error "ActiveX cant create object". I have kept the object format as projectname.classname. Can anybody provide me the solution to it? Is there any way i can find the ProgID of the dll so that i can create the dll object?
推荐答案
有什么方法可以找到dll的ProgID,这样我就可以创建dll对象吗?
Is there any way i can find the ProgID of the dll so that i can create the dll object?
我想你可以使用< a href =https://msdn.microsoft.com/en-us/library/windows/desktop/ms690567(v=vs.85).aspx>ProgIDFromCLSID function [ ^ ]功能。
你的硬盘是32位吗?
你的操作系统是64位吗?
如果是这样,你不能(很容易) )使用64位应用程序的32位dll
尝试将vbs作为32位运行并查看它是否有效
类似于:
C:\ Windows \ SysWOW64 \wscript.exe c:\ test.vbs
Is your com dll 32-bit ?
Is your OS 64-bit ?
If so, you cannot (easily) use a 32-bit dll from a 64-bit app
Try running the vbs as 32-bit and see if it works
Something like:
C:\Windows\SysWOW64\wscript.exe c:\test.vbs
这篇关于注册的COM DLL可以使用C ++访问,但不能使用vbscript。为什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!