- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
CVF's integration with DevStudio includes automatic generation of locres.fd and resource.fd files when the resource compiler (or whatever it is) processes dialog setup information.
Is this missing from IVF/VS.NET? The VS resource editor seems to provide equivalent services to DevStudio's (better property pages, actually), but apparently only generates locres.h and resource.h standard C header files.
Obviously it's not difficult to create a small program to read the .h files and produce the equivalent .fd files, invoked by an external batch command, but it would be nice (indeed, expected) to have this done automatically as part of the IVF integration with VS.
Link Copied
31 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It is supposed to work. I have seen a case where a registry entry for VS.NET got corrupted and caused the step of generating the Fortran version of resources to be skipped. Doing a "repair" on the VS.NET install seemed to fix it. If you need more help, let me know , and I'll dig up the exact registry settings that need changing.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The VS.NET repair option didn't recover the .fd functionality. I would appreciate your registry hack to fix this.
TIA
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Here's what worked for another customer.
Delete registry entry HKEY_CLASSES_ROOT.rc
Do the Repair of VS.NET
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The resource.fd is not generated for me too.
Has the removal of the registry key followed by the repair of VS.NET solved the problemfor "Paul-Curtis"?
Guus
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Go to your "resource.h"->Right click->Properties. You should get:
Command Line: deftofd "$(InputPath)" "$(InputDir)$(InputName).fd"
Outputs: $(InputDir)$(InputName).fd
Do you?
FWIW, my HKCR/.rc branch looks like (contents of exported .reg file:)
Code:
Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT.rc] "Content Type"="text/plain" @="rcfile" [HKEY_CLASSES_ROOT.rcOpenWithList] [HKEY_CLASSES_ROOT.rcOpenWithListdevenv.exe] @=""
Jugoslav
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Also, here arecontents of HKCR/rcfile key:
Code:
Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT cfile] "AlwaysShowExt"="" @="Resource Script" [HKEY_CLASSES_ROOT cfileDefaultIcon] @="C:Program FilesMicrosoft Visual Studio .NETVc7vcpackagesresedit.dll,-27000" [HKEY_CLASSES_ROOT cfileshell] [HKEY_CLASSES_ROOT cfileshellOpen] [HKEY_CLASSES_ROOT cfileshellOpencommand] @=""C:Program FilesMicrosoft Visual Studio .NETCommon7IDEdevenv.exe" /dde" [HKEY_CLASSES_ROOT cfileshellOpenddeexec] @="Open("%1")" [HKEY_CLASSES_ROOT cfileshellOpenddeexecapplication] @="devenv" [HKEY_CLASSES_ROOT cfileshellOpenddeexec opic] @="system"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jugoslav,
You suggest with your question about the properties of the resource.h, that this file is in the list of files in the Visual Studio, but it is not there.
Only the resource.rc file is there.
Is that the problem? Should it be there when it is generated by compiling the resource.rc?
Guus
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The registry (Windows XP) contains the following information on .rc:
Code:
Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT.rc] "PerceivedType"="text" "Content Type"="text/plain" @="VisualStudio.rc.7.1" [HKEY_CLASSES_ROOT.rcOpenWithList] [HKEY_CLASSES_ROOT.rcOpenWithListdevenv.exe] @="" [HKEY_CLASSES_ROOT.rcOpenWithProgids] "VisualStudio.rc.7.1"="" [HKEY_CLASSES_ROOT.rcPersistentHandler] @="{5e941d80-bf96-11cd-b579-08002b30bfeb}"
Thus, no .rcfile
Guus
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, I believe resource.h should be included into project. Steve should confirm that, but, taking into account the way IVF8 (I think) treats these files, it looks logical to me.
The registry information about file associations works like this:
- under ".ext" key (".rc" in this case), first item "points" to another key under HKEY_CLASSES_ROOT. In your case, it's "VisualStudio.rc.7.1", in mine, it's "rcfile".
- that "pointed to" key contains information about registered application, which should be similar to mine.
I don't know why there is difference -- probably because my installation history dates back to DVF 5.0, and subsequent installations of various Visual Studios just fixed the file association instead of creating all key structure.
Jugoslav
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jugoslav,
It appears that the registry information besides the name "rcfile" vs. "VisualStudio.rc.7.1 " is the same.
I included the "resource.h" in the project. It is automatically positioned under the Header Files. The properties as you stated, were not set, so I add that properties. But when the commandline for resource.h will be activated? I change the resources, but only resource.h changed correctly, but no resource.fd is generated.
The next question is, why the resource.h is not automatically included in the project. If I remember well, in CVF it was also not included in the project. But there it works correctly. I ported the CVF project with the internal tool of IVF, but that tool take no actions to produce resource.h, nor resource.fd.
But besides this last problem my main problem remains: How resource.fd will be generated?
By the way: One hour after sending this message I'm out of office until monday. So furtherreplies of me afterthat timeare adjourned.
Guus
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The h->fd translation occurs as the first part of build step.
I've just played a bit with it, and it appears that
- AppWizard generated code correctly sets properties of "resource.h"
- If you import the project from CVF, it also correctly sets properties of "resource.h" (at least, provided it's included in the project)
However, if you add .rc file manually, later, you have to add the resource.h file yourself as well, and manually specify the build rule in its "Properties". Here it is again:
deftofd "$(InputPath)" "$(InputDir)$(InputName).fd"
Generating Fortran include file...
$(InputDir)$(InputName).fd
The string "Generating Fortran include file..." should appear in your output window and in buildlog.txt -- does it? Since you get "Tool returned an error code", you probably do -- doesBuildLog.txt tell anything more useful?
Jugoslav
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The properties of resource.h are indeed set.
But the build does not say "Generating Fortran include file", while the resource.h is changed.
The Buildlog.txt telles no more useful things.
Guus
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hmm... sounds like a dependency checker problem?
Here's a small solution I generated from scratch (added dependencies & build rules manually). Does it build correctly for you?
Jugoslav
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ordinarily, include files of any kind do not need to be included in the project. However, VS.NET has an unfortunate way of handling such things, and I'll have to say that I don't know with any level of certainty what you should do here. I will say that the projects I have worked with that had resource files did not have the .h file listed among the project files.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I will say that the projects I have worked with that had resource files did not have the .h file listed among the project files.
Hmmm... then, it doesn't work for me either. I've just:
* created a new empty windows app
* created new .rc file & included it in the project
* included resource.fd in the source. It cannot be found. Not that I expected it to work.
As I see it, IVF's AppWizard and CVF->IVF project converter specify custom build rule for .h files, invoking deftofd. Thus, no .h file in the project means no .fd file generated.
On the other hand, in CVF (where integration was better), the .h to .fd file translation used to be implementedduring saving .rc file (lemme check... yes). I don't know how you did it, but it worked nicely. I sort of wasn't expecting that to work the same way in IVF (with lower degree of VS integration).
Now, is it supposed to work the same way in IVF, or is the custom build rule the only way? (I still can't figure out what's the source of Guus's problem though).
Jugoslav
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I recall in CVF that it wasn't always enough to add the .rc to the project, one had to use the Insert Resource menu to do it. I never did quite figure out what worked and what didn't.
But I can tell you that I have a project I've been working on where all I did was add the .rc to the project and it works. There is no custom build step. resource.h is created by the IDE's resource editor and is not a result of compiling the resource file.
You can see how it's supposed to work by using the project wizard to create a new dialog-based Windows application and then building the project. FIrst, deftofd gets run to create the .f90 version of the resource file, then rc is called to compile the resource file. No custom build steps.
I don't know how all this magic works...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
But note that we're talking about .fd, not .h. You alwayscould have whatever.rc accompanied by resource.h, and resource.h has always (in both VS6 and VS.NET)been produced automatically, which is handled by VS itself. The problem is if you need resource.fd as well -- CVF folks somehow hooked that saving mechanism, automagically creating .fd on .rc save. IVF folks (yes, I know, mostly the very same folks), instead used custom build step invoking deftofd.
By the way, I managed to reproduce Guus's problem. Don't ask me how :-). And I reproduced it once (I added resource.h manually and set up the custom build properties for it). It would not build (missing resource.fd). Then, I fiddled with order of files in .vfproj file, saved it and it built fine. I retrieved the changes in .vfproj back, deleted .suo file, and it again built fine. ???
A phase of the moon problem?.. I'll work on it...
Jugoslav
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
There is no "custom build step", at least not one that is visible in the project. The Fortran project manager does know to run deftofd if it needs to. What I don't fully understand is exactly what the mechanism is and what can go wrong. I do know how to fix it (in most cases), though.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sorry for being dense, but why then IVF AppWizard (at least in case of Win32 Apps) generates skeleton code with resource.h explicitly included in the project, and build rule specified for it in its property page? (Note: "Custom build" step in application property pages is empty -- I'm talking about individual property page of resource.h).
To summarize, this is how it works for me:
- AppWizard does include resource.h in the project, and resource.fd is generated OK
- If I convert a CVF project with resource.h included, resource.fd is generated OK.
- If I convert a CVF project without resource.h included -- resource.fd is NOT generated OK.
- If I add whatever.rc to a project later, resource.fd is NOT generated OK.
When it's not generated OK, the solution is toadd "resource.h" to the project and specify the build rule for it, invoking deftofd.
Is it normal behaviour? I'd say yes.
Sometimesthe last stepdoesn't work either (as it does not for Guus and did not for me, but alas I can't reproduce it). Perhaps deleting the .suo file will work for him (I don't have a bad one anymore)?
Jugoslav
Jugoslav
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
At last I get it to done!
There are two major things:
- In CVF I never had the resource.h included in the project. It was always along with the resource.fd file automatically gegenerated.
Also the conversion fron CVF to IVF did not include resource.h in the list of project files. It was generated in IVF when compiling the resource.rc file, but the resource.fd was not generated.- Including the resource.h in the project makes it necessary to set the correct properties of that file. In my first trials still the resource.fd file was not generated. But after various trials I figured out, that it was needed to close and re-open the solution to activate the property changes!
Now things work as expected. Jugoslav and Steve thanks for your extended services.
I have still one question. What is the .suo file? Jugoslav mentioned this and I have seen it in earlier messages. But I don's see a .suo file in my solution.
What is this file and where is it located?
Guus

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