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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T11:58:47+00:00 2026-06-07T11:58:47+00:00

I am building an application where there are multiple classes that inherit from a

  • 0

I am building an application where there are multiple classes that inherit from a single base class. Let’s say I have this declaration:

ref class WorkScreenBase abstract
{
internal:
   WorkScreenBase(void);
   bool isLoaded;
}

I have several classes that implement it, for example:

ref class MainScreen : public WorkScreenBase
{
internal:
   MainScreen(void);
   ~MainScreen(void);
}

In another part of the application, I want to have a container for any potential implementation of WorkScreenBase, so I am trying to use:

WorkScreenBase^ myCurrentBase;

However, it appears that this would be illegal. What would be the best way to approach the problem?

UPDATE: I could use a MainScreen^ myCurrentScreen, but would much rather use the base class as the reference point for flexibility reasons.

  • 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-07T11:58:48+00:00Added an answer on June 7, 2026 at 11:58 am

    The issue was fixed in a way that I did not expect (at least according to the compiler error thrown). The problem was in the header file cross-reference. Somehow, both with header guards and #pragma once, I ended up with a circular .h reference.

    So, conclusion:

    • The compiler can throw errors that might not exactly describe the
      problem.
    • Double-check the headers for circular references. Headers guards and #pragma once are good, but won’t help you against that.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am building an application that can have multiple users from multiple accounts. For
I am building a web application that will pull event logs from multiple servers
I have several classes in an application that I am currently building, and I
I am building a web application that is currently PHP with MySQL. There is
I'm building an application that uses an elaborate API to fetch data from Youtube,
I'm building this iPhone application to connect to a secured TFS server (one that
world! I'm building an application that has to retrieve data from a server in
world! I'm building an application that has to retrieve data from a server in
So I'm building a web application and I have an ajax request that pings
I am building an application with codeigniter that involves adding a carer with multiple

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.