Hide a function or variable from the Class View
The Class View (and the Class Wizard and the Wizard Bar) does not support hiding of functions. It, however, preprocess the file and we use use this knowledge to fool it into not recognizing a function. To achieve this we declare a couple of macros to camouflage the parentheses. If there is more than one class that you want to hide functions in, you may want to declare the macros in stdafx.h, otherwise declaring it in the header file for the class is OK.
Make sure you document this in each header file you modify, otherwise your code is going to be a big headache for the next person seeing it.
#define HIDE____ ( #define ____HIDE );
The first macro is used for the starting paren and the second macro for the ending parent and the semi colon.
Here's how you would hide a function
Change
afx_msg void OnUpdateFunction(CCmdUI* pCmdUI);To
afx_msg void OnUpdateFunction HIDE___ CCmdUI* pCmdUI ___HIDE
Note that there is no ending semi-colon. That's taken care of by the macro.
To hide a variable, define a macro to substitute for the semi-colon. Use this macro to end the statement

Comments
Doesnt work with VC++ 6.0
Posted by Legacy on 11/22/1999 12:00amOriginally posted by: SHAILESH BARVE
I tried the stuff but doesnt look like its working with VC++ 6.0 editor...
Doesnt look that stratight forward the way it looks...but its a good try!
Reply'Hide' Class (only) in VC6 using folder
Posted by Legacy on 09/20/1999 12:00amOriginally posted by: Arnt Witteveen
In VC6 (don't know about VC5) you can make a folder in the classview. This is a simple way to organize classes, and this might provide wath some of you are looking for.
You can drag all classes you don't want to see into some folder, e.g. all classes of some library into a folder with the name of the library. That folder could be contained in a folder "libraries", which leaves you with only 1 extra folder, for all the libs you have.
It is very usefull for organising my own code too...
ReplyHidiing from ClassView
Posted by Legacy on 01/05/1999 12:00amOriginally posted by: Paul Whitehead
From the previous comments sounds like some people are having problems.
If you can still see the class member / method, then try "Update All Dependencies" from the Build / Project menu (depending on VC4 / VC5). If that doesn't work, come out of the IDE (i.e. close MSDEV). Delete the .ncb file. Restart MSDEV. One of these two usually work...
The second problem: sounds like you got a problem with pre-compiled headers. It should have worked fine. The only down side to pre-compiled headers is that to get rid of them and rebuild them you need to do a full build - which may be a horrendous proposition if your project is large. The other way is to go and delete the pre-compiled header files (if you've got more than one or more than one target). Deleting a pre-compiled header file will minimise the amount of rebuilds if you have more than one pre-compiled header but it is more of a headache. It will also depend on where you have set the pre-compiled header to stop - either in the build/project settings or by means of a #pragma hdrstop. The simplest solution is just to do a full rebuild.
ReplyHiding a function from classview
Posted by Legacy on 11/04/1998 12:00amOriginally posted by: Pankaj
Reply