How to prevent some classes from being seen?

  • Thread starter Thread starter Todd
  • Start date Start date
T

Todd

How do I prevent some of my classes in my class library
from being seen externally?

I have one class that I want everyone to see and use.
But that class itself, internally uses several other
classes for support and implementation.

When I reference my class library from another project,
that other project also sees all the other supporting
classes, which makes things very muddled.

I'm using managed C++ code to build this class library.
I can't seem to figure out how to make the ONE class
public, but all the remaining ones private?

Is there a way?
 
I'm using managed C++ code to build this class library.
I can't seem to figure out how to make the ONE class
public, but all the remaining ones private?

Hmmm not sure if C++ has the 'internal' keyword, but you can try. As
long as the classes are defined in the same file, they can only be used by
classes in the same file (in c# anyway.)

-mbray
 
That didn't work. The internal keyword doesn't exist in
C++.

Also, I'm more interested in how to only expose ONE
class. I don't want all the other stuff being exposed
that I've #included from other header files. I can't
easily put a keyword on all the classes defined in other
#included files.
 
Back
Top