I know that this is a c++ forum but im a college student and i cant practice the programs without clearing this problem coz most of the programs require "resource.h"

this program is to attach a menu to a window

class myframe:public CFrameWnd
		Create(0,"hello mfc",WS_OVERLAPPEDWINDOW,rectDefault,0,MAKEINTRESOURCE(IDR_MENU1));
class myapp:public CWinApp
	int InitInstance()
		myframe *p;
		p=new myframe;
		return 1;
myapp a;

fatal error C1083: Cannot open include file: 'resource.h': No such file or directory

I have already clicked on insert then resource then menu then new.
After this i saved it and put script 1 in the same drive,ie C Drive Program files.
I then right clicked resource and clicked on add file folder.
what have I done wrong or what more must I do.
For any of u who have Yashavant Kanethkar's Visual C++ programing.this program is from there.Ch3:Introuction to MFC.
Thanks a lot.

Recommended Answers

All 7 Replies

what compiler are you using? resource.h must be in the same directory as the project *.cpp or *.c files.

I also found it impossible to include that file "resource.h". I tried to add a file by that name to the Resource folder in the file view after making such a file in Notepad. No avail!! So many people a grappling with this problem. I am on also on the lookout for the solution to this problem.

Simple solution -- just read my post of 4 years ago.

I am compiling the same code that ineedurhelp did and getting the same error. Can ancientdragon give me the link to the solution he has posted earlier. Is it specific to this problem?

There is no link -- I just know from experience that vc++ and MFC requires resource.h to be in the same folder as all the other *.cpp and header files.

But , How can I create Resource.h for this specific program code. I tried in Resource editor, but failed. I am not good at VC++ resources.

>>But , How can I create Resource.h for this specific program code.

It's just a text file so you can use any text editor such as vc++ or even Notepad. Now if you want to know what to put in resource.h then you should have been reading a tutorial, like this one.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.