Gamestudio Links
Zorro Links
Newest Posts
Blobsculptor tools and objects download here
by NeoDumont. 03/28/24 03:01
Issue with Multi-Core WFO Training
by aliswee. 03/24/24 20:20
Why Zorro supports up to 72 cores?
by Edgar_Herrera. 03/23/24 21:41
Zorro Trader GPT
by TipmyPip. 03/06/24 09:27
VSCode instead of SED
by 3run. 03/01/24 19:06
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (Edgar_Herrera, VoroneTZ, Akow), 973 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sakolin, rajesh7827, juergen_wue, NITRO_FOREVER, jack0roses
19043 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
on_exit - Not calling if engine crashes. #472699
05/15/18 05:17
05/15/18 05:17
Joined: Feb 2013
Posts: 122
Maysville, Ga
Evo Offline OP
Member
Evo  Offline OP
Member

Joined: Feb 2013
Posts: 122
Maysville, Ga
I have important data that needs changed when my project exits. I'm currently dealing with the issue that if the project crashes, the on_exit function never gets called.

Is there a way to force the on_exit function if the project crashes?

Re: on_exit - Not calling if engine crashes. [Re: Evo] #472702
05/15/18 08:58
05/15/18 08:58
Joined: Jun 2007
Posts: 1,337
Hiporope and its pain
txesmi Offline
Serious User
txesmi  Offline
Serious User

Joined: Jun 2007
Posts: 1,337
Hiporope and its pain
Hi,
as far as I tested, the window callback function always receive the window destroying message.

Code:
LRESULT CALLBACK onMsgOld (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);

LRESULT CALLBACK myMsg (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) {
	if (message == WM_DESTROY) {
		// do whatwever you need at window destroying time
	}
	return onMsgOld(hwnd, message, wParam, lParam);   	  
}

void main () {
	onMsgOld = on_message;
	on_message = myMsg;
	...



Salud!

Re: on_exit - Not calling if engine crashes. [Re: txesmi] #472714
05/15/18 17:02
05/15/18 17:02
Joined: Feb 2013
Posts: 122
Maysville, Ga
Evo Offline OP
Member
Evo  Offline OP
Member

Joined: Feb 2013
Posts: 122
Maysville, Ga
This works great.
Thanks Txesmi.

Re: on_exit - Not calling if engine crashes. [Re: Evo] #472722
05/15/18 20:40
05/15/18 20:40
Joined: Jun 2007
Posts: 1,337
Hiporope and its pain
txesmi Offline
Serious User
txesmi  Offline
Serious User

Joined: Jun 2007
Posts: 1,337
Hiporope and its pain
glag of been helpful


Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1