Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

peter86

Linker errors

This topic is 5865 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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]

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!