-
January 3rd, 2009, 02:20 PM
#1
DirectX Application Dependencies
Hi, I have an application that I wrote to convert .X files into a format needed for another application. In it I use various DirectX functions such as
Code:
LPDIRECT3D9 d3d = NULL;
HWND hD3DWnd = NULL;
LPDIRECT3DDEVICE9 device = NULL;
bool CreateD3D9()
{
d3d = Direct3DCreate9( D3D_SDK_VERSION );
if (NULL == d3d)
return false;
WNDCLASSEX wcex = {sizeof(WNDCLASSEX)};
wcex.lpszClassName = "dxwind";
wcex.lpfnWndProc = DefWindowProc;
RegisterClassEx(&wcex);
HWND hWnd = CreateWindow("dxwind", "", 0, -1,-1,-1,-1, NULL, NULL, 0, 0);
if (NULL == hWnd)
return false;
D3DPRESENT_PARAMETERS d3dpp = {};
d3dpp.hDeviceWindow = hWnd;
d3dpp.Windowed = TRUE;
d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD;
d3dpp.BackBufferFormat = D3DFMT_UNKNOWN;
d3dpp.EnableAutoDepthStencil = TRUE;
d3dpp.AutoDepthStencilFormat = D3DFMT_D24X8;
d3dpp.PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE;
HRESULT hr = d3d->CreateDevice( D3DADAPTER_DEFAULT, D3DDEVTYPE_REF, NULL, D3DCREATE_HARDWARE_VERTEXPROCESSING, &d3dpp, &device);
if (FAILED(hr))
return false;
return true;
}
The resulting application runs fine on any computer that has the DirectX SDK installed, but failed to initialize the object on an pc without it.
I am wondering if anyone can point me in the right direction as to what I need to include with the app to enable it to work without people having to install the whole DirectX SDK
Thanks Andrew
-
January 4th, 2009, 12:37 AM
#2
Re: DirectX Application Dependencies
Distribute a release build, which should be linked to the release D3D libraries.
-
January 4th, 2009, 07:57 AM
#3
Re: DirectX Application Dependencies
I did. It is linked via the Project properties include and lib directories and I have added the seperate lib files d3dx9.lib and d3d9.lib
It did not work.
-
January 4th, 2009, 02:42 PM
#4
Re: DirectX Application Dependencies
The previous post said compile a "release" build and not "debug" one.
And also these:
1- you must install the same version of directX or newest one on the target system.
2- Depend on your compiler you must install visual C++ runtime library(vcredist_x86),
for VC++2005 located in :
Microsoft Visual Studio 8\SDK\v2.0\BootStrapper\Packages\vcredist_x86
OR use a installer /VC++ setup
OR download it from internet
OR copy those dlls from redist folder of VC
-
January 4th, 2009, 03:28 PM
#5
Re: DirectX Application Dependencies
if by release build you mean that the active build is set to release and C++ Config to Multithreaded DLL (/MD) I did that....
I am using VS 2008
I had the users do a DirectX update to make sure they had latest build that did no good, if I asked them to install the DirectX SDK then the app works fine.
Last edited by Mogulbasher; January 4th, 2009 at 03:36 PM.
-
January 4th, 2009, 04:22 PM
#6
Re: DirectX Application Dependencies
use D3DDEVTYPE_HAL, not D3DDEVTYPE_REF
-
January 6th, 2009, 08:47 AM
#7
Re: DirectX Application Dependencies
FYI...you can use the dependency walker to determine what other dlls are required to be distributed with your application.
Gort...Klaatu, Barada Nikto!
-
January 6th, 2009, 07:03 PM
#8
Re: DirectX Application Dependencies
Originally Posted by Retarded
use D3DDEVTYPE_HAL, not D3DDEVTYPE_REF
That did the trick... Thanks you very much... Andrew
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|