My menu, toolbar & stsatus bar have disapeared

My menu, toolbar & stsatus bar have disapeared

I have been debugging my program and suddenly my menu, toolbar & statusbar have all gone. Previously they were all working correctly.

hmenu = LoadMenu(hInstance, LOC(lpszMenuName))

all return 0.

Do you have any idea what I could have done.
The *.rc file looks OK.


60 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

I have just had another example of this going wrong. The menu, toolbar & ststus bar were OK. I removed some code that had nothing to do with the menu/dialogs, deleted the files in the debug directory, recompiled and the menu, toolbar & status bar have gone.

I only have the Microsoft Visual Sudio Shell. I have noticed that in the Solution Explorer when I click on resuorces it only shows the icons and bitmaps not the dialogs (I'm not sure if it ever did show these).


This sounds like a resource editor problem.
What resource editor are you using?
Or are you editing a resource file directly?

The shell does not include the Microsoft resource editor. ResEdit ( can be used as an alternative.

Steve - Intel Developer Support

I'm using Resedit.
I wondered if that was a problem but I have not used Resedit yet on this project - but have used it on another project.
The problem may have started after I edited another projects *.rc file - now I can't get the menu, toolbar or status bar to dispay on any project.

Make sure that your resource.fd file is up-to-date.
You have to ensure that deftofd.exe is executed after each time you change your resource file in order to get the resource.def file properly translated to the Fortran-friendly resource.fd file that you have to include wherever you refer to resource identifiers in your Fortran code.

I'm sure the resource file is up-to-date.
How do you ensure deftold.exe is executed after each time I change the resource file?

Can you attach the troublesome RESOURCE.RC file (and perhaps the accompanying RESOURCE.H and RESOURCE.FD)?

You can add a custom-build event by right-clicking on RESOURCE.H (after including it in your project) to bring up its 'properties' page then selecting 'custom build step' to execute deftofd.exe. An example I have shows

deftofd "$(InputPath)" "$(InputDir)$(InputName).fd"

as the custom build step, which will then invoke DEFTOFD.EXE with RESOURCE.H as input and RESOURCE.FD as output, (the executable will be automatically found in the default executable search path, probably in folder $(IFortInstallDir)bin\ia32\).

(edited for errors!)

Do I add RESOURCE.H to the heder files, resource files or source files?

It does not matter at all, this grouping is only for your convenience. "Header files" would be my choice.


I have added it and found the propery page but not sure exactly what to enter, I didn't follow your instructions.

deftofd "$(InputPath)" "$(InputDir)$(InputName).fd"

as the custom
build step, which will then invoke DEFTOFD.EXE with RESOURCE.H as
input and RESOURCE.FD as output, (the executable will be automatically
found in the default executable search path, probably in folder

This is what I have.

I'm still stuck on this problem.
Not sure if what I entered for the Custom Buils Setup is correct.
I have attached my resource files as requested a few posts ago.
Hope this help.

Please can you add all the missing icons?
And bitmaps?

And what exactly goes wrong - dialogs do not display?

The resource files you attached display OK in the resource editor of CVF (after references to missing icons and bitmaps were commentd out). All dialogs appear to be 'there'.

The Resource.fd appears to contain the required resource symbols (IDD_SB
etc.) so as long as it is included, they should be found OK. Always include 'IMPLICIT NONE' in you code to ensure that all variables used have been defined, his will pick up missing INCLUDE 'resource.FD' statements and mistyped variable names etc.

I think you should delve more into the statements you posted that create the dialogs using CreateDialogParam. You should check that Hinst and Hwnd are valid handles (where do you get them from?), that the DialogProc exists and is correctly pointed to, and if the return value is still Null you should ask for more information by calling GetLast Error and displaying the error message.

Thanks for your comments. I assume that you do not need the bitmaps & icons now, if you still need them I could attach them.

I don't think there is a problem with the calls to create the dialogs. This project was working OK in cvf. I then upgraded to ivf and it again worked correctly. I found a problem that the program hangs occasionally (this is described in another post). I was going to send my program to Intel support but as it is a very large program I was in the process of cutting it down. This involved removing most options and therefore removing dialogs, icons and bitmaps that were not required. As I only have Microsoft Visual Studio shell I edited the resources in ResEdit. Since I have done this I find that no projects work in Microsoft Visual Studio - even other projects where I had not changed the dialogs.
I went back to my cvf project (using the original cvf resuources), upgraded it to ivf following the same process as before and again I got the problem with the menu, toolbar, status bar etc. - had not edited the resources this time.
It appears that because I used ResEdit once I can never display any resousce in any project.
Maybe the only, but expensive, solution is to buy the full version of Microsoft Visual Studio.

I have not used 'implicit none' as in Project Properies - Configuration Properties - Fortran - Diagnostics, I have warn form undeclared symbols & warn for unused symbols set to 'Yes'. I have added 'implicit none' but it does not give any errors.

I added getlasterror (after the call to display the menu) and got error 1813 'The specified resource type cannot be found in the image file'.

I hope this helps to find what the problem is. I wonder if others have used ResEdit successfully with ivf.

Are your dialog resources included in your main application file, or are they in another file, for example a resource-only EXE?

I'm not exactly sure what your question is but I'm sure the answer is that it is included in the main application file.
I am creating one executable. All the fortran files and *.rc file is in the same location. The executable is created from these files.
For every project there are seperate fortran files (they may share some library files) and *.rc files and they are in sepertate directories and they create a seperate executables.
I'm not using a resource only EXE.


Thanks for all the work you have done on this.
I loaded your program, compiled it and tried to run it.
It came up with an error message "Error initializing application dodgydialog"
I try to investigate it a bit more.

By the way, are you compiling a 32-bit or 64-bit application for running on a 32-bit or 64-bit operating system?

The project I supplied should just have been unzipped to a location and the project loaded into IVF.
You should then be able to execute it by using 'Start without debugging' with no building required.

What exactly did you do?
If you created a new project, then you have to include all the resource and header files into the project, as well as the Fortran source files in order to get all the resources included into the application executable., where they should then be found - unless you get a problem trying to use a 32-bit program on a 64-bit machine, when you can have problems with 8-byte integer handles being required where only 4-byte integers are specified in the code.

I'm running a 32 bit application on a 64 bit machine (I think).

I unzipped the file into the a directory - I just used the project you sent.
I got an error message when I tried to run it.
I had to go into Project properties, Configuration Properties, Linker, Input, Ignore Specific Library - and specified 'comsuppw.lib'. Then it 'runs' and gives the error as mentioned in the last post after
lret = DlgInit(IDD_DODGYDIALOG_DIALOG, gdlg)

You are using the VS08 Shell which, in some older versions, omitted comsuppw.lib. You can install the Windows SDK to find that library or uninstall Fortran and the VS Shell then download the current full Fortran that includes the shell to get it.

Steve - Intel Developer Support

Free resource explorers will allow you to confirm that the dialogs and menu resources are definitely present in the .EXE file (see, for example

Perhaps you should edit the project configuration to add a new platform, X64 (so long as you have installed the 32-bit and 64-bit versions of the compiler) and compile for that and see what happens?

Otherwise I'll leave it for Steve Lionel and others to comment on the possible 64-bit consequences, as I do not use 64-bit at present.

1. I previously installed SDK from this this post:

comsuppw.lib is not included.

Therefore you suggest uninstalling ivf and Visual Studio and downloading the new ivf.
Is the download ivf different to what is on the CD I bought?
I could not find where to download it on the intel site. I clicked on "buy" but it just gives a list of resellers.
Where do I download it?

2. I tried changing to x84 on the dodgydialog example and it gave several compile errors (which I'm not sure how to fix) - I'm not sure this is the problem.

My program was 'OK' (apart from it occasionally hanging) until I used ResEdit to edit the resources.

To download updates, log in to the Intel Registration Center. If you had not previously registered, do it then. Yes, we have had three updates since the DVD was produced, and a fourth is coming this week.

The Windows SDK does include comsuppw.lib.

Steve - Intel Developer Support

I uninstalled IVF & Microsoft Visual Studio Shell and downloaded the current IVF.
I het the following error message when I open the 'dodgydialog' project:-
"Package Load Failure"
Package 'Microsoft.VisualStudio.Xaml' has failed to load properly. Please contact vendor for assistance..."

I pressed OK to continue and when I try to compile the program I get lots of errors - 11018 cannot open version.lib, kernel32.lib, user32.lib, gdi32.lib etc.

What have I done wrong?

Please uninstall again, then reinstall. When you uninstall, be sure to also get "Microsoft Tools and Libraries for Intel Visual Fortran"

Steve - Intel Developer Support

I uninstalled IVF, Microsoft Tools & Libraries for IVF & Microsoft Visual Studio Shell and downloaded the current (update 4) IVF.
I still get the following error message when I open the 'dodgydialog' project:-
"Package Load Failure"
Package 'Microsoft.VisualStudio.Xaml' has failed to load properly. Please contact vendor for assistance..."

pressed OK to continue and when I try to compile the program I get lots
of errors - 11018 cannot open version.lib, kernel32.lib, user32.lib,
gdi32.lib etc.

What have I done wrong?

Please try the uninstall reinstall one more time. This time, delete the Microsoft Visual Studio 9.0 folder before reinstalling. If this still fails, I will ask our install developers for assistance.

Steve - Intel Developer Support

I will give that a try.
In Conrol Panel - Programs & Features, there is 'Intel Management Engine Components', I haven't uninstalled it, I assume that is correct.

Just about to delete Microsoft Visual Studio 9.0 and see it contains Visual Basic 2008.
I'm using Visual Basic 2008, so I would rather not uninstal Microsoft Visual Studio 9.0.

Correct - that's not part of the Fortran product.

If the reinstall doesn't help, try running through the steps here, including the repair tool.

Steve - Intel Developer Support

I have not unistalled Microsoft Visual Studio 9.0 as it contains Visual Basic 2008.

I have started to read the trouble shooting guide.

I have Visual Basic 2008 installed which uses Microsoft Visual Sudio Express.
Is this a problem?

Oh, yes it is a problem. I am not sure if this will work, but try this. Uninstall Visual Basic Express. Install Intel Visual Fortran WITH the Visual Studio Shell. See if that works for Fortran. Then reinstall Visual Basic.

Steve - Intel Developer Support

Thanks for the suggestion.
I unistalled IVF, Visual Studio Shell, IVF libraries Visual Basic, deleted the Microsoft Visual Studio directories.
I then installed IVF and when I tried to run it a got some errors about missing files, but it allowed me to open and compile the project. But when I run it, I get the message, "Error initialising application DodgyDialog". When I try opening IVF again I no longer get the missing files errors but cannot run the application.

I installed VB express and the updates and VB runs but with IVF I still cannot run the application. (I was worried that I would no longer be able to use VB).

Do you have any more suggestions?
I wonder whether I have to buy the full Visual Studio?

I think you ought to try my DodgyDialog project on a 32-bit OS running the 32-bit IVF compiler and see if it works, as it does on my workstation. If it works, then your problem may be related toyour compiling it for a 64-bit OS without due care being modifying the code to use integer handles etc. as 8-bytes long, or something similar.

Thanks for your suggestion but I'm not sure what I need to change to get 32-bit OS running the 32-bit IVF compiler.

I'm running Windows 7 and the System type is 64-bit operating system.

In IVF, if I go to Project properties and Configuration Manager the Active Solution platform is Win32 and for the Project the platform is Win32.

What do I need to change?

Nothing - those settings will get you a 32-bit application. You don't need to find a 32-bit OS.

Steve - Intel Developer Support

Thanks, I've tried that.
I get 'IDD_dodgydisalog Initialisation Error - Extended error 0' click OK and the program exits. No buttons were displayed and I didn't have to use the taskbar.

I would suggest creating the simplest Fortran dialog project and getting that to work.
Select New..Project..Intel Visual Fortran...Dialog Code, default name 'WinApp1'.
MAke sure that the 'resource.fd' file is included in the solution window.
Add it to the solution as an existing item if necessary.

Build the solution and run it. That should work straight out of the box.

Then, if you have the VS resource editor, I would recommend doing the following:
(as I think RESEDIT will not permit you to drag and drop resources between panes)

Search for and Open the dodgydialog.rc file.
Open the WInApp1.rc file

Close all tabs other than these two
From the 'window' menu, choose 'vertical tab group', which should put the two windows side by side in visual studio (
expand the 'Dialog' tree in dodgydialog.rc window
Use the mouse to drag the IDD_AIROBS_CHECK dialog over to the WinApp1.rc pane.
This should add the IDD_AIROBS_CHECK dialog (and all of its controls) to the WinApp1 resources. Check it has done so.
Close the dodgydialog.rc file, ignore all changes.
Save the WinApp1.rc file, saving the changes.

Make some code additions to WinApp1.F90...

in the WinApp1Apply call-back routine,

type (dialog) dlg


type (dialog) dlg, adlg

After 'implicit none' add

include 'resource.fd'

Then finally insert the following code after '! TO DO; Add your APPLY logic here'

lret = DlgInit(IDD_AIROBS_CHECK, adlg)
lret = DlgModal(adlg)

Save the file and rebuild.

Now when you execute the program, the 'Apply' button on the WinApp1 dialog should cause the IDD_AIROBS_CHECK dialog to open.

If that works, then use the 'Exit' but to quit each dialog.

If the above works, then there is no inherent problem on your system with adding resources to the executable. Otherwise, you do have a serious problem!

Thanks for that suggestion.

I created a new project. The resource.fd file wasn't included in the solution window so I added it.
I compiled it and ran the application.
It gives the error message "Error initialising application WinApp1".
Is there any way I can see why lret = DlgInit(IDD_WinApp1_DIALOG, gdlg) fails?

When I started upgrading from CVF to IVF my programs did compile and run. It is only since around the time of using ResEdit that they have all stopped working - but I don't see the connection.

Unfortunately, DlgInit only returns a pass/fail value. You will have to call GetLastError to get an error code and then you should display it in a message box or print it out and then look up the meaning in the numbered list of system errors, assuming that the function that fails calls SetLastError.

It is weird that the simplest dialog example fails on your system. It is therefore not a Resedit problem since that editor has not been anywhere near the IVF-created dialog application WinApp1 (I presume?).

Perhaps, around the time that you downloaded Resedit, you may have unwittingly downloaded a virus or other malign bug that has screwed up your system?
It may be a good idea to do a system restore to a time before that period, just to see if that improves things.
A full anti-virus scan, in safe mode, would be a good idea too.

Thanks, I added GetLastError and the error code is 1813 which is "The specified resource cannot be found in the image file".

We have a good antivirus system so I wouldn't expect a virus to be the problem, I'm a bit reluctant to do a system restore but maybe I will have to.

To simplify things further here's a really simple test program that you can easily compile from the command line.

DialogTest.f90(A module that's also a main program!)

DialogTest.rc (This is an extract from your resource file that you posted previously)

resource.h (Another extract from your file)

Because style flags and message processing may not be correctly set up, the dialog may behave a little strangely, but you should still be able to see if the resource can be loaded. If the dialog is displayed then click on it with your middle mouse button to make it go away.

I can only test under IA-32 but I think it should work on Intel64 too (if not, let me know).

Might not be pertinent, but your original resource file had a few different LANGUAGE spec's in it. Is there a reason for this? What's the language of the system you test and develop on? If you've defined the resource for one language but then your user/system language is set to something else you might run into issues finding resources.

I have never compiled from the command liee so I create a new empty project and added the files you sent.
I compile it and ran. I get the error "CreateDialogParam failed wioth getlast error of 00000715".
Don't know if I have done this correct.

I was experimenting with different laguages so the original resoure file contained one dialog in Spanish - I could have deleted it. I don't think this should cause a problem.

I think there is no point in trying anyone's posted code any longer. You/we are going round in circles.

All else is rendered irrelevant by the overwhelming fact that you cannot run the simplest dialog program (default WinApp1_Dialog) that Visual Studio creates for you, which indicates that you have a major problem with your installation of Visual Studio or your Operating system, or both.

I think you need to go back to square one by uninstalling IVF, uninstalling Visual Studio (I gather you are using the VS Express version, correct?), doing a reboot ( I still think you should do a system restore to a date you know when all was fine as well) and then reinstalling everything from scratch.

MAke sure you have administrator privileges when installing and running VS and IVF. What operating system are you using?

P.S. Considering the difficulties you face in using Resedit, it would be worth
investing in a full version of VS which comes with an integrated
resource editor RC.EXE. IMHO, modifying, copying and pasting resources outside VS is fraught with problems unless you are expert.

Anthony is probably right (I don't think it's an OS level problem though, or you'd have applications failing all over the place), but for future reference, to compile from the command line:

  • Copy the previously attached files to an empty folder of your choice (perhaps a folder named FolderOfYourChoice under Documents)
  • Open an Intel Fortran command prompt (Start > Programs > intel Parallel Studio XE 2011 > Command Prompt > Parallel Studio XE with Intel Compiler XE v12.0 Update 4 > Intel 64 Visual Studio 2008 mode)
  • In the command prompt change the current directory to be the folder of your choice (cd \Users\YourUsername\Documents\FolderOfYourChoice)
  • Type the compile commands as listed in the comments of the previously attached files (rc DialogTest.rc && ifort /winapp DialogTest.f90 DialogTest.res)
  • If the compile is successful, type the name of the exe to run it (DialogTest)

I just did this on a nearly fresh-out-of-the-box VM image of 32 bit XP with SP3 that has basically only had ifort 12.0.4 (with the Intel supplied VS 2008 shell) installed on it, and it worked fine.

Also a good idea with these sorts of problems to post the build log from a "Rebuild" of the relevant solution. That can sometimes help identify things like a wrong compiler option, the wrong file being picked up or even the wrong program being executed as part of the build process.

As another diagnostic, here's a little fortran command line program that will list the resources that are in any DLL or exe (whatever filename is provided as its first argument). Again, if you want to try it I'd suggest trying to compile it from the command line as a first step.


Here is the build log. Maybe it will help.

Looks as if I will be buying VS 2008 Standard and restoring my computer and reinstalling all the software.
I will be busy on a VB project for the next few days then I will get back to this problem as it has to be solved as no IVF project works.


I don't see the .res being linked in, which I suspect is part of the problem. When you manually add a .rc/.h to a project you need to add a custom build step as explained in the documentation.

Steve - Intel Developer Support

Thanks for the comment on the .res not being linked.
I think I have now added the custom setup build.
I still get the same error on running the program.
I have attached the build log, hope this helps.

I'm not sure what I'm doing wrong. The propery pages for my resource.h is the same as yours.
But the build log does not contain the first seven lines including "Genarating fortran include file" and "deftofd resource.h resource.fd".
Msaybe there is a simple reason.


Leave a Comment

Please sign in to add a comment. Not a member? Join today