How to prevent some classes from being seen?

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?
 
M

Michael Bray

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
 
T

Todd

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top