Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by EternallyCurious. 04/25/24 10:20
Trading Journey
by howardR. 04/24/24 20:04
M1 Oversampling
by Petra. 04/24/24 10:34
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
Scripts not found
by juergen_wue. 04/20/24 18:51
zorro 64bit command line support
by 7th_zorro. 04/20/24 10:06
StartWeek not working as it should
by jcl. 04/20/24 08:38
folder management functions
by VoroneTZ. 04/17/24 06:52
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (AndrewAMD, SBGuy, Petra), 801 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Mega_Rod, EternallyCurious, howardR, 11honza11, ccorrea
19048 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