473,326 Members | 2,124 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

adding a event handler in MFC application for c# event

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")

}

Aug 30 '06 #1
0 1169

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: RobG | last post by:
I am trying to dynamically add an onclick to an element, however I just can't get the syntax right. consider the following function: function doClick (evt,x) { // do things with evt and x } ...
2
by: laredotornado | last post by:
Hello, I am looking for a cross-browser way (Firefox 1+, IE 5.5+) to have my Javascript function execute from the BODY's "onload" method, but if there is already an onload method defined, I would...
3
by: Jim Heavey | last post by:
Trying to figure out the technique which should be used to add rows to a datagrid. I am thinking that I would want an "Add" button on the footer, but I am not quite sure how to do that. Is that...
2
by: Tim Marsden | last post by:
Hi, This is what I am doing, please comment if this is the correct way. I need to add controls to a form dynamically. Within the Page_Load event (is not Postback) I run a routine to create the...
6
by: Just Me | last post by:
I need to create a library sub that adds event handlers to a control. Public Shared Sub AddEvent(ByVal qq As Control, By?? ControlMouseMove As ??) So I need to pass the address of the handler or...
2
by: Mayur Gadhave | last post by:
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#...
5
by: J | last post by:
I am having problems dynamically adding more than one event handler to an input. I have tried the Javascript included at the bottom. The lines inp.attachEvent('onkeyup',...
1
by: The Eclectic Electric | last post by:
I'd be very grateful if anyone could help me with this. From my limited knowledge of Javascript I don't think it is possible, but I'll punt anyway. I downloaded and very slightly adapted this...
21
by: John Henry | last post by:
Hi list, I have a need to create class methods on the fly. For example, if I do: class Dummy: def __init__(self): exec '''def method_dynamic(self):\n\treturn self.method_static("it's...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.