
Problem with ATL Sink class for catching another ATL's events
ok. I made the messages go away by declaring the _ATL_FUNC_INFO into the
cpp, so this way, it's not included each time another file include the .h. I
took it from the ATLEventHandling example from MSDN. maybe it can help you
too. ;)
thanks.
ThunderMusic
Quote:
> the _ATL_FUNC_INFO
> ex:
> static _ATL_FUNC_INFO OnYourFuncInfo = {CC_STDCALL, VT_EMPTY,
> 1,{VT_VARIANT}};
> like i said, this made the errors go away. not sure if it's "proper" to
do
> this, but i'm not an expert like the rest of the people on this list.
> matt
> > declare what static? the _ATL_FUNC_INFO or the references to the ATL
> object
> > class?
> > thanks
> > > i was getting those errors as well. i think it is because you are
> > declaring
> > > them in the global namespace. what i did to get around them was to
> > declare
> > > them static and that made the errors go away.
> > > hope that helps.
> > > matt
> > > > Hi,
> > > > I have a problem in relation with ATL in an ATL. I explain right
> > now.
> > > I
> > > > have an ATL COM DLL object (Server). I load it in an other ATL COM
> > > > DLL(Client) (that will be used in VB afterward). Right now,
everything
> > is
> > > > done in VC++6 SP5. The problem I have is when I create the sink
class
> > for
> > > > the Server's events into the client dll.
> > > > Event
> > > > Client (with the sink) <----------- Server
> > > > right now I have two problems.
> > > > I get this if I compile without making reference of the parent class
> > (the
> > > > ATL coClass (the OBJ itself))
> > > > Linking...
> > > > ATLTestClientObj.obj : error LNK2005: "struct ATL::_ATL_FUNC_INFO
> > defined
> > > > in ATLTestClient.obj
> > > > ATLTestClientObj.obj : warning LNK4006: "struct ATL::_ATL_FUNC_INFO
> > defined
> > > > in ATLTestClient.obj; second definition ignored
> > > > Creating library Debug/ATLTestClient.lib and object
> > > > Debug/ATLTestClient.exp
> > > > Debug/ATLTestClient.dll : fatal error LNK1169: one or more multiply
> > > defined
> > > > symbols found
> > > > Error executing link.exe.
> > > > ATLTestClient.dll - 2 error(s), 1 warning(s)
> > > > If I make reference of the parent class, I get this :
> > > > Compiling...
> > > > ATLTestClient.cpp
d:\documentation\testatlwithatl\atltestclient\atltestserversink.h(36)
Quote:
> :
> > > > error C2061: syntax error : identifier 'CATLTestClientObj'
d:\documentation\testatlwithatl\atltestclient\atltestserversink.h(59)
Quote:
> :
> > > > error C2143: syntax error : missing ';' before '*'
d:\documentation\testatlwithatl\atltestclient\atltestserversink.h(59)
Quote:
> :
> > > > error C2501: 'CATLTestClientObj' : missing storage-class or type
> > > specifiers
d:\documentation\testatlwithatl\atltestclient\atltestserversink.h(59)
Quote:
> :
> > > > error C2501: 'm_pParent' : missing storage-class or type specifiers
> > > > Generating Code...
> > > > Compiling...
> > > > ATLTestClientObj.cpp
d:\documentation\testatlwithatl\atltestclient\atltestserversink.h(36)
Quote:
> :
> > > > error C2061: syntax error : identifier 'CATLTestClientObj'
d:\documentation\testatlwithatl\atltestclient\atltestserversink.h(59)
Quote:
> :
> > > > error C2143: syntax error : missing ';' before '*'
d:\documentation\testatlwithatl\atltestclient\atltestserversink.h(59)
Quote:
> :
> > > > error C2501: 'CATLTestClientObj' : missing storage-class or type
> > > specifiers
d:\documentation\testatlwithatl\atltestclient\atltestserversink.h(59)
Quote:
> :
> > > > error C2501: 'm_pParent' : missing storage-class or type specifiers
> > > > Generating Code...
> > > > Error executing cl.exe.
> > > > ATLTestClient.dll - 8 error(s), 0 warning(s)
> > > > How can I do to solve these errors? I really need to make reference
of
> > the
> > > > parent class. If you need the code, send me an E-Mail directly to
I
> > will
> > > > send it to you. It's a test ATL because I don't want to mess up my
> real
> > > > project; I have a deadline to respect and dont want to begin from
the
> > > start
> > > > again.
> > > > thanks
> > > > ThunderMusic