Thursday, April 13, 2006

MFC: Class Wizard Error "Object Required"

I did a couple google searches and found a few people stuck on this one.

In Visual Studio 2003 C++ you start the Class Wizard by doing [Add Class].

From a blank project, often the error 'Object Required' comes up. And nothing happens.

I did some google searches and found no answers, only people like me with the same question. I eventually found an answer. It gives an error because it requires stdafx.h. Add stdafx.h as a blank file and it should work okay.

This was discovered trying to do the MFC Tutorial Part 5, step 7:


Anonymous said...

what do you mean by "add stdafx.h" as a blank file? can you provide step by step instructions?

marker said...

Okay, we are talking about project files. For some reason visual studio 2003 requires a file to be in the project called "stdafx.h". Now you don't need to have anything in that file. You just need to have it there. I can't help you beyond this. Most of what you learn will be figuring that kind of thing out on your own.

Evan Meakyl said...

Thanks a lot!!!!!