Click here to Skip to main content
15,913,909 members
Home / Discussions / COM
   

COM

 
GeneralRe: IPictureDisp with copy constructor Pin
Vi223-Apr-02 21:25
Vi223-Apr-02 21:25 
GeneralRe: IPictureDisp with copy constructor Pin
26-Apr-02 0:25
suss26-Apr-02 0:25 
GeneralRe: IPictureDisp with copy constructor Pin
Vi226-Apr-02 23:45
Vi226-Apr-02 23:45 
GeneralRe: IPictureDisp with copy constructor Pin
27-Apr-02 1:59
suss27-Apr-02 1:59 
GeneralRe: IPictureDisp with copy constructor Pin
Vi227-Apr-02 4:11
Vi227-Apr-02 4:11 
GeneralRe: IPictureDisp with copy constructor Pin
27-Apr-02 5:48
suss27-Apr-02 5:48 
QuestionHow to use an activex when user does not have an administrator account ? Pin
Jean-Michel LE FOL19-Apr-02 23:17
Jean-Michel LE FOL19-Apr-02 23:17 
GeneralLinker Error Pin
Madmaximus19-Apr-02 4:20
Madmaximus19-Apr-02 4:20 
Hi,

I get a linker error when I try to compile this class that contains a sink object in my ATL COM project.
"error LNK2005: "struct ATL::_ATL_FUNC_INFO OnNewUpdateInfo" (...) already defined in EventClient.obj"

Here is the listing of the Header file that conatians the sink object.
// EventClient.h: interface for the EventClient class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_EVENTCLIENT_H__062FDEBD_52F0_11D6_97B4_0002A5A9B5AA__INCLUDED_)
#define AFX_EVENTCLIENT_H__062FDEBD_52F0_11D6_97B4_0002A5A9B5AA__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#import "D:\TreeServer\TreeServer.tlb" no_namespace, named_guids, raw_interfaces_only, raw_native_types

//#include "D:\TreeServer\TreeServer.h"
//#include "D:\TreeServer\TreeServer_i.c"

#include <windows.h>
#include <atlbase.h>
#include <atlcom.h>

/************************************************************/

// Info for the events handler.
ATL::_ATL_FUNC_INFO OnNewUpdateInfo = {CC_STDCALL, VT_EMPTY, 1, {VT_BSTR}};

class CEventClient
: public IDispEventSimpleImpl<1, CEventClient, &DIID__ITreeUpdateEvents>
{
public:
CEventClient(ITreeUpdate *pITreeUpdate);
virtual ~CEventClient();

// The sink method.
void __stdcall OnNewUpdate(BSTR msg)
{
USES_CONVERSION;
m_bstrInMsg = msg;
SysFreeString(msg);
}

BEGIN_SINK_MAP(CEventClient)
SINK_ENTRY_INFO(1, DIID__ITreeUpdateEvents, 1, OnNewUpdate, &OnNewUpdateInfo)
END_SINK_MAP()


private:
ITreeUpdate *m_pITreeUpdate;
BSTR m_bstrInMsg;
};

#endif // !defined(AFX_EVENTCLIENT_H__062FDEBD_52F0_11D6_97B4_0002A5A9B5AA__INCLUDED_)

Any help would be great. Wink | ;-) I've been trying to track down this error for days now. ;(

Thanks in advance.
Ken
GeneralRe: Linker Error Pin
Tim Smith19-Apr-02 4:25
Tim Smith19-Apr-02 4:25 
GeneralCComPtr Pin
19-Apr-02 2:57
suss19-Apr-02 2:57 
GeneralRe: CComPtr Pin
Tim Smith19-Apr-02 3:34
Tim Smith19-Apr-02 3:34 
QuestionReturning values from COM object ?? Pin
19-Apr-02 1:37
suss19-Apr-02 1:37 
AnswerRe: Returning values from COM object ?? Pin
Paul M Watt21-Apr-02 9:39
mentorPaul M Watt21-Apr-02 9:39 
GeneralRe: Returning values from COM object ?? Pin
21-Apr-02 11:48
suss21-Apr-02 11:48 
QuestionHow to implement a thread in a service? Pin
Bhikshapathi Gorantla18-Apr-02 21:42
Bhikshapathi Gorantla18-Apr-02 21:42 
QuestionHow to digital certificate Pin
liuage18-Apr-02 16:06
liuage18-Apr-02 16:06 
AnswerRe: How to digital certificate Pin
Todd Smith18-Apr-02 16:09
Todd Smith18-Apr-02 16:09 
GeneralIs there a class just as MFC's CTime in ATL/WTL Pin
18-Apr-02 15:50
suss18-Apr-02 15:50 
GeneralA Question of Using the Standard C++ to Programme Connectable Object in VC6.0 Pin
zjkw18-Apr-02 15:49
zjkw18-Apr-02 15:49 
GeneralRe: A Question of Using the Standard C++ to Programme Connectable Object in VC6.0 Pin
zjkw23-Apr-02 2:37
zjkw23-Apr-02 2:37 
GeneralActivex/VisualC++ Pin
Dr Anandhi18-Apr-02 0:40
Dr Anandhi18-Apr-02 0:40 
Generala question about WTL Pin
xsword17-Apr-02 21:48
xsword17-Apr-02 21:48 
GeneralRe: a question about WTL Pin
Paul M Watt17-Apr-02 22:08
mentorPaul M Watt17-Apr-02 22:08 
GeneralWhy this happened and how can I solve it Pin
chq1217-Apr-02 15:48
chq1217-Apr-02 15:48 
GeneralRe: Why this happened and how can I solve it Pin
Mike Nordell17-Apr-02 17:18
Mike Nordell17-Apr-02 17:18 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.