M
Mayur Gadhave
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")
}
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")
}