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

Unable to create class using VC++ class wizard

Whenever i try to create a new class using Visual C++ class wizard.
e.g if i want to create a new class(e.g. CNewclass) in c:\program files\microsoft visual studio\My projects\test project. it gives the error message::
Unable to open the files (c:\program files\microsoft visual studio\My projects\test\Newclass.h,c:\program files\microsoft visual studio\My projects\test\Newclass.cpp) for class "CNewclass".

But i can  see those files in the File view's Source files folder & header file folder. But in the class wizard's messagemaps tab, the class is not present in the class name list. So i m not able to add the new fuctions & variables in that class using class wizard.

This problem in not there if the Operating system is windows 98. but if i use Windows NT workstation or Windows XP, it occurs. Kindly help asap.
0
fundo_techies
Asked:
fundo_techies
1 Solution
 
AlexFMCommented:
Do you try to create the class which already exists? If files already exist, you need to add them to Class Wizard, and not to create class again.
To add the class to Class Wizard, close project, remove .clw file, open project again and select View - Class Wizard command. VS informs you that clw file should be created, and asks what files should be used for this. Select all project cpp and h files and press OK.
0
 
arindam_bhCommented:
If you want to add a fresh class irrepective of checking whether the class NewClass exist, then delete the files from File view if they are occuring there. Remove theNewClass.h and NewClass.cpp files from the respective directory and then right click over the code section once. If VC++ had considered those files to exist, then it will prompt you from where you can remove these files and then add fresh class.
Thanks
0
 
fundo_techiesAuthor Commented:
No i am not creating a class that already exists.

AlexFM your solution is fine but the problem is that whenever i add a new class i have to follow the same procedure again. so what can be done so that i don't face this problem again. moreover many a times this problem doesn't arise while creating a class. basically it works randomly on NT workstation (not server) but it always works on Win 98.
0
Independent Software Vendors: 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!

 
AxterCommented:
What is your OS?
0
 
fundo_techiesAuthor Commented:
Axter, my OS is windows NT workstation.
0
 
AlexFMCommented:
Visual Studio has some synchronization bugs (can you beleive?). I guess when one thread makes some operations, another threads wonders who is writing to a file. As result of this, we have stange messages like "File ... is modified out of text editor", "File already exists", "Access denied" etc. From my experience, this may depend on computer speed, hard disk free space etc. Sometimes Visual Studio is so confused that it deletes some source files. If this is your case, there is nothing to do. Maybe VS7 is better.
0
 
AlexFMCommented:
This is really interesting: the same thing happened with my project right now. This is first time I see such message after creating a new class. I removed clw file and created it again, it helps.
After installing of last Win2K Service Pack Visual Studio works with delays in some places, I hate this. My Win2K was installed 3 years ago, I made a lot of installations, not all programs and drivers are removed completely. I think I will do clean new installation of Win2K (3 years is not bad, Win98 should be reinstalled every week...). Many things are running much better after Windows installation, I hope this will help to Visual Studio.
0
 
fundo_techiesAuthor Commented:
can anybody help???
0
 
fundo_techiesAuthor Commented:
ok if visual studio has some bugs then why is it that its working on windows 98 and not on windows NT...
0
 
fundo_techiesAuthor Commented:
well this was a partial solution and since i m not getting any more answers i accept arindam_bh's answer.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

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