Site Sections

Thursday, May 15, 2008

And Life Goes On...

I did it, I broke down and got Visual Studios 2008 professional edition. I can continue now with my original plan for my editor.

A thing of note: Using a dialog in an application of its own - easy. Using dialogs in combination, when you want more than one dialog on the screen and active at the same time - eh... not so easy. The key is to use Modaless dialog boxes (those created with the .Create(IID, hwnd) function instead of the DoModal() function), be sure to keep a reference to these dialog boxes outside of the InitInstance() funciton of your main app class otherwise, when the function ends, so will the app. Then map the OnClose message handler to the window (or windows) that you want to be the "Main Window" of the application. This handler should then post the PostQuitMessage() function to kill the application in the even that the window is closed.

I ran into this issue because I have two dialogs, an editor window, and a properties window (which seems to stay on top of the editor window all the time - this is a different issue though), and these windows, when closed do not by default kill the application when set up in a Modal fashion. So now I have my editor set up as my "Main Window" (by keeping a reference outside of the InitInstance() function and setting the m_pMainWnd pointer equal to my Editor dialog, and when ever this window is closed, the Editor posts the quit message so the app will close.

I didn't really want to use a Window Frame here or an MDI style application as I want my editor to have a Gimp like feel, with all the tools/properties windows being a movable separate entity from the viewport I am working on.

As such as this post is so well entitled, Life does go on... and so does development.

2 comments:

Craig said...

VS2008 FTW!

Unknown said...

Yes, Visual Studios 2008 is probably the best IDE I've ever worked with.