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 6544407
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T11:27:42+00:00 2026-05-25T11:27:42+00:00

I am encountering a very strange problem in my wxWidgets application. What I am

  • 0

I am encountering a very strange problem in my wxWidgets application. What I am trying to do is use a custom wxPanel resource to allow for some redundancy control and providing methods that allow me to work easier. This problem was not occurring before I tried to pass access to a resource in the main frame to each panel.

What I am doing is using #include to include the class header of the wxPanel resource in the header of the main class. However, when trying to declare a resource of the type CopyRow, which is in the header file I am including, I get the error CopyRow does not name a type

Here is the code for the main class header,

#ifndef CPAMOUNTMAIN_H
#define CPAMOUNTMAIN_H

//(*Headers(CPAmountFrame)
#include <wx/sizer.h>
#include <wx/stattext.h>
#include <wx/menu.h>
#include <wx/spinctrl.h>
#include <wx/statline.h>
#include "CopyRow.h"
#include <wx/panel.h>
#include <wx/frame.h>
#include <wx/statusbr.h>
//*)

class CPAmountFrame: public wxFrame
{
    public:

        CPAmountFrame(wxWindow* parent,wxWindowID id = -1);
        void UpdateTotal();
        virtual ~CPAmountFrame();

    private:

        //(*Handlers(CPAmountFrame)
        void OnQuit(wxCommandEvent& event);
        void OnAbout(wxCommandEvent& event);
        void OntotalCopiesChange(wxSpinEvent& event);
        static void CallTotalCopies();
        //*)

        //(*Identifiers(CPAmountFrame)
        static const long ID_CUSTOM1;
        static const long ID_CUSTOM2;
        static const long ID_CUSTOM3;
        static const long ID_CUSTOM4;
        static const long ID_CUSTOM5;
        static const long ID_CUSTOM6;
        static const long ID_STATICLINE1;
        static const long ID_STATICTEXT1;
        static const long ID_SPINCTRL1;
        static const long ID_STATICTEXT2;
        static const long ID_PANEL1;
        static const long idMenuQuit;
        static const long idMenuAbout;
        static const long ID_STATUSBAR1;
        //*)

        //(*Declarations(CPAmountFrame)
        CopyRow* Custom4;
        wxStaticText* totalPrice;
        CopyRow* Custom1;
        CopyRow* Custom5;
        CopyRow* Custom2;
        CopyRow* Custom3;
        wxPanel* Panel1;
        wxStaticText* StaticText1;
        wxStatusBar* StatusBar1;
        wxStaticLine* StaticLine1;
        CopyRow* Custom6;
        wxSpinCtrl* totalCopies;
        //*)

        DECLARE_EVENT_TABLE()
};

#endif // CPAMOUNTMAIN_H

And here is the code for CopyRow.h,

#ifndef COPYROW_H
#define COPYROW_H

#ifndef WX_PRECOMP
    //(*HeadersPCH(CopyRow)
    #include <wx/sizer.h>
    #include <wx/stattext.h>
    #include <wx/panel.h>
    //*)
#endif
//(*Headers(CopyRow)
#include <wx/spinctrl.h>
//*)
#include "CPAmountMain.h"

class CopyRow: public wxPanel
{
    public:

        CopyRow(wxWindow* parent,const char* label,wxSpinCtrl* copies,wxWindowID id=wxID_ANY,const wxPoint& pos=wxDefaultPosition,const wxSize& size=wxDefaultSize);
        void SetLabel(const char* label);
        void SetPrice(double price);
        void SetCounter(int value);
        int  GetCounter();
        virtual ~CopyRow();

    private:

        //(*Declarations(CopyRow)
        wxStaticText* copyLabel;
        wxSpinCtrl* numCopies;
        wxStaticText* copyPrice;
        //*)

        //(*Identifiers(CopyRow)
        static const long ID_SPINCTRL1;
        static const long ID_STATICTEXT1;
        static const long ID_STATICTEXT2;
        //*)

        wxSpinCtrl* totalCopies;

        //(*Handlers(CopyRow)
        void OnnumCopiesChange(wxSpinEvent& event);
        //*)
        DECLARE_EVENT_TABLE()
};

#endif

Can anyone explain this error to me? I have no clue right now.

  • 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-05-25T11:27:43+00:00Added an answer on May 25, 2026 at 11:27 am

    You are can’t include CPAMountMain.h in CopyRow.h and CopyRow.h in CPAMountMain.h! You have to decide the order in wich you want to include the files.

    Since CPAMountMain.h only use pointers to CopyRow class, you can use a forward declaration instead of including CopyRow.h:

    // CPAMountMain.h
    class CopyRow;
    

    and remove the #include "CopyRow.h" in CPAMountMain.h, this should work.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm encountering a very strange problem: my delete actions in rails don't work anymore.
I'm encountering a very strange problem using g++ 4.1.2. I have a very basic
I am encountering some very strange behaviour with a Flex 4.1 app I am
I'm encountering a very strange problem: Mu 9800GT doesnt seem to calculate at all.
I seem to be encountering a very odd problem which only occurs when trying
I am encountering a problem with string formatting while trying to get only the
As the title boasts, I'm encountering a rather strange problem with Firefox where it's
I'm encountering a very strange when I insert a new record into a table
I'm encountering a very strange issue while debugging a unit test. If I debug
I am encountering a very strange issue I wonder if anyone has seen before.

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.