visual c++ - Reusable Class - Using "abstract" instead of pre-defined -


I am creating an application where there are multiple classes that come from a single base class. Let me assume that I have this announcement:

  Ref Class WorkScreenBase Summary (Internal: Workbenbase (zero); Bull is loaded;}   

I have many Classes that apply it, for example:

  Ref: Class Main Screen: Public Workbenchbase {Internal: Main Screen (Zero); ~ MainScreen (Zero);}  < / Pre> 

In the second part of the application, keep me a container for possible implementation of WorkScreenBase So, I'm trying to use:

  workbenchbase ^ myCurrentBase;   

However, it seems that it will be illegal to face the problem What would be the best way?

Update: I can use a main screen ^ myCurrentScreen , but for base class flexibility reasons As a reference point.

This issue was fixed in a way which I did not expect (at least thrown in accordance with the compiler error) Problem header file was in cross-reference. In some way, with header guards and #pragma once , I ended up with a circular .h reference

Then, Conclusion :

  • The compiler can remove errors that might not describe the problem.
  • Check the header twice for circular references. Header guards and #pragma are good once, but this will not help you.

Comments