HighTechTalks DotNet Forums  

C++ Sink Event in C#

Dotnet Framework (Interop) microsoft.public.dotnet.framework.interop


Discuss C++ Sink Event in C# in the Dotnet Framework (Interop) forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
MICHAEL CARR
 
Posts: n/a

Default C++ Sink Event in C# - 12-16-2004 , 05:34 PM






I am trying to subscribe to C++ Sink Event in C#, here is how we did it in C++.

..h
CComPtr<IPEvents> m_pPortEvent;
DWORD m_eventNotifierCookie, m_ServerNotifierCookie;

DECLARE_DISPATCH_MAP()
DECLARE_INTERFACE_MAP()

..cpp
class()

BEGIN_DISPATCH_MAP( CClass, CWnd)
DISP_FUNCTION_ID(CClass, "Notify",1, OnEventNotify, VT_EMPTY, VTS_BSTR VTS_I4 VTS_BSTR)
END_DISPATCH_MAP( )

BEGIN_INTERFACE_MAP( CClass, CWnd)
INTERFACE_PART(CClass, DIID__IOnNotify, Dispatch)
END_INTERFACE_MAP()

if(SUCCEEDED(m_pPortEvent.CoCreateInstance(__uuido f(PEvents))))
{
EnableAutomation( );
m_pPortEvent->raw_AdviseCallBk(reinterpret_cast<IUnknown*>(GetI Dispatch(FALSE)), _bstr_t(strComPort), &m_eventNotifierCookie);

}

How can I do the same thing in C#?


--
MICHAEL CARR

Reply With Quote
  #2  
Old   
Zoury
 
Posts: n/a

Default Re: C++ Sink Event in C# - 01-05-2005 , 12:31 PM






Hi Micheal! :O)

take a look at this article
http://support.microsoft.com/kb/811645/EN-US/

and, please, post in a plain text format. ;O)

--
Best Regards
Yanick

"MICHAEL CARR" <mcarr67 (AT) email (DOT) uophx.edu> a écrit dans le message de
news:uZVxQf84EHA.1564 (AT) TK2MSFTNGP09 (DOT) phx.gbl...
I am trying to subscribe to C++ Sink Event in C#, here is how we did it in
C++.

..h
CComPtr<IPEvents> m_pPortEvent;
DWORD m_eventNotifierCookie, m_ServerNotifierCookie;

DECLARE_DISPATCH_MAP()
DECLARE_INTERFACE_MAP()

..cpp
class()

BEGIN_DISPATCH_MAP( CClass, CWnd)
DISP_FUNCTION_ID(CClass, "Notify",1, OnEventNotify, VT_EMPTY, VTS_BSTR
VTS_I4 VTS_BSTR)
END_DISPATCH_MAP( )

BEGIN_INTERFACE_MAP( CClass, CWnd)
INTERFACE_PART(CClass, DIID__IOnNotify, Dispatch)
END_INTERFACE_MAP()

if(SUCCEEDED(m_pPortEvent.CoCreateInstance(__uuido f(PEvents))))
{
EnableAutomation( );

m_pPortEvent->raw_AdviseCallBk(reinterpret_cast<IUnknown*>(GetI Dispatch(FALS
E)), _bstr_t(strComPort), &m_eventNotifierCookie);

}

How can I do the same thing in C#?


--
MICHAEL CARR



Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.