This topic is now archived and is closed to further replies.

Dialog Box Button Problems

This topic is 5087 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I''m working on a program with a dialog box but I can''t seem to get the button to do what they are supposed to do. What I want: 4 Buttons: OK, Cancel, Readme, About OK -- goes to next step Cancel -- ends program Readme -- opens another dialog box with info on how the program works About -- Made by ... 2004, Version 1.00 In the resource editor I put down the buttons. Respectively, the button''s ID are IDOK, IDCANCEL, IDC_BUTTON1, IDC_BUTTON2. In the dialog''s callback, IDOK and IDCANCEL work just fine and do what they are supposed to when I click on the button. However, with the IDC_BUTTON1 and 2 I need to do a #define line at the top of the file. Okay... I decide to set the defines as such: #define IDC_BUTTON1 1001 #define IDC_BUTTON2 1002 My problem is, I can never get both buttons to work, and I get strange behavior by doing things that I think shouldn''t matter, such as changing the order of the #defines or the cases in the callback or even where the button is placed on the dialog box. When I swap the #defines, the callback''s switch statement will choose the wrong case. I think the solution has something to do with the numbers in the defines, but I don''t really know what they mean since I learned this from examining sample code. Can anybody explain what''s going on with using dialog box buttons?

Share this post

Link to post
Share on other sites