From: Larry Lindstrom on
Hi Folks:

Developing on XP Pro, VS 2008 Pro, Win32, no MFC.

I use COM objects others have created evey once an a while, with
varying degrees of ease or misery.

So I've decided to bite the bullet and go through this COM tutorial
at CodeGuru:

http://www.codeguru.com/cpp/com-tech/activex/tutorials/article.php/c5567/#Step8

In the definition of DllGetClassObject() a reference is made to
"CLSID_AddObject".

When I attempt to compile the sample, I get an error telling me
CLSID_AddObject is undefined.

Is there a header file I need to include?

A search of MSDN for CLSID_AddObject comes up with one article
which is posted by someone asking a question not related to
CLSID_AddObject, though it is referenced in the code sample. No
definition of CLSID_AddObject is offered on MSDN.

A search of every article in Google's archives, in every newsgroup,
brings up the same article found on the MSDN search, and some foreign
language threads.

A search for CLSID_AddObject of every *.h and *.cpp file on my PC
also comes up empty, except for the file copied from the tutorial.

So, what is CLSID_AddObject? Is there a work-around? Can someone
recommend another COM tutorial?

Thanks
Larry
From: Markus Schaaf on
Larry Lindstrom wrote:

> So I've decided to bite the bullet and go through this COM tutorial
> at CodeGuru:
>
> http://www.codeguru.com/cpp/com-tech/activex/tutorials/article.php/c5567/#Step8
>
> In the definition of DllGetClassObject() a reference is made to
> "CLSID_AddObject".
>
> When I attempt to compile the sample, I get an error telling me
> CLSID_AddObject is undefined.

This should be defined in "IAdd.h", which in turn is generated by
compiling "IAdd.idl". It's the class ID of the AddObj `coclass`. But
actually it isn't defined there. The corresponding C++ class isn't even
named `AddObj` but `CAddObj`. Looks like this tutorial is incomplete.
At least it is hard to follow.
From: Larry Lindstrom on
On Oct 14, 6:43 pm, Markus Schaaf <msch...(a)elaboris.de> wrote:
> Larry Lindstrom wrote:
> >    So I've decided to bite the bullet and go through this COM tutorial
> > at CodeGuru:
>
> >http://www.codeguru.com/cpp/com-tech/activex/tutorials/article.php/c5...
>
> >    In the definition of DllGetClassObject() a reference is made to
> > "CLSID_AddObject".
>
> >    When I attempt to compile the sample, I get an error telling me
> > CLSID_AddObject is undefined.
>
> This should be defined in "IAdd.h", which in turn is generated by
> compiling "IAdd.idl".  It's the class ID of the AddObj `coclass`.  But
> actually it isn't defined there.  The corresponding C++ class isn't even
> named `AddObj` but `CAddObj`.  Looks like this tutorial is incomplete.
> At least it is hard to follow.

Thanks Markus:

I've found another tutorial, about using COM libraries instead of
building them, but it's helpful for me.

And I'm battling MS's XML COM library right now.

I'll be posting about that soon.

I appreciate your input.

Larry