Newbie in need
I''m trying to learn programming for windows, but I can''t get a dialog box up.
While compiling I get the following errormessage:
''DialogBoxParamA'': cannot convert parameter 4 from ''int(void *,unsigned int,unsigned int,long)'' to ''int(_stdcall *)(void)''
the line in question reads:
DialogBox (hInstance, MAKEINTRESOURCE(IDD_NIEUW), hwnd, NieuwDlgProc);
I''m using VC++
can anyone help?
Hi,
I Assume that the function NieuwDlgProc is defined proparly this means that you only need to cast it for the compiler:
DialogBox (hInstance, MAKEINTRESOURCE(IDD_NIEUW), hwnd, (DLGPROC)NieuwDlgProc); DLGPROC ==> I''m not sure that this is the definition because i don''t have my msdn on my laptop but I think you get the idea
I Assume that the function NieuwDlgProc is defined proparly this means that you only need to cast it for the compiler:
DialogBox (hInstance, MAKEINTRESOURCE(IDD_NIEUW), hwnd, (DLGPROC)NieuwDlgProc); DLGPROC ==> I''m not sure that this is the definition because i don''t have my msdn on my laptop but I think you get the idea
Thanks a lot! That worked!
Still i'm missing something, in sample programs (DLGPROC) isn't necessary, why is it in my program?
anyway i can now continue, thanx again
Edited by - Maxxes on December 18, 2000 9:10:42 AM
Still i'm missing something, in sample programs (DLGPROC) isn't necessary, why is it in my program?
anyway i can now continue, thanx again
Edited by - Maxxes on December 18, 2000 9:10:42 AM
It may be that they are defined as some differnt kind of function type...
- Sleepwalker
- Sleepwalker
- Sleepwalker
it may be because the sample programs are .c files, and you''re probably compiling .cpp files, C++ has stricter type-checking
December 19, 2000 02:31 PM
How are you declaring NieuwDlgProc?
It should be:
BOOL CALLBACK NieuwDlgProc( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam );
You don''t want to type cast it in your DialogBox function, because if you change calling conventions the stack may not get cleaned up...
It should be:
BOOL CALLBACK NieuwDlgProc( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam );
You don''t want to type cast it in your DialogBox function, because if you change calling conventions the stack may not get cleaned up...
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement