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