Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Interop / June 2007

Tip: Looking for answers? Try searching our database.

C# control needs to notify C++ application

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
aaron.m.johnson@gmail.com - 27 Jun 2007 23:09 GMT
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?
Ben Voigt [C++ MVP] - 29 Jun 2007 08:36 GMT
> 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
[quoted text clipped - 3 lines]
> 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.

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.