Sign in to follow this  

c++ and com api

Recommended Posts

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.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this