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 / May 2004

Tip: Looking for answers? Try searching our database.

Hosting .Net controls in Win32 application

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jan Hornych - 25 May 2004 10:13 GMT
Hi,
I have a classic Win32 application, which should stay developed for some
more time, until a brand new product is finished. It would be nice to write
new modules in .NET WinForms and dock them as child windows in the old Win32
Frame window. Is this thinkable ?

The issues I see:
1. Child window relationship
I can use SetParent API to host the child Form, this looks to work fine. But
when the form gets hidden and shown again, it gets new window handle. Is
this behavior described anywhere ?

2. Message loop
Can the hosting Win32 application do message handling also for .NET windows
just with GetMessage/TranslateMessage/DispatchMessage? It appears to work
but I have strange feeling about going around .NET's message loop ... Using
separate threads would be better, I think, but much less comfortable.

Is there a clean way to do this or is it impossible ? I will appreciate all
opinions and resources.

I remember there was a possibility to register a .NET control as ActiveX in
Beta version of Framework. How did that work ? Could it be used anyhow now ?

Thanks for answers,
Jan
Morten Overgaard - 26 May 2004 21:22 GMT
MFC 7.1 supports hosting .Net usercontrols ( as ActiveX Controls )
http://msdn.microsoft.com/msdnmag/issues/03/03/WindowsForms/default.aspx

I have succesfully done it.
Regards Morten

> Hi,
> I have a classic Win32 application, which should stay developed for some
[quoted text clipped - 22 lines]
> Thanks for answers,
> Jan
Jan Hornych - 27 May 2004 07:34 GMT
Thanks, Morten, this looks interesting.
Regards,
Jan

> MFC 7.1 supports hosting .Net usercontrols ( as ActiveX Controls )
> http://msdn.microsoft.com/msdnmag/issues/03/03/WindowsForms/default.aspx
[quoted text clipped - 36 lines]
> > Thanks for answers,
> > Jan

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.