Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8533737
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T10:02:19+00:00 2026-06-11T10:02:19+00:00

I get this: This is a sample code of the two classes: main.h class

  • 0

I get this:

image

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T10:02:20+00:00Added an answer on June 11, 2026 at 10:02 am

    The pointers could be anything, because they’re not initialized.

    The compiler generated default constructor for CControl doesn’t initialize POD members. You’d need to write your own:

    CControl() : m_ChildControls(NULL),  m_NextSibling(NULL), m_PreviousSibling(NULL)
                 m_Parent(NULL), m_FocusControl(NULL)
    {
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I haven't been able to get this working and all of the sample code
The code below consists of two classes : SmartForm (simple model class) SmartForms (plural
public static class clsCounter { static int count; public static int Counter { get
I have two java classes. Schedule is the main class that uses an array
I can not get to make this comparison in this simple code error ..
i have this simple code to load data from other php page using get
I dont get why this simple line of code does not work: <?php $someVariable
In this very simple code example, messages get lost every once in a while.
I have a simple piece of Javascript code and I get this Error :
I have a base class Element and derived two other classes from it, Solid

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.