Can it be done??

  • Thread starter Thread starter Morten Overgaard
  • Start date Start date
M

Morten Overgaard

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
 
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
 
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" <[email protected]>
| From: "Morten Overgaard" <[email protected]>
| References: <[email protected]>
<[email protected]>
| 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: <[email protected]>
| Newsgroups: microsoft.public.dotnet.languages.vc
| NNTP-Posting-Host: 213.129.10.254
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftngp13.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
| | > 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
| > >
| > >
| > >
| > >.
| > >
|
|
|
 
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
 
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.
--------------------
 
Back
Top