Re: CoClass name issues
"George" <George@discussions.microsoft.com> wrote in message
news:332F87FE-2639-498A-8E12-D112CF3D1710@microsoft.com
Sorry for my bad English description, suppose we are writing a COM
Client, and we need to create instance of CoClass or reference
Interface of them (e.g. through QueryInterface). When the COM Client
does such kinds of things, it will not use the actual C++ class name,
but the CoClass/Interface name I mentioned in 3/4.
Not even those, technically. It would use CLSID and IID.
My question is,
how CoClass/Interface name I mentioned in 3/4 are binded to C++ class
name
CoClass is tied to a CLSID in the IDL (and, perhaps, eventually in a
typelib). Once your server is registered, the CLSID entry in the
registry refers to its EXE or DLL. The code in the server (say,
DllGetClassObject implementation) creates an instance of your C++ class
given a CLSID.
Your class' QueryInterface implementation handles the IID.
I found maybe they are binded through ATL class definition macros,
but I am not quite sure. :-)
I'm not sure what you mean by "class definition macros". In ATL, a CLSID
is associated with a C++ class name using OBJECT_ENTRY[_AUTO] macros.
--
With best wishes,
Igor Tandetnik
With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925