473,401 Members | 2,146 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,401 software developers and data experts.

Can it be done??

Hi

I have a C# component which fires events. I want to catch these events in my
MFC app compiled with the /clr.
I know I can define a managed class in my MFC app which traps the events -
but I need to catch the event in an unmanaged class inside my MFC App.

Can this be done.

regards Morten

Nov 16 '05 #1
5 1371
Check article COM Connection Points By Alex C. Punnen on
codeproject.com
(http://www.codeproject.com/com/connectionpoint.asp?
target=COM%7CConnection%7CPoints)
-----Original Message-----
Hi

I have a C# component which fires events. I want to catch these events in myMFC app compiled with the /clr.
I know I can define a managed class in my MFC app which traps the events -but I need to catch the event in an unmanaged class inside my MFC App.
Can this be done.

regards Morten

.

Nov 16 '05 #2
Thanks for the answer.
I know that it can be done through interop - but that is not what I want (
If I can do it in a cleaner way )
I want to catch the events in my unmanaged c++ class without the cominterop
layer - can this be done??

regards Morten
"ququ" <an*******@discussions.microsoft.com> wrote in message
news:02****************************@phx.gbl...
Check article COM Connection Points By Alex C. Punnen on
codeproject.com
(http://www.codeproject.com/com/connectionpoint.asp?
target=COM%7CConnection%7CPoints)
-----Original Message-----
Hi

I have a C# component which fires events. I want to catch

these events in my
MFC app compiled with the /clr.
I know I can define a managed class in my MFC app which

traps the events -
but I need to catch the event in an unmanaged class

inside my MFC App.

Can this be done.

regards Morten

.

Nov 16 '05 #3
Hi Morten,

Nice to see you again!

To my knowledge, there is no way to catch the events in unmanaged C++ code
without the ComInterop layer. As I know, the unmanaged C++ is not a CLR
language, so it has no generic method to catch the CLR language event.
Best Regards

Gary Chang
Microsoft Online Partner Support
Get Secure! – www.microsoft.com/security
This posting is provided "AS IS" with no warranties,and confers no rights.
--------------------
| Reply-To: "Morten Overgaard" <mo*@oticon.dk>
| From: "Morten Overgaard" <mo*@oticon.dk>
| References: <OF**************@TK2MSFTNGP09.phx.gbl>
<02****************************@phx.gbl>
| Subject: Re: Can it be done??
| Date: Tue, 28 Oct 2003 20:18:14 +0100
| Lines: 35
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <Ov**************@tk2msftngp13.phx.gbl>
| Newsgroups: microsoft.public.dotnet.languages.vc
| NNTP-Posting-Host: 213.129.10.254
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftn gp13.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.vc:29823
| X-Tomcat-NG: microsoft.public.dotnet.languages.vc
|
| Thanks for the answer.
| I know that it can be done through interop - but that is not what I want (
| If I can do it in a cleaner way )
| I want to catch the events in my unmanaged c++ class without the
cominterop
| layer - can this be done??
|
| regards Morten
| "ququ" <an*******@discussions.microsoft.com> wrote in message
| news:02****************************@phx.gbl...
| > Check article COM Connection Points By Alex C. Punnen on
| > codeproject.com
| > (http://www.codeproject.com/com/connectionpoint.asp?
| > target=COM%7CConnection%7CPoints)
| >
| > >-----Original Message-----
| > >Hi
| > >
| > >I have a C# component which fires events. I want to catch
| > these events in my
| > >MFC app compiled with the /clr.
| > >I know I can define a managed class in my MFC app which
| > traps the events -
| > >but I need to catch the event in an unmanaged class
| > inside my MFC App.
| > >
| > >Can this be done.
| > >
| > >regards Morten
| > >
| > >
| > >
| > >.
| > >
|
|
|

Nov 16 '05 #4
Hi Gary :-)

Actually I figured it out late last night.
You can use a managed c++ class to catch the .Net event. The managed c++
class is allowed to keep references to unmanaged c++ classes thereby letting
the managed c++ class call into the unmanaged c++ class. Works like a charm

regards Morten

"Gary Chang [MSFT]" <v-******@online.microsoft.com> wrote in message
news:Lc**************@cpmsftngxa06.phx.gbl...
Hi Morten,

Nice to see you again!

To my knowledge, there is no way to catch the events in unmanaged C++ code
without the ComInterop layer. As I know, the unmanaged C++ is not a CLR
language, so it has no generic method to catch the CLR language event.
Best Regards

Gary Chang
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties,and confers no rights.
--------------------
| Reply-To: "Morten Overgaard" <mo*@oticon.dk>
| From: "Morten Overgaard" <mo*@oticon.dk>
| References: <OF**************@TK2MSFTNGP09.phx.gbl>
<02****************************@phx.gbl>
| Subject: Re: Can it be done??
| Date: Tue, 28 Oct 2003 20:18:14 +0100
| Lines: 35
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <Ov**************@tk2msftngp13.phx.gbl>
| Newsgroups: microsoft.public.dotnet.languages.vc
| NNTP-Posting-Host: 213.129.10.254
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftn gp13.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.vc:29823
| X-Tomcat-NG: microsoft.public.dotnet.languages.vc
|
| Thanks for the answer.
| I know that it can be done through interop - but that is not what I want ( | If I can do it in a cleaner way )
| I want to catch the events in my unmanaged c++ class without the
cominterop
| layer - can this be done??
|
| regards Morten
| "ququ" <an*******@discussions.microsoft.com> wrote in message
| news:02****************************@phx.gbl...
| > Check article COM Connection Points By Alex C. Punnen on
| > codeproject.com
| > (http://www.codeproject.com/com/connectionpoint.asp?
| > target=COM%7CConnection%7CPoints)
| >
| > >-----Original Message-----
| > >Hi
| > >
| > >I have a C# component which fires events. I want to catch
| > these events in my
| > >MFC app compiled with the /clr.
| > >I know I can define a managed class in my MFC app which
| > traps the events -
| > >but I need to catch the event in an unmanaged class
| > inside my MFC App.
| > >
| > >Can this be done.
| > >
| > >regards Morten
| > >
| > >
| > >
| > >.
| > >
|
|
|

Nov 16 '05 #5
Hello Morten,

Thanks for sharing your lucid method with us!

Thanks for response!
Best regards!

Gary Chang
Microsoft Online Partner Support
Get Secure! – www.microsoft.com/security
This posting is provided "AS IS" with no warranties,and confers no rights.
--------------------

Nov 16 '05 #6

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

Similar topics

0
by: itsharkopath | last post by:
Hi, Imagine a user in a hotspot, when he comes to the hotspot and tries to load a webpage (on the internet), he would automatically redirected to login page. I believe the following is to be...
9
by: Steven T. Hatton | last post by:
This was written for the gnu.g++.help list. It rather clearly spells out the most important feature of Java that I believe C++ lacks. I really don't believe the C++ Standard sepcifies enough for a...
16
by: jaialai technology | last post by:
I want to reload a url in a browser window so I do something like this: open(window.location.href= "www.yahoo.com"); ok, so now I want to do something when that page is done loading completely....
11
by: Sharon | last post by:
I'm writing a new control derived from UserControl. I need to get an event when the control is done resizing. I tried the Resize, SizeChanged, Move and the Layout events and I also tried to...
3
by: Miguel Dias Moura | last post by:
Hi, When I subscribe a web site I usually receive an email to confirm my subscription. Only after I follow the link in the email my account gets activated. In general, how is this done? Can...
4
by: BrianDH | last post by:
Group Early this week I ask for examples on how to call a VB.NET Web Service and access its DataSet for a traditional ASP page. I was told, "you can't", "won't work", "not possible". Well I...
12
by: Ark | last post by:
Hello NG, I arrange data in structs like { members... uint16_t crc; more members, maybe... } Then I need to save them, up to and including crc, in non-volatile memory or a file, as the case...
2
by: maya | last post by:
http://news.yahoo.com/news?tmpl=index2&cid=703 down the page, under "More Stories", there's a section with two interchangeable divs which slide back and forth into view.. how is this done? I...
2
by: poolboi | last post by:
hey guys, i've done most of my web app. for searching almost done but then i got a small little problem with logging in i need to know how session tracking is done in perl if not my log in page...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.