According to Direct3D Document, Direct3DCreate9Ex is in D3D9.DLL. But I find no exported this function any Direct 3D DLLs. So the question is how to make a call to create an IDirect3D9Ex interface? -- Tiger
On Mon, 12 May 2008 17:44:02 -0700, David wrote: > According to Direct3D Document, Direct3DCreate9Ex is in D3D9.DLL. But I find > no exported this function any Direct 3D DLLs. > So the question is how to make a call to create an IDirect3D9Ex interface? Searching on Google Groups, I found this from Chuck: "Note that the Direct3D9Ex interface is currently only exposed through the Windows SDK, not the DirectX SDK." So it's unlikely that this is in D3D9.dll. Where did you read that? http://groups.google.com/group/microsoft.public.win32.programmer.directx.graphics/browse_thread/thread/807e212b1490954e/ea888badc5c90fa4?hl=en&lnk=st&q=Direct3DCreate9Ex+#ea888badc5c90fa4 -- Please read this before replying: 1. Dshow & posting help: http://tmhare.mvps.org/help.htm 2. Trim & respond inline (please don't top post or snip everything) 3. Benefit others: follow up if you are helped or you found a solution
Are you using Windows XP? The Direct3D9Ex export is only available on Windows Vista, Windows Sever 2008, and later versions of Windows. If your application is built for Windows XP and Windows Vista/Server, you should use explicit linking to call Direct3DCreate9Ex so you can handle the case of it not being present. The function itself will fail to create an object if you are running an XPDM driver on Windows Vista/Server 2008 since Direct3D9Ex requires a WDDM driver. -- Chuck Walbourn SDE, XNA Developer Connection This posting is provided "AS IS" with no warranties, and confers no rights.
The sample code in the doc page doesn't make it clear that it only runs on Windows Vista/Server 2008. I've filed a doc bug. A better sample would be: IDirect3D9Ex *g_pD3D = NULL; HMODULE h = LoadLibrary( L"d3d9.dll" ); if ( h ) { typedef HRESULT (WINAPI *LPDIRECT3DCREATE9EX)( UINT, IDirect3D9Ex**); LPDIRECT3DCREATE9EX func = (LPDIRECT3DCREATE9EX)GetProcAddress( h, "Direct3DCreate9Ex" ); if ( func ) { if ( FAILED( func( D3D_SDK_VERSION, &g_pD3D ) ) ) { FreeLibrary(h); return E_FAIL; } } FreeLibrary( h ); } -- Chuck Walbourn SDE, XNA Developer Connection This posting is provided "AS IS" with no warranties, and confers no rights.
On Mon, 12 May 2008 20:17:38 -0700, Chuck Walbourn [MSFT] wrote: > The sample code in the doc page doesn't make it clear that it only runs on > Windows Vista/Server 2008. I've filed a doc bug. A better sample would be: ... I couldn't find any references to the D3D9.dll requirement using the MSDN search for IDirect3D9Ex (thus my original response). One thing I dislike about the docs is that they do not list the required dlls/libs to use a function/class/interface. Feedback given by many of us to the MSDN docs team at several MVP Summits. UN*X based programming docs have included this information since at least the early 80s when I started using it. http://msdn.microsoft.com/en-us/library/bb174302(VS.85).aspx -- Please read this before replying: 1. Dshow & posting help: http://tmhare.mvps.org/help.htm 2. Trim & respond inline (please don't top post or snip everything) 3. Benefit others: follow up if you are helped or you found a solution