I got an application that use a COM library, just wondering how can I know whether that application use that COM library as a LocalServer or In-Proc?
I looked at the code being constructed in this way:
DATCOMLib::ITEmulationPtr pTE(__uuidof(DATCOMLib::TEmulation));
It depends partly on what execution context you supply when you create your object - see here for more details: http://msdn.microsoft.com/en-us/library/windows/desktop/ms693716(v=vs.85).aspx
You can look up the class id for your component in the registry and check whether it has a LocalServer sub-key. So in your case you would look for:
HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{CLSID of DATACOMLib::TEmulation}\LocalServer
If it is an In Proc COM component it will instead have the following key:
HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{CLSID of DATACOMLib::TEmulation}\InProcServer32
Check this documentation for more details: http://msdn.microsoft.com/en-us/library/aa908849.aspx
It can be find out using multiple ways
From looking at the code - check what is the class context passed when calling "CreateInstance" or "CoCreateInstance" - (CLSCTX_INPROC_XXXX then it is inproc server means it is DLL which will be loaded into calling applications process address space. CLSCTX_LOCAL_SERVER, CLSCTX_REMOTE_SERVER - then it is COM server running as a separate process. There are some #defines which combines one or more flags. Just google it)
ITEmulationPtr.CreateInstance(uuid(TEmulation), 0, CLSCTX_XXX)
If you have access to machine on which COM component is installed then you can follow steps given by Peter in above answer
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With