Launching one CWinFormsDialog from another

G

Guest

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?
 
G

Guest

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
 
G

Guest

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
 
G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top