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 / Languages / Managed C++ / October 2007

Tip: Looking for answers? Try searching our database.

Launching one CWinFormsDialog from another

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
James - 23 Oct 2007 12:49 GMT
What I'm basically trying to do is show one form from another when an event
occurs.
This is obviously straightforward in c#, but I'm struggling in c++ where
each is wrapped in a CWinFormsDialog.
The event is in the control in the CWinFormsDialog. I need the dialog to
handle it and show the other CWinFormsDialog.

I've created a custom event in the user control thats handled by its
wrapping CWinFormsDialog.
However when I try to call the other CWinFormsDialog I'm getting thread
problems.

I'm currently trying the following in my user control:
IAsyncResult result = MyEvent.BeginInvoke(this, myEventArgs, null, null);
MyEvent.EndInvoke(result);

In my c++ dialog I do a PostMessage and a handler causes the other dialog to
show.
Doing a PostMessage rather than a direct call solved the thread problems in
the past before I wrapped my forms with CWinFormsDialog.

It just hangs and eventually the following appear in the output:
The thread 'Win32 Thread' (0x308) has exited with code 0 (0x0).
The thread 'Win32 Thread' (0x21c) has exited with code 0 (0x0).

Can anyone suggest the best approach?
James - 24 Oct 2007 13:44 GMT
This is a known bug, although microsoft have done their usual PR excercise of
denying it exists, closing the bug report with "Closed (Not Reproducible)"
and then mysteriously slipping a fix for it into the next version (2008).
I find this disgusting as if it had been an accepted bug, I could have found
information on it more easily and wouldn't have lost 3 days development time.

See the workaround at:
https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID
=294705


> What I'm basically trying to do is show one form from another when an event
> occurs.
[quoted text clipped - 22 lines]
>
> Can anyone suggest the best approach?
James - 24 Oct 2007 13:46 GMT
This is a known bug, although microsoft have done their usual PR excercise of
denying it exists, closing the bug report with "Closed (Not Reproducible)"
and then mysteriously slipping a fix for it into the next version (2008).
I find this disgusting as if it had been an accepted bug, I could have found
information on it more easily and wouldn't have lost 3 days development time.

See the workaround at:
https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID
=294705


> What I'm basically trying to do is show one form from another when an event
> occurs.
[quoted text clipped - 22 lines]
>
> Can anyone suggest the best approach?
James - 24 Oct 2007 13:46 GMT
This is a known bug, although microsoft have done their usual PR excercise of
denying it exists, closing the bug report with "Closed (Not Reproducible)"
and then mysteriously slipping a fix for it into the next version (2008).
I find this disgusting as if it had been an accepted bug, I could have found
information on it more easily and wouldn't have lost 3 days development time.

See the workaround at:
https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID
=294705


> What I'm basically trying to do is show one form from another when an event
> occurs.
[quoted text clipped - 22 lines]
>
> Can anyone suggest the best approach?

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.