How to use a 32 bit COM object on Windows Server 2008 (works on 2008 R2 but non 2008)

后端 未结 1 1956
無奈伤痛
無奈伤痛 2020-12-16 07:36

I am using the default DllSurrogate to enable automation of a 32bit COM object in 64bit. This works perfectly in Windows7 64 bit and Windows Server 2008 R2. However; regul

相关标签:
1条回答
  • 2020-12-16 08:14

    Problem solved! Thanks Hans for setting me on the right track! I accidentally configured the system to use a 64-bit DLLHost.exe file, which didn't work since it couldn't launch a 32-bit COM object.

    Start-to-finish, here is how I was able to use my 32-bit COM object from a 64-bit application.

    1. Register COM object with regedit*32 (c:\windows\syswow64\regedit)

    2. Make the following registry changes. Be sure to put this all under Wow6432Node so the 32-bit DLLHost will be used.

    3. Determine your COM object's GUID by searching for registry for classname. ie. Classname would be the value you pass to createobject, like CreateObject("classname").

    4. Locate existing key HKey_Classes_Root\Wow6432Node\CLSID\[GUID]. Add a new REG_SZ (string) Value called AppID with a the COM object GUID as the value.

    5. Add a new key HKey_Classes_Root\Wow6432Node\AppID\[GUID]. Under this new key, add a new REG_SZ (string) Value called DllSurrogate. Leave the value empty.

    6. If not already there, create new Key under HKey_Local_Machine\Software\Wow6432Node\Classes\AppID\[GUID]. If not already there, add a new REG_SZ (string) Value called DllSurrogate under this key. Leave the value empty.

    Now when you create your COM object you should see DLLHost.exe*32 show up in task manager. Turn on the command-line column in task manager and you should see C:\windows\syswow64\dllhost.exe /processid:{YourCOMGUIDHere}

    0 讨论(0)
提交回复
热议问题