1
votes

I'm on a Windows 10 64-bit system and I registered a dll using RegSvr32.

I received the following message after the RegSvr32:

    ---------------------------
    RegSvr32
    ---------------------------
    DllRegisterServer in myspecial.dll succeeded.
    ---------------------------
    OK   
    ---------------------------

When I tried to run a basic VBS file that does the following:

Set obj = CreateObject("myspecial.clsmycode")

I receive the following message after trying to run that VBS code:

    ---------------------------
    Windows Script Host
    ---------------------------
    Script: C:\test.vbs
    Line:   3
    Char:   9
    Error:  ActiveX component can't create object: 'myspecial.clsmycode'
    Code:   800A01AD
    Source:     Microsoft VBScript runtime error

    ---------------------------
    OK   
    ---------------------------

Does anyone know what I am doing wrong or what I need to do to get this to work?

1
Already answered this in lots of detail before. Although the question is for Classic ASP, the same still applies when registering any COM dlls.user692942
The most obvious cause is that you run the 64-bit version of the script interpreter but the COM server is a 32-bit DLL. Or the other way around. Always use the installer provided by the vendor btw, use a telephone if you don't have the proper install instructions.Hans Passant
@HansPassant There isn't always a "vendor", the COM dll is that old they no longer exist or in some cases written in house...You can quite simply work through the issue by following the checklist I provided in the answer above (see "How to register COM DLL with Windows" and "COM DLL Checklist" sections). It's all down to understanding the architecture differences between 32/64 bit in Windows OS.user692942

1 Answers

1
votes

The solution:

My 32-bit DLL was indeed registered on my 64-bit Windows 10 system, however, I was trying to run the script in 64-bit mode. Also, since I was trying to use this DLL within ASP on IIS, it was not working because 32-bit applications were not enabled.

The problem was solved by doing the following:

1) Enabled 32-bit applications within the application pool within the IIS settings.

2) Ran the script in 32 bit mode using this method:

A: How do I run a VBScript in 32-bit mode on a 64-bit machine?