Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 09 Oct 2012
Offline Last Active Nov 22 2012 10:56 AM

Topics I've Started

DxViewer as child window

09 October 2012 - 11:19 AM

Hello everyone!

I've met some trouble with DxViewer programm that is contained at the DX SDK(I'm using 2007). What do I want is to run DxViewer as a child inside my own WinAPI window. I've googled so much but yet I didn't found anything helpful.

1. I compiled DxViewer from SDK as DLL.
2. Created my own project and included that DLL to it. I've declared main function of DxViewer as extern with additional parameter - HWND hwnd (handle to my own window)
3. FIrstable, my project failed on CreateMainDialog function. So I've commented code that creating dialog handle and send to STATE_SET handle to my window:
bool App::CreateMainDialog( HWND hparent)
	STATE_SET(Dialog, hparent);
	return true;
Actually, I think that here is the root of my problems, but DxViewer has runned inside my window.
4. Error occures when I try to open a model ".x". Function FindResource that is calling in SASCreateEffectFromResource return NULL and after that pfogramm is falling.
	LPDIRECT3DDEVICE9			   pDevice,
	HMODULE	   module,
	LPCWSTR	   resName,
	LPCWSTR	   resType,
	CONST D3DXMACRO*				pDefines,
	LPD3DXINCLUDE				   pInclude,
	DWORD						   Flags,
	LPD3DXEFFECT*				   ppEffect,
	LPD3DXBUFFER*				   ppCompilationErrors)
	HRSRC hSrc= FindResource(module, resName, resType);
	if(hSrc == NULL)
		return E_FAIL;

When I debugging original DxViewer, FindResource return normal pointer so the model is loading correctly. And I just can't get it - why the same function with the same parameters is return different values.