Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

AFXRES.H missing....

TonyRichards
Novice
1,725 Views

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

 

 

 

0 Kudos
1 Solution
andrew_4619
Honored Contributor II
1,698 Views

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. 

andrew_4619_0-1639953845705.png

If you just delete the .h it in the RC file it will just get added back in automatically

View solution in original post

5 Replies
Neels
New Contributor I
1,717 Views

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.

andrew_4619
Honored Contributor II
1,699 Views

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. 

andrew_4619_0-1639953845705.png

If you just delete the .h it in the RC file it will just get added back in automatically

TonyRichards
Novice
1,665 Views

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.

Neels
New Contributor I
1,682 Views

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.

andrew_4619
Honored Contributor II
1,673 Views

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.

Reply