PC Review


Reply
Thread Tools Rate Thread

adding a event handler in MFC application for c# event

 
 
Mayur Gadhave
Guest
Posts: n/a
 
      30th Aug 2006
Hello all,
Im trying to call my .net c# library functions from my unmanaged
vc++(dialog based MFC)
application .
From that application i want add the event handler for the event generated
in c# dll
so how to do that
Here is my code..


#using <mscorlib.dll>

#using "ircConnect.dll" //This is the c# dll reference


__gc class GlobalObjects

{

#pragma push_macro("new")

#undef new

public: static ircConnect::IrcConnection *iIRC =new
ircConnect::IrcConnection();


public:

__event ircConnect::IrcConnection::MessageEventHandler* MessageIncome;



#pragma pop_macro("new")

};

void CMyMFCDlg::OnBnClickedOk()

{

#pragma push_macro("new")

#undef new

GlobalObjects* m_proxyChat;

m_proxyChat = new GlobalObjects();

GlobalObjects *MyX = new GlobalObjects();


m_proxyChat->MessageIncome += new
ircConnect::IrcConnection::MessageEventHandler(MyX,GlobalObjects::OnMessageIncome);
//This is the event handler im trying to add

m_proxyChat->iIRC->Connect("testing");

m_proxyChat->iIRC->joinchannel("abhishek","abhishek","#guildae");

#pragma pop_macro("new")

}



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding event handler in C# ? Rich P Microsoft C# .NET 5 8th Mar 2009 08:18 AM
adding a event handler in MFC application for c# event Mayur Gadhave Microsoft VC .NET 2 30th Aug 2006 08:14 AM
Adding an event handler in a sub Just Me Microsoft VB .NET 6 3rd Sep 2004 09:57 PM
Adding an event handler in a sub Just Me Microsoft VB .NET 7 10th Aug 2004 01:29 AM
Adding an event handler for Outlook using VB (not VBA) Ted Byers Microsoft Outlook Program Addins 2 20th Jan 2004 03:36 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:59 AM.