• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 228
  • Last Modified:

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
0
rickatseasoft
Asked:
rickatseasoft
1 Solution
 
jkrCommented:
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.
0
 
AlexFMCommented:
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.
0
 
itsmeandnobodyelseCommented:
>>>> 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
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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
   Folder1
   Folder2
   Folder3
   Folder4
   ClassA
   ClassB
   ClassC...
 
as opposed to the way that I have it organized

MyProject Classes
   + Folder1
   +Folder2
   -Folder3
       Classx
       Classy
       Classz...
   +Folder4

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

itsmeandnobodyelse:

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.

AlexFM:

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.
0
 
AlexFMCommented:
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.
0
 
AlexFMCommented:
Maybe VC++ 6.0 Class View supports namespaces? I uninstalled it long time ago, so I can only guess.
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now