I'm trying to create a 32-bit COM object from a 64-bit application.
I use CLSCTX_LOCAL_SERVER in the CoCreateInstance call, and I've added an empty DllSurrogate key to the AppId registry key to tell COM to host the server in the DllHost. I've called regsvr32 myproxy.dll from an elevated prompt to register the proxy, no error. And I see in the registry that there are ProxyStubClsid32 keys for my interface in the 64-bit portion of the registry.
I call CoCreateInstance like this:
CComPtr<IMyObj> myobj;
HRESULT hr = myobj.CoCreateInstance(CLSID_MyObj, NULL, CLSCTX_LOCAL_SERVER);
This actually works on my dev machine, I can see in VS that the proxy DLL is being loaded. But not on the machine I'm testing on. So it is a configuration issue.
Note that CoCreateInstance returns S_OK if I request an IUnknown, which tells me that the component is registered properly.
How do I get COM to load the proxy DLL?
myproxy.dllwithC:\Windows\SysWOW64\regsvr32.exe- noseratio