Multiple copies of Direct3d application?

Hi,
I have a problem when I build a direct3d application . When I run The Debug version of a Direct3d app(with start without debugging button in VS2003) It does not shut down properly, It always stays in the windows task manager and when I try to build it again it gives this error:

------ Build started: Project: test, Configuration: Debug Win32 ------

Linking...
LINK : fatal error LNK1168: cannot open Debug/test.exe for writing

Build log was saved at "file://c:\Documents and Settings\Visual Studio Projects\test\Debug\BuildLog.htm"
test - 1 error(s), 0 warning(s)


---------------------- Done ----------------------

Build: 0 succeeded, 1 failed, 0 skipped



But when I shut it manually(using win. task manager) , It gives no error. Please help me about this problem.


Answer this question

Multiple copies of Direct3d application?

  • janoman

    I solved the problem , Its in the windows message procedure . I used WM_CLOSE msg instead of WM_DESTROY. While using WM_CLOSE the app. didnt shut down properly. Here is my msg procedure:

    LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
    {
    switch(msg)
    {
    /*
    case WM_QUIT:
    Cleanup();
    PostQuitMessage(0);
    break;
    */

    case WM_DESTROY:
    Cleanup();
    PostQuitMessage(0);
    break;

    default:
    return DefWindowProc(hwnd,msg,wParam,lParam);

    }


    return 0;

    }

    Thx for your help.
    B.A

  • reformist

    It's hard to tell from your post, but the application is clearly not shutting down properly. You should look at the Empty Project sample to get some ideas on the proper shutdown sequence.
    The link error is obvious, since it's trying to write a .exe file while the older version is still opened and running.


  • Multiple copies of Direct3d application?