p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   BOOK: Beginning Visual C++ 6 (http://p2p.wrox.com/forumdisplay.php?f=36)
-   -   Chapter 17 - Displaying the dialog box (http://p2p.wrox.com/showthread.php?t=48241)

davidd31415 September 24th, 2006 04:14 PM

Chapter 17 - Displaying the dialog box
 
I am guessing I will figure this out before a response is posted here, but perhaps this will help someone else.

On page 713, when creating the OnPenwidth menu item handler to display the pen width dialog box, the text says:

There are just two statements in the handler at the moment. The first creates a dialog object which is automatically associated with our dialog resource.

Automatically? How does it know WHICH dialog resource I want to display? Aside from not being able to get the dialog to display I don't see how the code would KNOW what dialog to display in the first place!

Dave



davidd31415 September 24th, 2006 04:46 PM

Sure enough, that didn't take long to figure out!

In the OnPenwidth() handler when the CPenDialog data member is created in

CPenDialog aDlg;

it associates itself with the Dialog that was selected using the class wizard. I selected the wrong dialog originally. Deleting the CPenDialog class that I had made proved to be a bit confusing: I used the Solution Explorer (note I'm using Visual Studio 2003, not V6) to REMOVE the .h and .cpp files but then ended up having to manually delete several lines. I'm expecting more errors from this housekeeping to come up in the future- I need to learn how to properly remove classes from a project.




All times are GMT -4. The time now is 05:37 AM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.