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

LOADMENU Doesn't function VS2019 with 2022.0.0.77 compiler

watfor-mike
Beginner
283 Views

Hope this isn't a stupid question, but I'm having trouble loading a menu from a resource file.  Things have changed from WATFOR and F77  that I used in college many years ago...

 

I can compile the QWIN and Console applications without issues.

 

I have used the SDI scaffold project to try to build a desktop application.

 

I can double click on the rc file and view and edit it.

 

        .....snip....

        lpszMenuName ="WinsdiApp1"C
        lpszAccelName ="WinsdiApp1"C

        ....snip....

      ! Load the window's menu and accelerators and create the window

       ghMenu = LoadMenu(hInstance, LOC(lpszMenuName))
       if (ghMenu == 0) goto 99993
      haccel = LoadAccelerators(hInstance, LOC(lpszAccelName))
      if (haccel == 0) goto 99992

      .....snip.....

 

 I've added some dialog boxes to the scaffold to identify where the problem occurs. 

If I comment out the ghMenu lines, the program compiles and runs producing a window with no menu.  The accelerator loads successfully from the same rc file.

Uncommenting the ghMenu lines, the program compiles without errors or warnings and terminated via the error dialog box.

 

The code is slightly different from the code in the VF manual, and I've tried including VFWIN in place of the first two includes.

 

Any help would be appreciated.   

 

 

Labels (1)
0 Kudos
3 Replies
andrew_4619
Honored Contributor II
264 Views
Your project built and ran properly for me. But an earlier oneapi version.
watfor-mike
Beginner
258 Views
Andrew
Thank you I'm implementing a potential fix from an older string. My rc file was tagged with text in the registry instead of script. One reg edit and a repair, might be the fix....fingers crossed.
watfor-mike
Beginner
244 Views

 

Thanks to @andrew_4619 for checking that the code was correct and to @Steve_Lionel who provided a potential fix at the following link.

 

 View solution in original post

 

My .RC file entry was set to a different content type, the entry deletion and VS repair fixed the issue.

Reply