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

My menu, toolbar & stsatus bar have disapeared

davidgraham
Beginner
5,074 Views
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))
hWndSB=CreateDialogparam(hinst,MAKEINTRESOURCE(IDD_SB),hwnd,loc(DlgProc),0)
hWndTB=CreateDialogparam(hinst,MAKEINTRESOURCE(IDD_TOOLBAR),hwnd,loc(ToolDlgProc),0)

all return 0.

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

Thanks
0 Kudos
59 Replies
davidgraham
Beginner
1,203 Views
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.
0 Kudos
IanH
Honored Contributor III
1,203 Views
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.
0 Kudos
davidgraham
Beginner
1,203 Views
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.

0 Kudos
anthonyrichards
New Contributor III
1,203 Views
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.
0 Kudos
IanH
Honored Contributor III
1,203 Views
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.

EnumResources.f90
0 Kudos
davidgraham
Beginner
1,203 Views
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.

Thanks
0 Kudos
Steven_L_Intel1
Employee
1,203 Views
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.
0 Kudos
davidgraham
Beginner
1,203 Views
Steve,
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.
0 Kudos
davidgraham
Beginner
1,203 Views
Thanks,
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.
0 Kudos
davidgraham
Beginner
1,203 Views
I have reported this problem to Premier Support.
Why is it givig an error and not displaying the dialog?
Why is it not building the resouces?
So far they have been very slow to respond.
0 Kudos
IanH
Honored Contributor III
1,203 Views
Some suggestions:

  • Post the vfproj file for the project.
  • Make sure your not running into something silly like there being anothe rc.exe program on your system that's being called instead.
0 Kudos
davidgraham
Beginner
1,203 Views
Thanks,
I have three rc.exe files:
the correct one (I assume) in c:\Program Files (x86)\ Microsoft Visual Studio 9.0\vc
one in c:\Program Files\Microsoft SDKs\Windows\v6.0A
one in c:\Program Files (x86)\InstalShielD ...
I tried renaming the last two and it made no difference.

I have attached the vfproj file from your DialogTest project.
0 Kudos
Steven_L_Intel1
Employee
1,203 Views
I have seen some times where the .rc extension loses its correct association and this prevents VS from recognizing it.

Run Regedit and look at the key HKEY_CLASSES_ROOT\.rc - What do you see for (Default), Content Type and Perceived Type?
0 Kudos
davidgraham
Beginner
1,203 Views
The Name is 'Default', Type is 'REG_SZ' and Data is 'rc_auto_file'.
There is also a Persistent Handler - the Name & Type are the same, the Data is a long string of numbers & letters.

0 Kudos
Steven_L_Intel1
Employee
1,203 Views
Not exactly what I asked. Here's what it looks like on my system - what about yours? (Your VS version may be
different).



0 Kudos
davidgraham
Beginner
1,203 Views
Here is what it looks like on mine.
0 Kudos
davidgraham
Beginner
1,203 Views
I eventually got my program to work.
I think I hadn't uninstalled correctly. I had used Control Panel - Programs & Features, I don't think it uninstalled correctly. I have now used the unistall option from the Install disc and it uninstalled. I then installed again and it appears file. I also deleted .rc from the registry.
Thanks for everybodys help.
0 Kudos
Steven_L_Intel1
Employee
1,203 Views
You would have had to delete .rc from the registry before reinstalling - if it was still there, the reinstall would not help.

I wish I knew which product install modifies the association of .rc. I've seen this issue five or six times now over the years.
0 Kudos
Reply