Class Folder Contents Gets Removed From Folders

I have a project that, for my own sanity, I have sub-divided my classes and files into different groups based on functionality.

Every once in a while, I will open the project to find that one or more classes have inexpicitly been moved to a different folder, removed from the folders altogether ( they are now just under the class folder), and rarely, ALL of the classes have been placed under the class folder.  Needless to say, this take 20 or 30 minutes to correct.  

Am I doing something wrong?  Is there a way to prevent this?

Thanks, Rick
Who is Participating?
I didn't try to make subfolders in VC++ 8.0, so I don't know whether it is better than 6.0 in this function. There are other 1000 reasons to upgrade to 8.0 - much better C++ compiler.
BTW, 8.0 compiler shows Class View with namespaces, this can be great improvement instead of folders, using namespaces is highly recommended in large projects.
What are you talking about? There is no such thing as a 'class folder' in C++. If you are referring to the VC++ IDE, just close the project, delete the .ncb file and open it again. Then, all the classes should be back again.
Unfortunately, information about subfolders in VC++ 6.0 project is not kept in .dsw or .dsp files. It is kept in one of files created automatically by VC++ IDE - .opt file. All files from this group (*opt, *.ncb, *.app, *.clw) are sometimes corrupted, in this case it is possible to remove them and VC++ creates then again. This is very old and well known VC++ IDE bug, and you cannot expect that project subfolders will be persistent. This feature is actually unusable.
I can only suggest to make smaller projects or work with existing project without subfolders.
Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

>>>> If you are referring to the VC++ IDE

Actually, folders in VC IDE were stored in the project's workspace file *.dsw (VC6) or *.sln (VC7 and later). The *.ncb file is a binary cache  that might fake you if the workspace or solution file was changed by another user or by your configuration system. Then, the IDE may show you wrong folders means an older configuration while there is already a newer one in the workspace file.

From your description I would say that doesn't apply. It seems just the opposite that you got a workspace from someone else that destroyed (overwrote) your personal workspace file. If using a configuration system like SourceSafe or ClearCase you should consider to put the workspace file under source control in order to avoid getting them overwritten by incidence. If not, make the workspace file read-only what should help.

Regards, Alex
rickatseasoftAuthor Commented:
In the Workspace pane, there exists an Icon called  classes.  If you right click on Classes, it offers the opportunity to create a new folder.  In my project, there are numerous sub-classes of CEdit that perform special functions, and it suits my sense of organization to place them all in a folder called "SpecialEdits."  So, I simply right click on "Classes", create a folder called "SpecialEdits", and drag and drop these classes there.

Right now, I have about 300 Classes stored in 7 folders.  Before I am done, I expect the numbers to reach 600-800 and 20 respectively.  Obviously, it is a real pain when VC++ throws the organization away, and just drops ALL of the classes into the heirarchy at the same level as the folders.

In other words, it becomes:

MyProject Classes
as opposed to the way that I have it organized

MyProject Classes
   + Folder1

Regards, Rick
rickatseasoftAuthor Commented:
The previous comment was for jkr.


In the most recent case, I simply did a save on the project to go play golf, and when I returned and tried to open it, all of my class folders were empty, and all of the classes were at the same level.


Thanks for the information.  Would it be reasonable to upgrade to a newer version of the compiler, or is there some third-party software that will keep a project organized?  Had I known ahead of time that the folders were buggy, I could have named the classes in a uniform way that grouped them together in the list, but I didn't, and, for now, it is easier to occasionally, manually sort the classes into folders than it is to manually search the classes every time that I want to do something.
Maybe VC++ 6.0 Class View supports namespaces? I uninstalled it long time ago, so I can only guess.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.