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

Problem loading dialog

marcp
Beginner
891 Views
Hello,

I have a cvf project that I am trying to compile in IVF under Visual Studio 2005 standard edition. As far as I can tell the resource isn't being compiled as there is no .res file generated. When I run the program in debug or release mode it cacks when it tries to load the dialog. I am pretty green on resource files as they are hidden in Delphi, my usual environment.

The original project has a single dialog defined in a script1.rc file along with an icon defined in an icon1.ico file, which are listed as resource files in the project. I can load and view either of those from within VS. There is also a resource.h and resource.fd file.

The project builds properly in either debug or release mode, but fails to initialize the dialog (DLGINIT).

The relevant part of the io function is:
subroutine kim_tmi_io()
USE DFLOGM
INCLUDE 'RESOURCE.FD'
TYPE (dialog) dlg
external ok
external cancel
external browse_in,browse_out
real*4 decl,incl
LOGICAL retlog

character*256 file_in,file_out
character*10 c_incl,c_decl,c_depth,c_radius,c_susc,c_xo,c_yo,c_cor_min,c_width,c_field
common /etat/iok,icancel
common /file_name/file_in,file_out
common /param/incl,decl,depth,radius,susc,xo,yo,cor_min,grdsz,xmag,nn
data iok,icancel/0,0/

interface
integer(4) function InitializeOpen
end function
end interface


ifile_in_exist=0

retlog = DLGINIT (IDD_Dialog1, dlg)
IF (.not. retlog) THEN
WRITE (6,*) 'ERROR: dialog not found'
endif

Retlog always returns as FALSE. IDD_Dialog1 is defined in the Resource.FD file.

I've followed the instructions in the user and reference guide "Designing a Dialog Box Overview" and I'm seeing the include file being created during the build.

I've forced rc to compile the script1.rc file into script1.res, with no luck. I've copied it into the debug directory, same result.

I'm sure this is very simple, but I'm getting nowhere. Any hints?

cheers

Marc Pelletier
Goldak Airborne Surveys


0 Kudos
4 Replies
Jugoslav_Dujic
Valued Contributor II
891 Views
Quoting - marcp
Hello,

I have a cvf project that I am trying to compile in IVF under Visual Studio 2005 standard edition.
...
I've forced rc to compile the script1.rc file into script1.res, with no luck. I've copied it into the debug directory, same result.



From your description, it seems that the resource compiler (rc.exe) is not invoked in the automated build process. It's not immediately obvious why, though.

  1. You said "VS2005 standard edition" -- can you please reconfirm it's not actually VS Premier Partner edition, which comes bundled with IVF? VS PPE does not have resource editor (but does have a resource compiler as far as I know).
  2. When you create and build a fresh dialog-based IVF application using the wizard, does it work?
  3. What does the Right-click/Properties/Command line for your .rc file say? Mine says '/d "_DEBUG" /l 0x0409 /fo "Debug/myapp.res"'
You were on a right track for a workaround by forcing the resource compilation; but additionally, you have to give it to the linker (like an ordinary .obj file), adding it to Linker/Input/Additional dependencies. But that`s a clutch--you shouldn't have to do it manually.

Tip: You can see what resources actually exist in any executable file. Just do File/Open your .exe or .dll file. VS2005 default is to "Open as resources" (in VS6, you must select "Open as"). It won't help you in this case, probably -- from your description, none will be there.
0 Kudos
Steven_L_Intel1
Employee
891 Views
Is the problem that the build does not invoke rc.exe to compile the resource? In the past, one reason for this I have seen is an incorrect file association for .rc files. Try this (instructions for XP - might be different in Vista or Win7):

Open a Windows Explorer (directory) window.
Select Tools > Folder Options
Click on the FIle Types tab
Locate the extension RC. It should say something like:
Resource Template
Opens with Microsoft Developer Studio

If it doesn't (if it says Text File, for example), I suggest:

Delete the association
Do a "repair" of Visual Studio in Add/Remove Programs
0 Kudos
marcp
Beginner
891 Views
Quoting - Jugoslav Dujic

From your description, it seems that the resource compiler (rc.exe) is not invoked in the automated build process. It's not immediately obvious why, though.

  1. You said "VS2005 standard edition" -- can you please reconfirm it's not actually VS Premier Partner edition, which comes bundled with IVF? VS PPE does not have resource editor (but does have a resource compiler as far as I know).
  2. When you create and build a fresh dialog-based IVF application using the wizard, does it work?
  3. What does the Right-click/Properties/Command line for your .rc file say? Mine says '/d "_DEBUG" /l 0x0409 /fo "Debug/myapp.res"'
You were on a right track for a workaround by forcing the resource compilation; but additionally, you have to give it to the linker (like an ordinary .obj file), adding it to Linker/Input/Additional dependencies. But that`s a clutch--you shouldn't have to do it manually.



Jugoslav,

Thanks for your response. My replies below.

1. It is indeed standard edition. It was purchased separately.

3. Under the project properties, resources, command line I see /d "_DEBUG" /l 0x0c0c /fo "Debug/kim_tmi.res", but under the rc file's properties there was nothing. I've fiddled with the command line there, entering rc /d "_DEBUG" /fo "Debug/kim_tmi.res" and the "Debug/kim_tmi.res" as outputs seems to work!

2. I'm not competent to create and use a dialog from scratch yet, but if I run the wizard and then create a dialog I still don't see anything in the rc custom build. Looks like I may have an installation problem.

I also found that the default association for .rc files was wrong and set it to visual studio.


Now I'm displaying the dialog and dying elsewhere.

Thanks for your help.

Marc

0 Kudos
marcp
Beginner
891 Views
Is the problem that the build does not invoke rc.exe to compile the resource? In the past, one reason for this I have seen is an incorrect file association for .rc files. Try this (instructions for XP - might be different in Vista or Win7):


Steve,

The file association was set to the Watcom editor, which I also installed (and apparently never removed) before settling on the Intel compiler. I've changed it now.

I have managed to get the dialog to display now as described in my other post. If only that were my only problem!

Thanks for your help.

Marc
0 Kudos
Reply