PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

Error Handling

I wrote some code using FatalAppExit, but it doesn't seem to be available when compiling in eVC3/4.

Is there an equivalent I should be using? What function is best for displaying an error message to the user and exiting the application?
Anyone? Bueller?
why not just call messagebox then destroywindow or closewindow?
mm40 wrote:why not just call messagebox then destroywindow or closewindow?


MessageBox just hangs the device without displaying the message box.

At least that's my experience, in an application made using GapiDraw.
What window are you using as the parent (the first parameter)? I ask because I use MessageBox almost exclusively when debugging, whether it's on an actual PocketPC, the emulator or a PC build, and I've done so with straight Win32 apps, PocketFrog apps and GapiDraw apps, and it has always worked. The first parameter I set to null; are you doing that?
Avoid the need for fatal exits. ;)
Yes I set the first MessageBox parameter to NULL.

Unfortunately, fatal exits are sometimes unavoidable. At least I'm doing error checking and not just crashing.
If I call MessageBox before or after the GapiDraw application has done its thing, then the dialog window shows.

However, let's say I call it just before exiting, what happens is the dialog shows and the application immediately exits destroying that dialog. It's like the call wasn't modal.

I tried to use the flag MB_SYSTEMODAL but it won't compile in eVC, probably because that mode isn't supported.

Does anyone know how I can show a message box before exiting, with an OK button, and wait for that OK button to be pressed before actually exiting?
Where exactly are you trying this? I just threw a MessageBox in as the first statement of ExitInstance, and it shows up there. Is that what your trying?
fzammetti can you post the code for your call to MessageBox? Maybe I have the wrong parameters.
MessageBox(NULL, TEXT(""), TEXT(""), MB_OK);
I tried exactly that, first line in ExitInstance, and it hangs the device with app still showing and music still playing. Maybe FMOD is causing the problem.
Possibly... I've always only used Hekkus.