Archived

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

origil

Evil Dialog Boxes...

Recommended Posts

I created a dialog box resource, but now when I create the dialog box with the DialogBox function the box simply doesn''t appear nor is it in use, I put a messagebox in the initialization code to check if it even reads it and it doesn''t. DialogBox(main_instance,MAKEINTRESOURCE(ID_MapSizeDialog),NULL,(DLGPROC)&MapSizeProc); When I change the NULL to main_window_handle which is the handle to the program''s main window, the initialization code works and displays a message box and after that the dialog box appears in the main window but everything is stuck, the only thing I can do is shut it down using the Ctrl+Alt+Del. Any ideas? Any help would be greatly appreciated.

Share this post


Link to post
Share on other sites
I had that problem to (only with DialogBoxParam()) and it was because I screwed up the message handler... like none of the messages we''re actually handled, only FALSE was returned.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Thanks for the reply, my message handler was fine, the resource had an undefinded item.
But now I''ve got another problem if anyone could be kind enough to solve...
I know how to use the WM_GETLINE message for retreiving text in the form of char, but how can I retreive a number which was typed in the edit box in whole and not in an array?

Share this post


Link to post
Share on other sites
#include
using namespace std;

int main(void) {
char szBuffer[5] = "1234";
int iNumber = atoi(szBuffer);
return 0;
}

This converts the numeric string "1234" into the integral equivalent, the number 1234. Hope this was what you were looking for. Good luck.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Also, you could take a look at GetDlgItemInt, GetDlgItemText (and SetDlgItemInt...), there are quite useful


Chris

Share this post


Link to post
Share on other sites