activex can't create object by vbs but can by classic asp

我们两清 提交于 2019-12-13 03:43:20

问题


On my Windows Server 2008 R2 I installed a COM object and can create it from a classic ASP page.

When I call it from a vbscript file, I get the "can't create" message.

I have tried starting Powershell as administrator and using that to run the script. No luck.

I have tried giving the "everyone" user full control over the COM DLL. No luck.

Any ideas?


回答1:


The only thing that makes sense to me is that the COM object is the same bit-ness as the class ASP and a different bit-ness than the script engine. I do not know, but I would guess that the classic ASP is 32-bit and your COM object is 32-bit.

To check if it is bit-ness (mismatch between 32 and 64 bit), go to the command line and type

cscript myscript.vbs

where myscript.vbs is the name/path of your vbscript file. Then, from the command line, type

C:\Windows\SysWOW64\cscript myscript.vbs

The version of cscript (or wscript) that runs from a standard command prompt is 64-bit. The one that runs from the \Windows\SysWOW64 directory is the 32-bit version.

You can also look at your object's registration. You can look at the ProgID in the registry under HKEY_CLASSES_ROOT and find the CLSID.

The 64-bit hive for the object will be under HKEY_CLASSES_ROOT\CLSID\Your-prog-id.

The 32-bit hive for the object will be under HKEY_CLASSES_ROOT\Wow6432Node\CLSID\Your-prog-id.



来源:https://stackoverflow.com/questions/27691710/activex-cant-create-object-by-vbs-but-can-by-classic-asp

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!