- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm trying to recompile legacy Digital Visual Fortran programs using a OneApi Fortran compiler in VS2019.
A particular program in question is a windows dialog based program. VS2019 will not display the program's resource.rc file because of the missing file afxres.h
Do I need it? One piece of advice is to edit it the .rc file and replace afxres.h with windows.h .
Another is to install Microsoft MFC for C++. Is the Msoft MFC C++ available from the VS2019 installer, do you know?
Any other options?
TIA
Anthony Richards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
1] From solution explorer open the Resource file (.rc).
2] Right click on the top item in the resoure tree <name>.rc
3] On the pop up menu click "resource includes"
4] Remove afxres.h
5] mine looks like the picture attached.
If you just delete the .h it in the RC file it will just get added back in automatically
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I had the same issue and copied afxres.h from an older install:
Copy "afxres.h" from:
C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\atlmfc\include
to:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.16.27023\atlmfc\include
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\atlmfc\include
Hope this helps you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
1] From solution explorer open the Resource file (.rc).
2] Right click on the top item in the resoure tree <name>.rc
3] On the pop up menu click "resource includes"
4] Remove afxres.h
5] mine looks like the picture attached.
If you just delete the .h it in the RC file it will just get added back in automatically
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for your solution. After Iposted I looked up a recent test program I created in VS2019 and opened its .RC file and found #axfres.h was replaced with #winres.h and #winver.h so I replced #axfres.h accordingly. I was unaware of the edit trick involving the Includes, thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you, that worked but I had to also include the winres.h and winver.h files. Probably because the original .rc file was created with DVF in the late 90's.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You need to have some stuff defined for the rc file and it has to come from somewhere and that somewhere needs to be installed. Winres.h is part of the VC++ install and is needed. In some other Universes you might have afxres.h which I believe includes Winres.h within it. I don't think this pertains to DVF in anyway. For some reason this problem seem to pop up for me every few years.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page