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

VC++ 6.0 ClassWizard Error

Strange problem just started happening with VC++ 6.0 ClassWizard.  

1) I'm trying to add a new message handler to a class
2) I open CW and choose object ID, message, and click Add Function.
3) I then click on Edit Code and get a dialog which says:
"Error while updating file(s)(...gives name of files here...) for class CMainDialog"
4) No further information is given about this error.
5) I did delete the clw file and rebuilt the database, no effect.
1 Solution
I've had this problem in VC++ 5, and it drove me NUTS!

Here's how I solved the problem...

Make sure the files that the ClassWizard is going to modify are open in the editor. Then the problem never happens.

(I've searched the Microsoft Knowledge base on this problem, and haven't found anything.)
jhanceAuthor Commented:
Nice try, it even seemed logical.  Too bad it didn't work.
Well, VC++ 6 still has problems in this general area.
This works with VC++ 5.
Hoped it would help you, too.
Good luck.
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

jhanceAuthor Commented:
Adjusted points to 200
Did you apply service pack 1 yet?
jhanceAuthor Commented:
Yes, I have installed the service pack.  Further, if you read the release notes to the SP, there is no indication of a fix for a problem of this type.
You might have the wrong permissions (don't ask me how) or file attributes for the file into which CW is writing into. Try removing read attribs and use CW again. Another possibility is that you might have changed the class's name somewhere in the header file (in the Message Maps maybe?) - do a case insensitive search for your class name and maybe this'll do the trick.
jhanceAuthor Commented:

You may be on to something here.  It's not the file attribs, there are no read-only files set but I got to looking at the maindlg.h file and found that everything between the:

      // Generated message map functions

and the


had been duplicated many times.  I deleted all of the extra ones and tried to add a message handler again.  No go, BUT the entire list of message maps was duplicated again.  Each time I try and add the message map, the list is duplicated again.

Any further ideas?

jhanceAuthor Commented:
Well, I did find the problem.  It's not what you said but your comment got me looking the the right area.  The situation was that one of my message map function declarations in the header file had somehow gotten outside of the ClassWizard commented block.  When I moved it back where it belonged, everything was OK.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

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