![](smile.gif)
what is wrong with my dialogbox
I try show dialog box that I''ve made resource editor
LPCTSTR ST=MAKEINTRESOURCE(dialog);
int i=::DialogBox(hInst,ST,NULL,DLGPROC(DialogProc));
I have tried to searh all over VC++ help but I just can''t find the reason why that doesn''t work. I just got "stack overflow" error.
It shouldn''t be any missing library I think...
help would be appreciated.
What it is that I''ve forgotten
?
![](smile.gif)
God saw all that he had made. Shit happens sometimes. --the sixth day.
May 02, 2001 09:23 AM
Stack overflow usually means there is something obvious and easy that is wrong. Usually something is recursively calling itself (like the wndproc) till it eventually runs out of stack space. Make sure the dialog template doesn''t already have a ''string'' identifier (you only need MAKEINTRESOURCE if it has an integer identifier). You could also try giving the dialog a non-null owner window. My first choice would be to look at the dialog proc that you''ve defined (you did do that didn''t you?) I would certainly not call it DialogProc in any case. Call it like MyDialogProc or something and make sure you call the DefWindowProc at the bottom of it. That''s probably the culprit.
Hope that helps
Hope that helps
No, make sure you DON''T call DefWindowProc at the and of DialogProc. I tested it and it locked up the program. Didn''t cause an error, but I had to ctrl+alt+delete it.
DefWindowProc is for normal windows, not dialog boxes.
-Deku-chan
DK Art (my site, which has little programming-related stuff on it, but you should go anyway^_^)
DefWindowProc is for normal windows, not dialog boxes.
-Deku-chan
DK Art (my site, which has little programming-related stuff on it, but you should go anyway^_^)
May 02, 2001 04:41 PM
D''oh! Actually you are exactly correct. It says under the MSDN help page for DialogProc:
"Although the dialog box procedure is similar to a window procedure, it must not call the DefWindowProc function to process unwanted messages. Unwanted messages are processed internally by the dialog box window procedure."
Sorry it has been too long since I did dialog boxes without MFC
Good catch Deku!
"Although the dialog box procedure is similar to a window procedure, it must not call the DefWindowProc function to process unwanted messages. Unwanted messages are processed internally by the dialog box window procedure."
Sorry it has been too long since I did dialog boxes without MFC
Good catch Deku!
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement