Jump to content
  • Advertisement
Sign in to follow this  
Samurai Jack

Object Required - WTF?!

This topic is 4807 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Greetings! Did anyone notice this Visual Studio .NET bug, when you try to add a class to your project? Clicking add class will open the dialog and by clicking finish it fires up an message box with "Object required!" - wtf?! I found out, that when i generate applications with MFC Wizard, the same procedure shows no error and it works. Did anyone hade the same experience?

Share this post


Link to post
Share on other sites
Advertisement
Yes!

But it is a Win32 Application with no wizard. Win32 empty project (properties: Using MFC in shared dll). Add Class fails. But with wizard generated application it works.

Share this post


Link to post
Share on other sites
Unless you start the project as a MFC app, Visual studio doesn't let you add MFC classes to it.

It appears not to be a bug, in the sense that it's how Microsoft intended it to behave, but I can't see why it's that way.

Share this post


Link to post
Share on other sites
Yes it is a stupid bug. I have found the solution.
Any project you create, it has to include "stdafx.h" even if it is empty.
What is that Object Required bug?

The stupid class wizzard want's to just open stdafx.h in a local folder, that's all. Since it does not find it, it says "Object required". Try it for yourself. Just add an empty stdafx.h to your project and Add Class will work.

Another thing the stoopid Class wizzard does is to include $(Project name).h in all generated classes.

For example, if your project name is "MyTest" and you want to add class "CMyDialog" it will create MyDialog.cpp & .h files and they will include "MyTest.h". Idiotic.

Share this post


Link to post
Share on other sites
Thats probably because you have precompiled headers turned on in the options.

project -> project properties -> c/c++ -> precompiled headers -> create/use precompiled headers -> not using precompiled headers

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!