Skip to main content
gamedev.net
🔒 Locked

D3DAPP.cpp problems

Started by dwmitch Apr 9, 2004 at 2:29 PM 8 replies 700+ views
Original Post
dwmitch
dwmitch
I was trying to compile some examples from the CD that came with Beginning Direct 3D Game Programming, but I keep getting a conversion error in D3DAPP.cpp in the SelectDevice function. I didn''t alter any files (especially the common files), and they use to compile, but somehow either the function declaration got changed or the parameter being passed was changed, but I don''t know how it could have happened.
300In the land of the proud and freeyou can sell your soul and your dignityfor fifteen minutes on tvhere in Babylon.
guyaton
guyaton
Could you be a little more specific with the error and it will help us help you out.

~Guyaton
~guyaton
Dodzilla
Dodzilla
Check your include paths and make sure the paths for the version of the SDK you installed are BEFORE the default VC++ paths.
dwmitch
dwmitch
The error is

quote:
d3dapp.cpp
C:\mssdk\samples\Multimedia\Common\src\d3dapp.cpp(1225) : 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
Error executing cl.exe.

BASIC.exe - 1 error(s), 0 warning(s)


It compiled fine when I first installed it, and the files have always maintained read only status, meaning I couldn''t have changed it. I can''t figure out how else it would bave been changed.

The DMBoids example compiles, and I think it uses D3DAPP, so I don''t know what the problem is.

A bit off topic, due to circumstances beyond my control the debate in the lounge passed its statute of limitations, so if anyone is interested in continueing a new thread will have to be started.
300In the land of the proud and freeyou can sell your soul and your dignityfor fifteen minutes on tvhere in Babylon.
dwmitch
dwmitch
I got to thinking. Since it''s a problem compiling would it be better off in the programming board, or is it in the right place since it deals with DX common files?

If it would be better served in the programming forum could an administrator please move it there (if there are rules against double posting, which would prevent me from posting this there)?
300In the land of the proud and freeyou can sell your soul and your dignityfor fifteen minutes on tvhere in Babylon.
superpig
superpig
quote:
Original post by dwmitch
If it would be better served in the programming forum could an administrator please move it there (if there are rules against double posting, which would prevent me from posting this there)?


Don''t worry about that for the time being. If it needs moving, I''ll move it.

Could you paste the line of code that it''s having problems with (line 1225 of d3dapp.cpp)?
Richard "Superpig" Fine - saving pigs from untimely fates - Microsoft DirectX MVP 2006/2007/2008/2009
"Shaders are not meant to do everything. Of course you can try to use it for everything, but it's like playing football using cabbage." - MickeyMouse
dwmitch
dwmitch
    // Prompt the user to change the mode

if( IDOK != DialogBoxParam( (HINSTANCE)GetModuleHandle(NULL),
MAKEINTRESOURCE(IDD_SELECTDEVICE), m_hWnd,
SelectDeviceProc, (LPARAM)this ) )
return S_OK;


Like I said, it has always been read only, so I don''t know how it could have been changed.
300In the land of the proud and freeyou can sell your soul and your dignityfor fifteen minutes on tvhere in Babylon.
superpig
superpig
Hmm... how about the function prototype for SelectDeviceProc?

I''m going to take a guess and say that the calling convention is set to an unusual value in the project settings.
Richard "Superpig" Fine - saving pigs from untimely fates - Microsoft DirectX MVP 2006/2007/2008/2009
"Shaders are not meant to do everything. Of course you can try to use it for everything, but it's like playing football using cabbage." - MickeyMouse
dwmitch
dwmitch
DialogBoxParamA(
HINSTANCE hInstance,
LPCSTR lpTemplateName,
HWND hWndParent ,
DLGPROC lpDialogFunc,
LPARAM dwInitParam);
WINUSERAPI


How do you set the calling convention for a project? I should probably know that by now, but none of my books cover it.
300In the land of the proud and freeyou can sell your soul and your dignityfor fifteen minutes on tvhere in Babylon.
dwmitch
dwmitch
Sorry to "necro", but since I didn''t get a reply is it safe to assume that the only way to fix it is to start with a fresh install?
300In the land of the proud and freeyou can sell your soul and your dignityfor fifteen minutes on tvhere in Babylon.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.