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?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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.
>>>> 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
Introduction to Web Design

Develop a strong foundation and understanding of web design by learning HTML, CSS, and additional tools to help you develop your own website.

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.
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.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Maybe VC++ 6.0 Class View supports namespaces? I uninstalled it long time ago, so I can only guess.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.