Jump to content
  • Advertisement

Archived

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

acw83

Exiting windows.

This topic is 6922 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

I am creating my own graphics API for simplicity but have run into a problem. The window is created within a class and the WndProc is a function in the same model which has the class members that create the window. Anyway, when I exit my program, the window is destroyed and I get sent back to my desktop, but the App is still running in the background, just without a window. I can tell it''s running b/c MSVC++ cannot access teh file to link and I see it in the ctr-alt-delete screen and must end task to recompile. Any help would be, uh, helpful. :-)

Share this post


Link to post
Share on other sites
Advertisement
I have had the same problem before, but it was because DirectX would close me and not Me. So If my program executed something illegal to do with DirectX, like placing a pixel outside the memory range of the screen or something, my game would disappear and all DirectX Recoures(DSound,DInput,DDraw, DPlay) Would all be released but the game was still in the Ctrl+Alt+Delete Window, because I did not call "ExitProcess" in my code. You also have to make sure that your Windows Message Loop stops when you exit.
Hope this helps a bit!
See ya,
Ben

Share this post


Link to post
Share on other sites
This has happened with me when I mistakenly had my message loop with the form:

GetMessage(hwnd . . .)

This will only receive messages associated with this window. I wanted:

GetMessage(NULL . . .)

which receives all messages, including those not associated with any window (like WM_QUIT.)

Share this post


Link to post
Share on other sites
It only happens when I exit the App VIA alt-f4. I change the PeekMessage part to NULL, but it didn''t work. In my WndPrc case WM_DESTROY called PostQuitMessage(0). It still doesn''t work. If there anybody there willing to sort through my code and try it themselves? It is only 4 files, 2 headers and 2 source files. This is driving me crazy...

Share this post


Link to post
Share on other sites
I had a similar problem, which was not declaring my WndProc with the CALLBACK macro.


// in the .h file:
class Window
{
public:
static LRESULT CALLBACK Procedure(HWND, UINT, WPARAM, LPARAM);
};

// in the .cpp file:
LRESULT CALLBACK Window:: Procedure(HWND, UINT, WPARAM, LPARAM);



CALLBACK makes sure the correct calling convention is used, and DX depends on the exact calling convention. Also, make sure you have your function declared static in your class.

I'll look through the code!




- null_pointer
Sabre Multimedia


Edited by - null_pointer on 5/5/00 7:30:57 AM

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!