When/where is the constructor for the main class derived from AEEApplet called when using C++? | developer.brewmp.com When/where is the constructor for the main class derived from AEEApplet called when using C++? | developer.brewmp.com

Developer

When/where is the constructor for the main class derived from AEEApplet called when using C++?

Forums:

I'm going through this example C++ code and everything is working.

http://www.developer.com/ws/brew/article.php/1548131/BREWing-with-C.htm

 

However I wanted to add a constructor to it so extended the class like so to add an explicit default constructor:

class ShapeApp : public AEEApplet
{
public:
	ShapeApp();
	static boolean HandleEvent(ShapeApp * pApp, AEEEvent eCode, uint16 wparam, uint32 dwParam);
	static boolean initAppData(IApplet * pIApplet);

....

ShapeApp::ShapeApp()
{
	int dummy = 6;
But if I place a breakpoint inside the constructor it doesn't get called (which I double confirmed by placing an
assertion evaluating to false in the constructor).
Why is this?
How can I define a constructor for ShapeApp that gets called upon creation of the applet?

If you're using Visual Studio, the app wizard creates a file called AEEAppGen.c with the constructor and destructor in it.

If you're using Visual Studio, the app wizard creates a file called AEEAppGen.c with the constructor and destructor in it.

Not for me it doesn't.
How can it though? - in order to create a constructor/destructor for the ShapeApp class it has to know about them at the point it generates AEEAppGen.c and AeeAppGen.c is created at the point the project template is generated - before any specific user code has been added.
As far as I can tell the code for AEEAppGen.c is identical for all projects. (Anyway, shouldn't that be AEEAppGen.cpp if it is supposed to contain a C++ constructor/destructor?).
 
 

Not for me it doesn't.
How can it though? - in order to create a constructor/destructor for the ShapeApp class it has to know about them at the point it generates AEEAppGen.c and AeeAppGen.c is created at the point the project template is generated - before any specific user code has been added.
As far as I can tell the code for AEEAppGen.c is identical for all projects. (Anyway, shouldn't that be AEEAppGen.cpp if it is supposed to contain a C++ constructor/destructor?).