I have a view that contains a modeless dialog.
Everything works fine except interacting with the dialog sends a message to modify objects on current active view. It causes crush when i switching to a new view or another view, because the object does not exist in that new view.
I want to ask how to close out the modeless dialog whenever the view is switched?
Should it be handled in the view class or document class?
The message route is Dialog ->send user defined message -> mainframe -> get current active view -> pass on the message -> view message handle receive the msg
Thanks
And, it may make more sense to do it in the frame of the view. So...
In the .h:
in the .cpp:
And if you would want to toggle the dialog, say with a menu item as a switch. Instead of creating it in
OnInitialUpdate, you could:I hope that makes sense.