PocketMatrix forums

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

sample app blastar in VS 2005 Debug Win32 mode exit silently

Hi all,

I just downloaded the Edge 3.11 to play with a sample app blastar. I have VS 2005 setup and use the solution file in Blastar/workspace_pc_vc2005. Build in Debug and Release mode works fine but only Release mode runs, Debug mode silently quits. Any ideas? Am I missing anything?

System info: XP Pro SP 2

The program '[288] Blastar.exe: Native' has exited with code 0 (0x0).

Upon stepping through the debugging I hit a line in crtexe.c and managedapp is false

/*
* Note that if the exe is managed app, we don't really need to
* call exit or _c_exit. .cctor should be able to take care of
* this.
*/
if ( !managedapp )
exit(mainret);

-Aaron
Hi Aaron,

The program probably doesn't start because it can't load the resource file. Inside the Release folder there should be a gfx.epk file containing the graphics.

Copy this file to your debug folder (near the executable file) and it should run fine.
Thanks, indeed that's the case! Is there a good example to show how error handling should be done? Silently quitting doesn't seem to be the best choice.

I notice that there's a SetErrorMsg in ClassEdge, should the ClassModule have a pointer that points back to its parent and call this method? I suppose you can't use Exception because not all platforms support it.

-Aaron
Hi Aaron,

You're correct that the error handling in the Blastar could be improved by calling SetErrorMsg when a resource fails to load.

To use SetErrorMsg within a module in the Blastar sample, you can create a ClassEdge * pointer to the SHARED_DATA structure. Then make it point to ClassMain by using this line of code in the ClassMain constructor:

Code:

shared.edge = this;