Link to home
Start Free TrialLog in
Avatar of rickatseasoft
rickatseasoft

asked on

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
Avatar of jkr
jkr
Flag of Germany image

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.
Avatar of AlexFM
AlexFM

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
Avatar of rickatseasoft

ASKER

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
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.
ASKER CERTIFIED SOLUTION
Avatar of AlexFM
AlexFM

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Maybe VC++ 6.0 Class View supports namespaces? I uninstalled it long time ago, so I can only guess.