1

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?

user692942
  • 16,398
  • 7
  • 76
  • 175
Aaron
  • 341
  • 2
  • 14
  • 1
    [Already answered this](http://stackoverflow.com/a/35985827/692942) in lots of detail before. Although the question is for Classic ASP, the same still applies when registering any COM dlls. – user692942 Nov 02 '16 at 15:54
  • 1
    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 Nov 02 '16 at 17:00
  • @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 Nov 02 '16 at 18:35

1 Answers1

1

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?

Community
  • 1
  • 1
Aaron
  • 341
  • 2
  • 14
  • So you missed the section were I state *"On a 64 Bit OS the System Programs are located in"*? If you'd read that you'd know to run `cscript.exe` from `%systemroot%\SysWOW64` to run it in the 32 Bit subsystem. At least you found a solution I guess. You also don't make any reference to a Web Application so why did you need to change any IIS App Pool settings? That purely pertains Web Applications using COM like Classic ASP for example. – user692942 Nov 03 '16 at 13:26
  • Ok, spotted the ASP comment in the answer that explains that. – user692942 Nov 03 '16 at 17:14