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

允我心安 提交于 2019-11-29 02:36:14
Danny

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}

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