000
06.08.2005, 12:23 Uhr
blackbox
|
Hallo,
Ich möchte in meiner App auf Event aus einer DLL reagieren, wenn ich jedoch den Code kompilieren will, dann bekomme ich folgende "unresolved symbols"...
LoaderDlg.obj : error LNK2001: unresolved external symbol "public: virtual long __cdecl CEventSink::cbFunc01(void)"
LoaderDlg.obj : error LNK2019: unresolved external symbol _AtlceDispatchCall referenced in function "public: virtual long __cdecl ATL::IDispEventSimpleImpl<0,class CEventSink,&struct _GUID const SUNSHINESRVLib: IID__ISunshineEvents>::Invoke(long,struct _GUID const &,unsigned long,unsigned short,struct tagDISPPARAMS *,struct tagVARIANT *,struct tagEXCEPINFO *,unsigned int *)"
LoaderDlg.obj : error LNK2001: unresolved external symbol "class ATL::CComModule _Module"
Der Eintrag in stdafx.h
| C++: |
#include <atlbase.h> // ATL support (NOT STANDARD) extern CComModule _Module; #include <atlcom.h> ... #import "SunshineSrv.dll" named_guids
|
Die Klasse CEventSink abgeleitet von IDispEventImpl mit der dazugehörigen SINK_MAP und den SINK_ENTRY_EX Deklarationen...
| C++: |
class CEventSink : public IDispEventImpl<0, CEventSink, &SUNSHUNESRVLib::DIID__ISunshineEvents, &SUNSHUNESRVLib::LIBID_SUNSHUNESRVLib, 1, 0> { public: BEGIN_SINK_MAP( CEventSink ) SINK_ENTRY_EX( 0, SUNSHUNESRVLib::DIID__ISunshineEvents, 0x1, cbFunc01) END_SINK_MAP() public: CEventSink() { } STDMETHOD(cbFunc01)(); };
|
Die Implementierung der Funktion cbFunc()...
| C++: |
STDMETHODIMP CEventSink::cbFunc01() { AfxMessageBox("called by Event from dll Server !"); return S_OK; }
|
| C++: |
#include "EventSink.h"
....
SUNSHUNESRVLib::ISunshineEventsPtr pObj; CEventSink* pEventSink = new CEventSink; pObj.CreateInstance( __uuidof(SUNSHUNESRVLib::ISunshineServer)); pEventSink->DispEventAdvise(pObj); pObj->FunctionWhichCallsAnEvent(); pEventSink->DispEventUnadvise(pObj);
delete pEventSink;
|
Ich bin ziemlich ratlos, drum habe ich auch (sehr) viel gepostet, ich hoffe das hilft... Dieser Post wurde am 06.08.2005 um 12:24 Uhr von blackbox editiert. |