HighTechTalks DotNet Forums  

C# control needs to notify C++ application

Dotnet Framework (Interop) microsoft.public.dotnet.framework.interop


Discuss C# control needs to notify C++ application in the Dotnet Framework (Interop) forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
aaron.m.johnson@gmail.com
 
Posts: n/a

Default C# control needs to notify C++ application - 06-27-2007 , 06:09 PM






I'm writing a C# control that needs to be able to notify the parent
application of certain events. If the application were also using
the .NET platform I'd just use a delegate. Unfortunately the
application is writen in unmanaged C++.

Is there some way for me to send a message or execute a callback from
the control that the application can process?


Reply With Quote
  #2  
Old   
Ben Voigt [C++ MVP]
 
Posts: n/a

Default Re: C# control needs to notify C++ application - 06-29-2007 , 03:36 AM







<aaron.m.johnson (AT) gmail (DOT) com> wrote

Quote:
I'm writing a C# control that needs to be able to notify the parent
application of certain events. If the application were also using
the .NET platform I'd just use a delegate. Unfortunately the
application is writen in unmanaged C++.

Is there some way for me to send a message or execute a callback from
the control that the application can process?

For a GUI control, post a notification message to the parent window (see
WM_NOTIFY, BN_CLICKED for example).

For non-GUI components, a function pointer is much like a delegate.
Remember to include an extra parameter set at the time of subscription,
sizeof void* or larger, for the caller to pass his "this" pointer or some
other data he wants.



Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.