Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Interop / January 2005

Tip: Looking for answers? Try searching our database.

C++ Sink Event in C#

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
MICHAEL CARR - 16 Dec 2004 23:34 GMT
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(__uuidof(PEvents))))
{
     EnableAutomation( );
     m_pPortEvent->raw_AdviseCallBk(reinterpret_cast<IUnknown*>(GetIDispatch(FALSE)), _bstr_t(strComPort), &m_eventNotifierCookie);
     
}

How can I do the same thing in C#?

Signature

MICHAEL CARR

Zoury - 05 Jan 2005 18:31 GMT
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)

Signature

Best Regards
Yanick

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(__uuidof(PEvents))))
{
     EnableAutomation( );

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

}

How can I do the same thing in C#?

Signature

MICHAEL CARR


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.