Registering Proxy/stub DLL
-
I have created a marshaling proxy/stub DLL to handle the custom data interfacing of a COM object. The COM is a .exe and I am having trouble getting the marshaller to work during deploy. If I install the C++ application and COM server on a target machine and register the components this way... (COM server is SPDCom) c:\TARGETFOLDER\SPDCom.exe /Regserver regsvr32 c:\TARGETFOLDER\SPDComPS.dll The COM object is started and running in memory properly by the application, but I do not get any data from the Proxy/Stub. (Just the first data item in the passed arrays.) I was only able to get the project to work well after using VC++ 6.0 to build and register the SPDComPS project on the target machine. Before I built and registered the PS project, I did verify that the PS was registered in the registry with all of it's GUIDs. Finally, with this background, my question is: What is the difference between registering using regsvr32 from the 'RUN' prompt and from within VC++? (That seems to be the only difference!) David Leikis ATK Thiokol Propulsion
-
I have created a marshaling proxy/stub DLL to handle the custom data interfacing of a COM object. The COM is a .exe and I am having trouble getting the marshaller to work during deploy. If I install the C++ application and COM server on a target machine and register the components this way... (COM server is SPDCom) c:\TARGETFOLDER\SPDCom.exe /Regserver regsvr32 c:\TARGETFOLDER\SPDComPS.dll The COM object is started and running in memory properly by the application, but I do not get any data from the Proxy/Stub. (Just the first data item in the passed arrays.) I was only able to get the project to work well after using VC++ 6.0 to build and register the SPDComPS project on the target machine. Before I built and registered the PS project, I did verify that the PS was registered in the registry with all of it's GUIDs. Finally, with this background, my question is: What is the difference between registering using regsvr32 from the 'RUN' prompt and from within VC++? (That seems to be the only difference!) David Leikis ATK Thiokol Propulsion
David_Leikis wrote: What is the difference between registering using regsvr32 from the 'RUN' prompt and from within VC++? There is no difference, it still is the RegSvr32 that is used even if called from the DevStudio IDE. However, if you don't alter the "Tools->Register control" command in DevStudio, RegSvr32 is run from your target directory and always puts quotation marks on each side of the path to your server. Since it works when you build the application on the target machine you might have been missing some files that were installed with DevStudio. Hope this helps -- Roger
-
David_Leikis wrote: What is the difference between registering using regsvr32 from the 'RUN' prompt and from within VC++? There is no difference, it still is the RegSvr32 that is used even if called from the DevStudio IDE. However, if you don't alter the "Tools->Register control" command in DevStudio, RegSvr32 is run from your target directory and always puts quotation marks on each side of the path to your server. Since it works when you build the application on the target machine you might have been missing some files that were installed with DevStudio. Hope this helps -- Roger
After a few phone calls to Microsoft support, I got the answer to the problem of the Proxy/Stub not working and seeming to need to be registered with DevStudio. It seems that the Regsvr32 utility needs to have the COM object already installed BEFORE you install the PS!!! The bottom line is that the PS.DLL MUST be registered last! If you don't, there will never be any notification of error or warning, the COM object will fall back to standard marshalling and your custom marshalling PS.DLL will simply not be invoked. I just had my client register the PS.DLL again (last) and it worked immediately. -- modified at 9:00 Tuesday 11th October, 2005
-
After a few phone calls to Microsoft support, I got the answer to the problem of the Proxy/Stub not working and seeming to need to be registered with DevStudio. It seems that the Regsvr32 utility needs to have the COM object already installed BEFORE you install the PS!!! The bottom line is that the PS.DLL MUST be registered last! If you don't, there will never be any notification of error or warning, the COM object will fall back to standard marshalling and your custom marshalling PS.DLL will simply not be invoked. I just had my client register the PS.DLL again (last) and it worked immediately. -- modified at 9:00 Tuesday 11th October, 2005
Well, there's always a lesson to be learned.:cool: I didn't think if this either, but afterwards it's quite logical since when the server is registered (DllRegisterServer gets called from e.g. RegSvr32) it simply writes registry values not knowing anything about the proxy/stub dll. Nice of you to share the explanation. Thanks. -- Roger