Problem with ATL Sink class for catching another ATL's events 
Author Message
 Problem with ATL Sink class for catching another ATL's events

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

in ATLTestClient.obj
ATLTestClientObj.obj : warning LNK4006: "struct ATL::_ATL_FUNC_INFO

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) :
error C2061: syntax error : identifier 'CATLTestClientObj'
d:\documentation\testatlwithatl\atltestclient\atltestserversink.h(59) :
error C2143: syntax error : missing ';' before '*'
d:\documentation\testatlwithatl\atltestclient\atltestserversink.h(59) :
error C2501: 'CATLTestClientObj' : missing storage-class or type specifiers
d:\documentation\testatlwithatl\atltestclient\atltestserversink.h(59) :
error C2501: 'm_pParent' : missing storage-class or type specifiers
Generating Code...
Compiling...
ATLTestClientObj.cpp
d:\documentation\testatlwithatl\atltestclient\atltestserversink.h(36) :
error C2061: syntax error : identifier 'CATLTestClientObj'
d:\documentation\testatlwithatl\atltestclient\atltestserversink.h(59) :
error C2143: syntax error : missing ';' before '*'
d:\documentation\testatlwithatl\atltestclient\atltestserversink.h(59) :
error C2501: 'CATLTestClientObj' : missing storage-class or type specifiers
d:\documentation\testatlwithatl\atltestclient\atltestserversink.h(59) :
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

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



Wed, 23 Nov 2005 01:26:31 GMT  
 Problem with ATL Sink class for catching another ATL's events
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


Quote:
> 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

> in ATLTestClient.obj
> ATLTestClientObj.obj : warning LNK4006: "struct ATL::_ATL_FUNC_INFO

> 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) :
> error C2061: syntax error : identifier 'CATLTestClientObj'
> d:\documentation\testatlwithatl\atltestclient\atltestserversink.h(59) :
> error C2143: syntax error : missing ';' before '*'
> d:\documentation\testatlwithatl\atltestclient\atltestserversink.h(59) :
> error C2501: 'CATLTestClientObj' : missing storage-class or type
specifiers
> d:\documentation\testatlwithatl\atltestclient\atltestserversink.h(59) :
> error C2501: 'm_pParent' : missing storage-class or type specifiers
> Generating Code...
> Compiling...
> ATLTestClientObj.cpp
> d:\documentation\testatlwithatl\atltestclient\atltestserversink.h(36) :
> error C2061: syntax error : identifier 'CATLTestClientObj'
> d:\documentation\testatlwithatl\atltestclient\atltestserversink.h(59) :
> error C2143: syntax error : missing ';' before '*'
> d:\documentation\testatlwithatl\atltestclient\atltestserversink.h(59) :
> error C2501: 'CATLTestClientObj' : missing storage-class or type
specifiers
> d:\documentation\testatlwithatl\atltestclient\atltestserversink.h(59) :
> 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

> 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



Sun, 27 Nov 2005 05:14:06 GMT  
 Problem with ATL Sink class for catching another ATL's events
declare what static? the _ATL_FUNC_INFO or the references to the ATL object
class?

thanks


Quote:
> 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) :
> > error C2061: syntax error : identifier 'CATLTestClientObj'
> > d:\documentation\testatlwithatl\atltestclient\atltestserversink.h(59) :
> > error C2143: syntax error : missing ';' before '*'
> > d:\documentation\testatlwithatl\atltestclient\atltestserversink.h(59) :
> > error C2501: 'CATLTestClientObj' : missing storage-class or type
> specifiers
> > d:\documentation\testatlwithatl\atltestclient\atltestserversink.h(59) :
> > error C2501: 'm_pParent' : missing storage-class or type specifiers
> > Generating Code...
> > Compiling...
> > ATLTestClientObj.cpp
> > d:\documentation\testatlwithatl\atltestclient\atltestserversink.h(36) :
> > error C2061: syntax error : identifier 'CATLTestClientObj'
> > d:\documentation\testatlwithatl\atltestclient\atltestserversink.h(59) :
> > error C2143: syntax error : missing ';' before '*'
> > d:\documentation\testatlwithatl\atltestclient\atltestserversink.h(59) :
> > error C2501: 'CATLTestClientObj' : missing storage-class or type
> specifiers
> > d:\documentation\testatlwithatl\atltestclient\atltestserversink.h(59) :
> > 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

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



Mon, 28 Nov 2005 02:33:05 GMT  
 Problem with ATL Sink class for catching another ATL's events
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


Quote:
> 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)
:
> > > error C2061: syntax error : identifier 'CATLTestClientObj'
> > > d:\documentation\testatlwithatl\atltestclient\atltestserversink.h(59)
:
> > > error C2143: syntax error : missing ';' before '*'
> > > d:\documentation\testatlwithatl\atltestclient\atltestserversink.h(59)
:
> > > error C2501: 'CATLTestClientObj' : missing storage-class or type
> > specifiers
> > > d:\documentation\testatlwithatl\atltestclient\atltestserversink.h(59)
:
> > > error C2501: 'm_pParent' : missing storage-class or type specifiers
> > > Generating Code...
> > > Compiling...
> > > ATLTestClientObj.cpp
> > > d:\documentation\testatlwithatl\atltestclient\atltestserversink.h(36)
:
> > > error C2061: syntax error : identifier 'CATLTestClientObj'
> > > d:\documentation\testatlwithatl\atltestclient\atltestserversink.h(59)
:
> > > error C2143: syntax error : missing ';' before '*'
> > > d:\documentation\testatlwithatl\atltestclient\atltestserversink.h(59)
:
> > > error C2501: 'CATLTestClientObj' : missing storage-class or type
> > specifiers
> > > d:\documentation\testatlwithatl\atltestclient\atltestserversink.h(59)
:
> > > 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

> 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



Mon, 28 Nov 2005 02:43:41 GMT  
 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)

- Show quoted text -

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



Mon, 28 Nov 2005 10:31:51 GMT  
 Problem with ATL Sink class for catching another ATL's events
looks like they are declaring it as extern in the .h and defining in the
.cpp file.  thanks for the pointer.

matt


Quote:
> 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



> > 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)
> > :
> > > > > error C2061: syntax error : identifier 'CATLTestClientObj'

> d:\documentation\testatlwithatl\atltestclient\atltestserversink.h(59)
> > :
> > > > > error C2143: syntax error : missing ';' before '*'

> d:\documentation\testatlwithatl\atltestclient\atltestserversink.h(59)
> > :
> > > > > error C2501: 'CATLTestClientObj' : missing storage-class or type
> > > > specifiers

> d:\documentation\testatlwithatl\atltestclient\atltestserversink.h(59)
> > :
> > > > > error C2501: 'm_pParent' : missing storage-class or type
specifiers
> > > > > Generating Code...
> > > > > Compiling...
> > > > > ATLTestClientObj.cpp

> d:\documentation\testatlwithatl\atltestclient\atltestserversink.h(36)
> > :
> > > > > error C2061: syntax error : identifier 'CATLTestClientObj'

> d:\documentation\testatlwithatl\atltestclient\atltestserversink.h(59)
> > :
> > > > > error C2143: syntax error : missing ';' before '*'

> d:\documentation\testatlwithatl\atltestclient\atltestserversink.h(59)
> > :
> > > > > error C2501: 'CATLTestClientObj' : missing storage-class or type
> > > > specifiers

> d:\documentation\testatlwithatl\atltestclient\atltestserversink.h(59)
> > :
> > > > > 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

email.
> 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



Mon, 28 Nov 2005 23:21:27 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. ATL DLL event sink with a VB ActiveX DLL event source

2. ATL COM Component firing events into VBScript event sink

3. ATL COM - Passing ATL COM classes through another ATL COM class in the same app

4. How to do this in ATL - raise event from a class function in ATL server

5. Problem catching events from WMP 7.1 in ATL/C++ (VS.net)

6. Can't add new ATL class to ATL wizard generated solution

7. ATL - sink event

8. COM client (MFC) using ATL to sink events ?

9. Event source and sink for COM without ATL or MFC

10. Dynamic Event Sink In ATL?

11. Implementing Event Sinks in ATL

12. ATL Event Sink (DISP_E_MEMBERNOTFOUND)

 

 
Powered by phpBB® Forum Software