Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Kill Application

Author
Message
Briere
19
Years of Service
User Offline
Joined: 28th Feb 2005
Location: Amherst New York, United States
Posted: 15th Jun 2006 03:59
I have tried to kill the appication on command, with no success.

I tried PostQuitMessage(0); but that didnt work

How can I do this?

Current Project: Galaxy Conquest
APEXnow
Retired Moderator
21
Years of Service
User Offline
Joined: 15th Apr 2003
Location: On a park bench
Posted: 15th Jun 2006 09:53
Briere,

You should really examine the sample code that accompanies the DGDk. But basically, your main entry function DarkSDK() should contain a while loop:



Paul.


Home of the Cartography Shop - DarkBASIC Professional map importer
Briere
19
Years of Service
User Offline
Joined: 28th Feb 2005
Location: Amherst New York, United States
Posted: 15th Jun 2006 17:18
I know but sometimes I need to kill the application before that main loop is completed.

Current Project: Galaxy Conquest
APEXnow
Retired Moderator
21
Years of Service
User Offline
Joined: 15th Apr 2003
Location: On a park bench
Posted: 15th Jun 2006 17:48
Completed? That loop should always run for the life of the application. It should only terminate when you want to quit, hence the Escape Key test.

Paul.


Home of the Cartography Shop - DarkBASIC Professional map importer
Briere
19
Years of Service
User Offline
Joined: 28th Feb 2005
Location: Amherst New York, United States
Posted: 15th Jun 2006 17:57 Edited at: 15th Jun 2006 17:58
Yes I know, but there are numerous other loops, and a few processes that take some time before the main application loop completes. The idea is for my error handler to kill the application before it freezes or gets all whacky on the user.

Current Project: Galaxy Conquest
APEXnow
Retired Moderator
21
Years of Service
User Offline
Joined: 15th Apr 2003
Location: On a park bench
Posted: 15th Jun 2006 18:00
Ahh I see, you should use exception handling

Paul.


Home of the Cartography Shop - DarkBASIC Professional map importer
Briere
19
Years of Service
User Offline
Joined: 28th Feb 2005
Location: Amherst New York, United States
Posted: 15th Jun 2006 18:13 Edited at: 15th Jun 2006 18:18
What does LoopSDK do?
Take care of the windows stuff?

[EDIT]
This is why I want to kill it right away.
I do the set up before the main loop of the program, and if the settings files are corrupt or missing, it will cause the user to have the need to restart their computer.



Current Project: Galaxy Conquest
APEXnow
Retired Moderator
21
Years of Service
User Offline
Joined: 15th Apr 2003
Location: On a park bench
Posted: 15th Jun 2006 18:29
LoopSDK handles all internal DarkBASIC system stuff like playing animation files, music and sound etc, although you would normally have your dbSync call inside this while loop as well. The while loop is your main game loop. Ideally, when your application needs to terminate, all you do is exit this loop so that the DarkSDK function terminates.

Paul.


Home of the Cartography Shop - DarkBASIC Professional map importer
OSX Using Happy Dude
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 16th Jun 2006 11:15
What you could try and do, is sub-class the main DBPro window, and, in that messaging loop detect a WM_USER command, which would then send a PostQuitMessage, or something like that.

Come to the last Unofficial DBPro Convention (http://convention.logicstudios.net/)
Dont do anything I wouldn't do. But if you do, take pictures.
Artus
19
Years of Service
User Offline
Joined: 25th Feb 2005
Location: France
Posted: 16th Jun 2006 14:52
Quote: "Ideally, when your application needs to terminate, all you do is exit this loop so that the DarkSDK function terminates."

Yes, I think you should use exit;, or even return; instead of Application.Kill(); in order to be sure that all the cleaning is properly done.

Login to post a reply

Server time is: 2024-11-19 06:50:42
Your offset time is: 2024-11-19 06:50:42