Freigeben über


Classic ASP (ASP 3.0) doesn’t work on 64bit with 32bit COM objects

In particular I’m referring to VB6 ActiveX objects, and I know there's a lot of em out there. I've written several of them. I’ll try to give you a breakdown of why this occurs:

The isapi DLL that’s responsible for ASP is compiled natively for 64bit. When a web request comes in to IIS the ISAPI dll is loaded and begins filling the request for the asp page. Now this ISAPI filter makes a request to the windows scripting runtime which, on 64bit, has both a 32bit and 64bit flavor.

The 64bit flavor of the scripting runtime is loaded by IIS and it begins executing the ASP code in the requested page. If there’s a CreateObject() call to a COM object the scripting runtime checks the 64bit registry hive for the COM object since we are running a 64bit app. Now everything works fine if your COM object is compiled and registered using the 64bit version of regsvr32.exe. However, 32bit registered COM objects will fail because technically they aren’t registered with the 64bit flavor of the OS.

What does this mean?

For those of you that have 64bit compilers you can simply recompile or compile a 64bit version of your COM object and register that on the system and everything will work fine.

For VB6 folks, and a few others, there really aren’t any options since there isn’t a 64bit VB6 compiler. I have been throwing around the idea of taking the 32bit version of the ASP isapi filter and putting it on the 64bit box under a different filter name. Registering a special file extension for classic ASP pages (.asp30) thereby maintaining backwards compatibility. The only problem with that is I haven’t tried it and I don’t know if that will work or not. If someone wants to have a go at it let me know if it’s successful.

 

I'm also under the understanding that there may be a COM+ resolution to this (thanks robmaush!). COM+ may actually handle the bit difference but that's yet another thing I have to investigate.

For more info on the registry changes for 64bit boxes check:

Q896459 Registry Changes in Windows x64 Edition-based Operating System – https://support.microsoft.com/?id=896459