Problem with DialogBoxParamA
I''m using DirectX sdk8. When I try to compile examples from catalogue Direct3D there is an error. I don''t know what is wrong, I haven''t changed anything in this workspace. I have also problems when i try to compile DirectDraw examples, but first I would like to solve problem with Direct3D.
Compiling...
d3dapp.cpp
D:\common\src\d3dapp.cpp(1308) : error C2664: ''DialogBoxParamA'' : cannot convert parameter 4 from ''long (struct HWND__ *,unsigned int,unsigned int,long)'' to ''int (__stdcall *)(struct HWND__ *,unsigned int,unsigned int,long)''
None of the functions with this name in scope match the target type
d3dfile.cpp
d3dfont.cpp
d3dutil.cpp
dxutil.cpp
BumpEarth.cpp
Error executing cl.exe.
BumpEarth.exe - 1 error(s), 0 warning(s)
quote: Original post by Sokol
Compiling...
d3dapp.cpp
D:\common\src\d3dapp.cpp(1308) : error C2664: ''DialogBoxParamA'' : cannot convert parameter 4 from ''long (struct HWND__ *,unsigned int,unsigned int,long)'' to ''int (__stdcall *)(struct HWND__ *,unsigned int,unsigned int,long)''
I believe you can cast the whole thing from an int to a long
TechleadEnilno, the Ultima 2 projectwww.dr-code.org/enilno
Your dialog message handler has not been correctly declared. It should be:
The CALLBACK is important as the OS expects a particular calling convention and you may have something like __fastcall enabled so things will go really tits up when you run it. I''m guessing you''re returning an LRESULT value (typedef''d as long) from your handler and not a BOOL (typedef''d as int).
Do not cast the forth parameter to the correct type - sort out the declaration of the dialog handler. C style casts are evil (unless you''re coding in C, that is, then you''ve got no alternative).
Skizz
BOOL CALLBACK your_dialog_message_handler( HWND hwndDlg, // handle to dialog box UINT uMsg, // message WPARAM wParam, // first message parameter LPARAM lParam // second message parameter);
The CALLBACK is important as the OS expects a particular calling convention and you may have something like __fastcall enabled so things will go really tits up when you run it. I''m guessing you''re returning an LRESULT value (typedef''d as long) from your handler and not a BOOL (typedef''d as int).
Do not cast the forth parameter to the correct type - sort out the declaration of the dialog handler. C style casts are evil (unless you''re coding in C, that is, then you''ve got no alternative).
Skizz
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement