Linker errors

Started by
14 comments, last by peter86 21 years, 2 months ago
I just posted a reply to this here. Check it out and tell me if you have any trouble.
Advertisement
// Create the D3DDevice
if( FAILED( g_pD3D->CreateDevice( D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hWnd,
D3DCREATE_SOFTWARE_VERTEXPROCESSING,
&d3dpp, &g_pd3dDevice ) ) )
{
MessageBox( NULL, "D3D: CreateDevice", "Status", MB_OK );
return E_FAIL;
}


This function fails =)because the HWND is invalid, is because you created your window wrong:


        // Register the window class    WNDCLASSEX wc = { sizeof(WNDCLASSEX), CS_CLASSDC, MsgProc, 0L, 0L,                      GetModuleHandle(NULL), NULL, NULL, NULL, NULL,                      "Ch6p2_FirstScene", NULL };    RegisterClassEx( &wc );    // Create the application's window  HWND hWnd = CreateWindowEx(0, "MyCoolWindow", "My First Window",	    	    WS_POPUP | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_CAPTION | WS_SYSMENU |WS_THICKFRAME,       50, 50, 200, 100, NULL, NULL, hInst, NULL);  The one-before-last variable in wc is "Ch6p2_FirstScene".The second parameter in CreateWindowEx() should equal that one.So:          // Register the window class    WNDCLASSEX wc = { sizeof(WNDCLASSEX), CS_CLASSDC, MsgProc, 0L, 0L,                      GetModuleHandle(NULL), NULL, NULL, NULL, NULL,                      "WINDOWCLASSNAME", NULL };    RegisterClassEx( &wc );    // Create the application's window  HWND hWnd = CreateWindowEx(0, "WINDOWCLASSNAME", "My First Window",	    	    WS_POPUP | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_CAPTION | WS_SYSMENU |WS_THICKFRAME,       50, 50, 200, 100, NULL, NULL, hInst, NULL);    


That should fix it!

... And it did on my computer! No prolem dude!



[edited by - Pipo DeClown on January 31, 2003 2:10:29 PM]
I don''t even get an exe with Dev-C++, but it compiles fine with MS VC++ 6.0. So why dosen''t Dev-C++ create an exe for me?
I edited alot =) check my last post, fixed it!

wanted to say that you could use:

WS_OVERLAPPEDWINDOW | WS_VISIBLE

instead of:

WS_POPUP | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME
Thanks a lot Pipo
Don''t forget to call SetupMatrices()!

This topic is closed to new replies.

Advertisement