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 / Windows Forms / WinForm Controls / March 2008

Tip: Looking for answers? Try searching our database.

Hosting running instance of a C# control in an MFC CWnd

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
kli@scandpowerpt.com - 28 Mar 2008 10:46 GMT
Hi,
I'm not sure if this is the best group to post this issue on, but I'll
try.

I have an existing MFC doc/view application, To this application I've
made a C# plugin interface for hosting
.NET controls in the CView. I'm using CWinFormsControl<Control> to
manage the unmanged/manage hosting. The .NET assembly is responsible
for all the .NET control creations, and only the Control^ is given to
the MFC View for it to host it. So this senario leads me to use:

CreateManagedControl( i_ctrl,WS_VISIBLE|WS_CHILD|WS_TABSTOP,
CRect(0,0,0,0), i_pParent, 0);

Where i_ctr is the running instance of the control^, and i_pParent is
the parent CWnd*.

My problem is that when a UserControl of many TextBoxes (all .NET) is
presented, the Tab order doesn't work. Neither does the "Return" key
in the TextBoxes. The only thing that happens is a biip. These are all
singlelline textboxes, and the Tab order is given. When debugging, I
see that the Parent property of the UserControl is null, even though
i_pParent != NULL. I'm not sure if this is the root of the problem or
not.

I also have a C# test application where everything works fine. (Here
the parent is the correct Control).

Hope anybody can help me out.

Regards,
Kjetil.
Sheng Jiang[MVP] - 28 Mar 2008 20:34 GMT
I am not sure if these behaviors need a parent form. See if calling MFC
message filters from a .net message pump works for you or not. You can
search "CMFCWinFormHybridApp" for the source code.--
Sheng Jiang
Microsoft MVP in VC++

> Hi,
> I'm not sure if this is the best group to post this issue on, but I'll
[quoted text clipped - 28 lines]
> Regards,
> Kjetil.
kli@scandpowerpt.com - 31 Mar 2008 07:34 GMT
Hi,
and thanks for your reply.
I tried to locate the source code for CMFCWinFormHybridApp, but I was
unable to find it.
Could you please give me an url to it?

Regards,
Kjetil.

On 28 Mar, 22:26, "Sheng Jiang[MVP]" <sheng_ji...@hotmail.com.discuss>
wrote:
> I am not sure if these behaviors need a parent form. See if callingMFC
> message filters from a .net message pump works for you or not. You can
[quoted text clipped - 40 lines]
>
> - Show quoted text -

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.