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

resource symbol mixup

blwiland
Beginner
1,007 Views
I ported a Fortran project from CVF to IVF and then made some changes to a dialog box. The CVF project originally stored the resource symbols in a file called resource.fd. Whenever any changes to the dialog were made, they were reflected in this file. In addition, there was/is an include 'resource.fd' line in the subroutine that calls the dialog.
After I ported to IVF and made changes to the dialog, IVF created another file for resource symbols named resource.h. The changes are reflected in this file rather than resource.fd. When the program is compiled, the visual changes to the dialog box are reflected, but the new id symbols do not seem to be recognized by the calling program. If I look in the resource.h file to get the values and then manually edit the resource.fd file and add them,the programworks properly.
I don't know how this happened, but is there any way to recreate this symbol resource file so that there is only one.
Bruce
0 Kudos
12 Replies
Steven_L_Intel1
Employee
1,007 Views
There is a supplied program DefToFD.exe which is supposed to be run automatically as part of a build process if you have a resource file (.rc) in your project. This creates the .fd automatically.

We have seen some cases where this automatic running doesn't work. There are a couple of solutions that have worked, but I would suggest trying this:

1. Uninstall Intel Fortran.
2. In Add/Remove programs, do a Change on VS.NET, then do a "Repair/Reinstall" on VS.NET.
3. Reinstall Intel Fortran.
0 Kudos
blwiland
Beginner
1,007 Views
Steve,
If I reinstall, will it recreate the resource.fd file from my resource.rc file? Right now if I delete the resource.h file and the resource.fd file ordelete just the resource.h file and then try to look at the dialog in VS,I get the error message "RC2104: undefined keyword or keyname: id5" where id5 is the first symbol ID referenced in the resource.rc file.
I have tried changing all includes from resouces.fd to resource.h but that causes error messages. The format in the resource.fd file looks like this:
integer, parameter :: id5 = 1010
The format in the resource.h file looks like this:
#define id5 1010
Isreinstalling the only solution?
If I reinstall, will the symbol file be created during compilation? Will it be called resource.fd or resource.h, i.e., can I leave the include "resource.fd' line in the subroutines or will I need to change the include 'resource.fd' to include 'resource.h' in the subroutines?
Thanks,
Bruce
0 Kudos
blwiland
Beginner
1,007 Views
Steve,
After posting my last message, I realize that I am/was a bit confused about how the resources work. I see now that resource.fd and resource.h are actually different file types, not just different names, and are both required.
IfI understand correctly,when you make changes to resource.rc, both resource.h and resource.fdshould berecreated. However, if I delete resource.h, I cannot find a way to recreate it. Ifone accidentally deletes the resource.h file, is is possible to recreate it having only theresource.rcfile. If so, how?
I do not find the DefToFD.exe file anywhere on my computer, so perhaps that is part of the problem.
Bruce
0 Kudos
Paul_Curtis
Valued Contributor I
1,007 Views
Unlike CVF, IVFlacks an explicit and automaticmechanismto (re)build resource.fd and locres.fdfrom resource.h and locres.h. I reported this to Premium Support probably 10 months ago,and have hadabsolutely no response. Unfortunately the suggested re-installations (ie, voodoo)will not fix this problem.
As a workaround, Icreated a small app, runin a batch filefrom a desktop icon, which does what CVF used to do automatically: read the resource.h and locres.h files and createresource.fd. This also gave me the opportunity to improve on the original, so I have the constant names all nicely aligned, and listed in value order (you will note that the .h files have the values all scrambled up). I would be glad to send a copy of this project to anyone who is interested.
Paul Curtis
0 Kudos
nijhuis
Beginner
1,007 Views
I've had the problem of the missing resourde.fd 10 month ago.
Jugoslav gives me the following solution:
  • Be sure resource.h is included in the project
  • Add the following information to the properties of resource.h (right mouse click on the file name in the solution explorer list) :
    Command Line:
    deftofd "$(InputPath)" "$(InputDir)$(InputName).fd"
    Description: Generating Fortran include file...
    Outputs: $(InputDir)$(InputName).fd
    (The bold names are the property names)
  • Save, close and re-open the solution (I must do so, otherwise it did not work)
  • Build the project

Now the resource.fd should be available.

Guus

0 Kudos
anthonyrichards
New Contributor III
1,007 Views
As A CVF 6.6c user for some time, I am often amazed at the shortcomings in IVF listed on this board. This one is a doozy. It means that every project with resources that I have would fall over at the first hurdle (i.e. recompilation with IVF). Notencouraging to a would-otherwise-be a first-time user.
Why has it not been fixed after at least 10 months? It is this sort of problem popping up (and failure to deal with it) that regularly discourages me from contemplating (expensively) converting to IVF.
P.S. I like the 'voodoo' jibe at the reistallation suggestions.
0 Kudos
Paul_Curtis
Valued Contributor I
1,007 Views
I also got the message from Jugoslav about how to set up DefToFd.exe. What I found is that this only works in the (special) case where resource.h and locres.h do not exist, ie the very first resource compilation. If the resources are subsequently modified, resulting in revised .h files, DefToFD does not detect this and hence does not update the .fd output files. So the procedure is not automatic, and you have to remember to manually delete the .h files before every resource compilation. In addition, as I noted previously, the results obtained from DefToFD are poorly formatted and difficult to read, unlike the CVF version.
0 Kudos
nijhuis
Beginner
1,007 Views
That was not my experience. After updating the properties of the resource.h, all subsequent compilations are correct executed, inclusive compilations started via dependencies.
The contents of the resource.fd file is indeed a mistery.
All resources are in it, but in an unpredictable and unformatted sequence.
But so what. I never looked in the resource file. I only see themvia the Edit-Resourcesymbolsmenu item.
Guus
0 Kudos
Steven_L_Intel1
Employee
1,007 Views
Paul, you are incorrect that IVF does not have a mechanism for automatically processing resources. It does, the same as CVF's. The problem we have seen is that on some systems, the registry entry for .rc files is set to a value that prevents the .rc from being processed. We don't know what triggers this, but we do know how to fix it.
0 Kudos
blwiland
Beginner
1,007 Views
OK Steve, I am going to uninstall IVF, do a change and repair/reinstall of VS .NET, reinstall IVF, and see if it fixes the problem. Is there anything I need to be aware of in unintalling and reinstalling IVF? I originally installed this program using w_fc_pc_8[1].1.021.exe which I downloaded from the Intel website. I am hoping this file is all I will need. Since I do not have access to a broadband connection at this time, I will have to reinstall this version instead of the most current one on the website.
If I understand correctly, after it is reinstalled, I should delete resource.fd and a recompilation will recreate resource.fd.
I do not believe youanswered my question about resource.h. If all you have is resource.rc, can resource.h be recreated by the program. If so, how does one do this or will the reinstallation allow this to happen automatically also?
Thanks,
Bruce
0 Kudos
John_Eidinger
Beginner
1,007 Views
Quoting - blwiland
Four years later, and I have a similar problem. teh same problem shows up for IVF installed under Windows XP and Windows Vista. Here it is.

For a new Fortran project, I create a new resource.rc. I add a few dialogs The first compilation creates resource.h.. I then include the deftofd command for resource.h as described in the Fortran Help. Everything builds and compiles and works nicely.

I do another day or two of editing, rebuilding, adding more dialogs into resource.rc. Everythings works nicely.

Then, upon adding yet another resource dialog into resource.rc, randomly (I think?) the resource.h file does not get updated, ergo resource.fd does not get updated. Nothing I do, short of recreating a brand new resource.rc and re-inserting all the dialogs (very time consuming!!) will fix this. What Can i do to force the resource.rc to updated resource.h?? Must I manually insert all the symbols into resource.fd?
0 Kudos
Steven_L_Intel1
Employee
1,007 Views
resource.h is created by compiling resource.rc with the Resource Compiler (rc.exe). The .fd file is created from the .h file by running deftofd.exe. I recall seeing a problem in the past where the file association for .rc files got changed to be "text file" or something like that. It should be "Resource script".
0 Kudos
Reply