Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Jamez

Stupid Windows Programming Question

This topic is 6025 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

I''m trying to make the simplest menu with Visual C++ 6.0. A "File" menu with one selection "New". I go to the "Project" menu in VC then select "Add to project" then "New...". Next I select "Resource Script". I then open the resource script and add my "File" menu then I add "New" to that menu as well. When I add the "New" menu item I specify an ID for the menu from the drop down list ID_FILE_NEW seems like a logical choice for this menu item so I accept it. The problem is when I compile my code the compiler complains that ID_FILE_NEW is not defined. Why does VC allow you to choose an ID from the drop down menu but then it doesn''t define it for you in resource.h? Anyone else have this problem!? I''m not using MFC by the way.

Share this post


Link to post
Share on other sites
Advertisement
It defines it automatically for me when I do a MFC app. I would think if it generates the .h file with the .rc file it would update them together. So it works after you manually edit the header file?

Share this post


Link to post
Share on other sites
Redemption:

Yes it works after I manually edit resource.h with ID_FILE_NEW or I can include "afxres.h" in resource.h and that works as well. There are many symbols like ID_FILE_NEW defined in that header. I think it was intended to be used with MFC primarily frustrating though.. shouldn''t have to edit resource.h for something so simple.

Oluseyi:

Yes I have looked in resource.h and it is not defined. I have also looked in resource.rc where the symbol ID_FILE_NEW is referred to but not defined. I have found that resource.rc includes a header called "afxres.h" which defines ID_FILE_NEW among many other common symbols but for some reason these definitions aren''t made visible to my .cpp code. The MSDN refers to these symbols as read-only but I don''t know what that means exactly. I have to manually include afxres.h in either my source code or the resource.h file for my code to compile. By the way I am using MAKEINTORESOURCE already. All the code is fine except for the reference to ID_FILE_NEW. It''s really been bugging me!

Share this post


Link to post
Share on other sites

  • 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!