Sunday, August 2, 2009

How to clear this error in mfc programming..what is the mistake done?

e:\gokilavani\vp\newmenu\menu.cpp(3) : fatal error C1083: Cannot open include file: 'resource.h': No such file or directory

How to clear this error in mfc programming..what is the mistake done?
That error mean that your project cannot find it's resource.h file. This file is necessary to translate the UI widgets identifiers names to IDs.





It is normally in the folder where your *.dsp file is located. If you can't find it anywhere you are a bit in trouble. You will need to get a "sample" resource.h from a similar (MFC mdi/sdi/dialog) project, and place it in your project. But you will need to either redo your UI to have it register it's widget in your resource.h file, or the other way around: mimic the declaration present in the file to fit the widget names present in your UI.





The first method is more straightforward and easy to get to work, but if that mean a lot of work to start back your UI from scratch you can try the second. Be aware that you risk getting your project in an inconsistent state that way. If that ever happen simply remove the new resource.h file. You'll get back to the current state.





This is a somewhat cumbersome task. Apart from plainly deleting that file, I don't understand how it could happened.





anyway, good luck.


No comments:

Post a Comment