?
Solved

Unable to create class using VC++ class wizard

Posted on 2003-03-26
10
Medium Priority
?
323 Views
Last Modified: 2008-03-10
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
Comment
Question by:fundo_techies
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
10 Comments
 
LVL 48

Expert Comment

by:AlexFM
ID: 8209069
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
 

Accepted Solution

by:
arindam_bh earned 100 total points
ID: 8209190
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
 

Author Comment

by:fundo_techies
ID: 8209411
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
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!

 
LVL 30

Expert Comment

by:Axter
ID: 8209442
What is your OS?
0
 

Author Comment

by:fundo_techies
ID: 8209587
Axter, my OS is windows NT workstation.
0
 
LVL 48

Expert Comment

by:AlexFM
ID: 8209706
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
 
LVL 48

Expert Comment

by:AlexFM
ID: 8210206
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
 

Author Comment

by:fundo_techies
ID: 8215405
can anybody help???
0
 

Author Comment

by:fundo_techies
ID: 8251517
ok if visual studio has some bugs then why is it that its working on windows 98 and not on windows NT...
0
 

Author Comment

by:fundo_techies
ID: 8377955
well this was a partial solution and since i m not getting any more answers i accept arindam_bh's answer.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question