I get this:

This is a sample code of the two classes:
main.h
class CControl
{
protected:
int m_X;
int m_Y;
public:
void SetX( int X ) { m_X = X; }
void SetY( int Y ) { m_Y = Y; }
int GetX() { return m_X; }
int GetY() { return m_Y; }
CControl *m_ChildControls;
CControl *m_NextSibling;
CControl *m_PreviousSibling;
CControl *m_Parent;
CControl *m_FocusControl;
};
class CButton : public CControl
{
protected:
bool m_Type;
bool m_Selected;
bool m_Focused;
public:
CButton( bool Type );
~CButton();
};
CButton::CButton( bool Type )
{
}
This is just the declarations of the two classes (they’re not complete, but the problem comes in also in the full coded version).
main.cpp
#include <windows.h>
#include "main.h"
int main()
{
CButton *g_Button;
g_Button = new CButton( 1 );
return 0;
}
This is just the application main func where I declare g_Button as a new CButton object for making a debugging analysis.
The pointers could be anything, because they’re not initialized.
The compiler generated default constructor for
CControldoesn’t initialize POD members. You’d need to write your own: