How to prevent some classes from being seen?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Todd

    How to prevent some classes from being seen?

    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?
  • Michael Bray

    #2
    Re: How to prevent some classes from being seen?

    "Todd" <Todd@nowhere.c om> wrote in news:276c901c38 f63$e83e30f0
    $a601280a@phx.g bl:
    [color=blue]
    > 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?[/color]

    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

    Comment

    • Todd

      #3
      Re: How to prevent some classes from being seen?


      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.

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

      Comment

      • Todd

        #4
        Re: How to prevent some classes from being seen?


        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.

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

        Comment

        Working...