Advertisement

c++ and com api

Started by August 17, 2011 02:07 PM
-1 comments, last by giugio 13 years, 2 months ago
Hello.
I have a C + + MFC project that reads from a program through a COM API.
The problem is that this program has changed and is passed to the next version.

I interface with the server through this sample code :

IUnknown * punk;

CLSIDFromProgID hr = (L "PippoXXX.XXXObject", & clsid);
hr = CoCreateInstance (clsid, NULL, CLSCTX_LOCAL_SERVER, IID_IUnknown, (void **) & punk);
hr = punk-> QueryInterface (id, (void **) & m_pPippo);
[/ code]

How do I know the CLSID of the COM server (which in my case is a .Exe) or otherwise the string to pass to the CLSIDFromProgID function(in a distribution optic)?
And if there are more than one version of the program, how I interface with the program rather than another?

Com is still a valid way to create an API for exporting data or access to functions?
there are some good books on the subject.
Thank you.

This topic is closed to new replies.

Advertisement