Gamestudio Links
Zorro Links
Newest Posts
Lapsa's very own thread
by Lapsa. 06/08/26 22:41
Stooq now requires an API key
by VHX. 06/08/26 20:14
ZorroGPT
by TipmyPip. 06/06/26 12:36
Zorro 3.01 recoded MMI function issue
by TipmyPip. 06/04/26 05:44
SGT_FW
by Aku_Aku. 05/31/26 11:05
Issues resuming trades on Demo account
by Martin_HH. 05/22/26 13:31
XTB
by pr0logic. 05/18/26 12:27
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
1 registered members (TipmyPip), 3,688 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Seraphinang, Koti, curry, DeepxKalsi, Samed
19219 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 3 1 2 3
Masking error messages #421260
04/14/13 12:51
04/14/13 12:51
Joined: Sep 2009
Posts: 1,035
Budapest
Aku_Aku Offline OP
Serious User
Aku_Aku  Offline OP
Serious User

Joined: Sep 2009
Posts: 1,035
Budapest
Based on this page of the manual: on_message
i would like to try handling the E1115 error, so the engine wouldn't pop up nothing, furthermore it wouldn't exit.
Please tell me what constant should i use instead of WM_SIZE?
I browsed the windows.h but was not able to figure out the correct value.

Re: Masking error messages [Re: Aku_Aku] #421270
04/14/13 13:59
04/14/13 13:59
Joined: Oct 2011
Posts: 1,082
Germany
C
Ch40zzC0d3r Offline
Serious User
Ch40zzC0d3r  Offline
Serious User
C

Joined: Oct 2011
Posts: 1,082
Germany
Dont hook the windows message loop.
Hook MessageBoxA

Re: Masking error messages [Re: Ch40zzC0d3r] #421276
04/14/13 16:59
04/14/13 16:59
Joined: Sep 2009
Posts: 1,035
Budapest
Aku_Aku Offline OP
Serious User
Aku_Aku  Offline OP
Serious User

Joined: Sep 2009
Posts: 1,035
Budapest
Your posts are too mysterious for me.
Could you explain what do you want to communicate?

Re: Masking error messages [Re: Aku_Aku] #421278
04/14/13 17:28
04/14/13 17:28
Joined: Apr 2007
Posts: 3,751
Canada
WretchedSid Offline
Expert
WretchedSid  Offline
Expert

Joined: Apr 2007
Posts: 3,751
Canada
He is probably talking about using something like Detours to reroute the underlying API function.
If you ask me, this is unbelievable dirty. Fixing software problems by throwing more software at them rarely turns out to be a good idea, so I would rather like to see a possibility to tell Gamestudio that you want to handle a certain error and have the engine then ask you at runtime to handle the error.


Shitlord by trade and passion. Graphics programmer at Laminar Research.
I write blog posts at feresignum.com
Re: Masking error messages [Re: WretchedSid] #421280
04/14/13 17:35
04/14/13 17:35
Joined: Sep 2009
Posts: 1,035
Budapest
Aku_Aku Offline OP
Serious User
Aku_Aku  Offline OP
Serious User

Joined: Sep 2009
Posts: 1,035
Budapest
Thanks JustSid.
In my opening post i told what i would like to handle.
Maybe one day, i will get a correct answer (no offense just praying...).
(Furthermore, i suspect is not enough to hook the MessageBoxa, because it will not save from exit.)

Last edited by Aku_Aku; 04/14/13 17:38. Reason: append a remark
Re: Masking error messages [Re: Aku_Aku] #421281
04/14/13 17:49
04/14/13 17:49
Joined: Oct 2011
Posts: 1,082
Germany
C
Ch40zzC0d3r Offline
Serious User
Ch40zzC0d3r  Offline
Serious User
C

Joined: Oct 2011
Posts: 1,082
Germany
If you press OK the engine gets the pressed button as result and exits.
If you hook it, and dont call the orig function at all, there will be NO crash.
I did that just before...

Re: Masking error messages [Re: Ch40zzC0d3r] #421283
04/14/13 17:55
04/14/13 17:55
Joined: Sep 2009
Posts: 1,035
Budapest
Aku_Aku Offline OP
Serious User
Aku_Aku  Offline OP
Serious User

Joined: Sep 2009
Posts: 1,035
Budapest
OK, thank you.
I would like to know, is it a secret how should do it?
I can't guess it out what code implement it.
Would you be so kind to share it?

Re: Masking error messages [Re: Aku_Aku] #421292
04/15/13 06:59
04/15/13 06:59
Joined: Jul 2000
Posts: 28,101
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,101
Frankfurt
The message loop can not be used for error handling. Hooking won't work either for error messages.

Errors in a software program fall in two categories - errors that can be solved by software, f.i. by aborting a function, and errors that are fatal and could cause a crash when the program continued. The former can be masked out, the latter can't. Your script must take precautions so that those errors don't happen.

Re: Masking error messages [Re: jcl] #421315
04/15/13 13:17
04/15/13 13:17
Joined: Oct 2011
Posts: 1,082
Germany
C
Ch40zzC0d3r Offline
Serious User
Ch40zzC0d3r  Offline
Serious User
C

Joined: Oct 2011
Posts: 1,082
Germany
Code:
typedef INT (WINAPI *MessageBoxAt)(HWND hWnd, LPCSTR lpText, LPCSTR lpCaption, UINT uType);
MessageBoxAt oMessageBoxA;

//Sample hooked function
INT WINAPI hkMessageBox(HWND hWnd, LPCSTR lpText, LPCSTR lpCaption, UINT uType)
{
	if(strcmp(lpCaption, "Error E1513") == 0) //Compares the title of the msgbox
	{
		iCount++;
		add_log("[%i] - %s", iCount, lpText);

		return 0;
	}

	#ifdef _USE_DEFAULT_RETURN_MSGBOXA
		return oMessageBoxA(hWnd, lpText, lpCaption, uType);
	#else
		return 0;
	#endif
}

oMessageBoxA = (MessageBoxAt)DetourFunction((BYTE*)(DWORD)GetProcAddress(GetModuleHandle("user32.dll"), "MessageBoxA"), (BYTE*)hkMessageBox);



If you return 0, the engine will NOT exit.
Works perfectly.
But if its a program crash as JCL pointed out, the engine will freeze too.

Last edited by Ch40zzC0d3r; 04/15/13 13:26.
Re: Masking error messages [Re: Ch40zzC0d3r] #421328
04/15/13 16:02
04/15/13 16:02
Joined: Jul 2000
Posts: 28,101
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,101
Frankfurt
That's the problem. An unrecoverable error normally means that internal data has wrong content - so continuing the program can cause a crash sooner or later. You might be lucky. But users of your game might not.

Page 1 of 3 1 2 3

Moderated by  old_bill, Tobias 

Gamestudio download | 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