Solved

VC++ Class Wizard

Posted on 2001-08-21
17
1,116 Views
Last Modified: 2013-12-03
I have always liked hand written code a lot better than the code generated from wizard kind of thing.  However, now I have come to the time that I have to use class wizard of VC++.  The project I am workng on is plain hande crafted code.  The problem is that the Class Wizard menu is grayed out.  Can anybody tell me how to activate this thing?  I started this project from VC++ not using App Wiz. I manually imported MSFlexGrid into the project.  As I am trying to write event handlers and stuff like that, I realized that I cannot find enough information about it from anywhere.  Thus I decided to use Class Wiz, but I cannot get it to run - The menu is disabled.  My project doesn't have .CLW file.  Does anyone have any idea about this?  
0
Comment
Question by:string6
  • 10
  • 6
17 Comments
 
LVL 86

Expert Comment

by:jkr
ID: 6410108
Well, the steps for rebuilding the .clw file might help:

To rebuild the ClassWizard file

Delete your project's .clw file.


On the View menu, click ClassWizard.
If ClassWizard appears, the project for which you deleted the .clw file is not the active project. From ClassWizard's Project drop-down list, select the project for which you want to rebuild the .clw file.

If ClassWizard asks you to close any files, close ClassWizard, close the files, and then restart ClassWizard.
A message box asks if you want to rebuild the ClassWizard file from your source files.

Click Yes.
The Select Source Files dialog box appears.

Use the Add and Add All buttons to transfer all of the project's .h and .cpp files, and the .rc file from the File Name list to the Files In Project box. Click Remove to remove any files other than .h, .cpp, or .rc from the Files In Project box.


Click OK.
ClassWizard appears and generates a new .clw file.

Click OK to close ClassWizard.

(from http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore98/HTML/_core_rebuilding_the_classwizard_.28...clw.29_.file.asp)
0
 

Author Comment

by:string6
ID: 6410175
The problem is I don't have .CLW file to delete, and class wizard menu is not activated - grayed out.
0
 
LVL 86

Expert Comment

by:jkr
ID: 6410186
>>The problem is I don't have .CLW file to delete

I know - start with

On the View menu, click ClassWizard.

A message box asks if you want to rebuild the ClassWizard file from your source files.

Click Yes.
The Select Source Files dialog box appears.

Use the Add and Add All buttons to transfer all of the project's .h and .cpp files, and the .rc file
from the File Name list to the Files In Project box. Click Remove to remove any files other than .h,
.cpp, or .rc from the Files In Project box.


Click OK.
ClassWizard appears and generates a new .clw file.

Click OK to close ClassWizard.
0
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 

Author Comment

by:string6
ID: 6410222
The problem is I don't have .CLW file to delete, and class wizard menu is not activated - grayed out.
0
 

Author Comment

by:string6
ID: 6410242
When I click view menu, class wizard menu is grayed out.
It does not accept click.
0
 

Author Comment

by:string6
ID: 6410257
When I click view menu, class wizard menu is grayed out.
It does not accept click.
0
 
LVL 86

Expert Comment

by:jkr
ID: 6410296
>>and class wizard menu is not activated - grayed out

Do you have MFC/ATL in your project? If not, add it, as the ClassWizard only works with these - see http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore98/HTML/_core_using_classwizard.asp
0
 

Author Comment

by:string6
ID: 6410299
When I click view menu, class wizard menu is grayed out.
It does not accept click.
0
 
LVL 86

Expert Comment

by:jkr
ID: 6410303
PS: Try to avoid pressing your browser's 'refresh' button - better use the 'reload question'
link provided in the upper right corner of the page...
0
 

Author Comment

by:string6
ID: 6410307
Thanks I notices that my stuff is being posted over and over,
0
 

Author Comment

by:string6
ID: 6410320
I use MFC classes (like CWnd, CButton stuff like that) and I even imported an ActiveX control, MSFlexGrid.
Yes it is MFC project, but I did not use app wizard.

By the way, du you know how to delete duplicate postings?
0
 
LVL 86

Accepted Solution

by:
jkr earned 300 total points
ID: 6410941
>>By the way, du you know how to delete duplicate postings?

There is none :o)

BTW: A solution that often helps for this kind of problem is to delete the .ncb and .opt files
0
 

Author Comment

by:string6
ID: 6410966
My bigest problem is that I am trying to use ActiveX control in plain CWnd derived window, not CDialog.  I thinks the Class Wizard wants me to use them only in CDialog. using resource editor.  But, I cannot use CDialog in this project.  I just decided that I am not going to process events.  I will be processing WMs instead.
0
 

Author Comment

by:string6
ID: 6410969
Thank you for your help!!
0
 
LVL 86

Expert Comment

by:jkr
ID: 6410999
So, did deleteing the files help?

(Haven't worked with the CW for a while, but I remember that we once had a similar problem and solved it this way)
0
 

Author Comment

by:string6
ID: 6411230
Actually that was good idea, but it still forced me to do Dialog based, which was a problem.
0
 

Expert Comment

by:valentins
ID: 8180575
Just add an empty resource file to your project.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
mixing C++ & C# in Vis Studio 2013 7 235
Best book to learn C++ 4 87
How do ASP.NET and MVC work together? 4 70
C# LINQ ForEach() question 6 81
This tutorial is about how to put some of your C++ program's functionality into a standard DLL, and how to make working with the EXE and the DLL simple and seamless.   We'll be using Microsoft Visual Studio 2008 and we will cut out the noise; that i…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

756 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