Software Archive
Read-only legacy content
17061 Discussions

DFWIN PROBLEM V6.6

Intel_C_Intel
Employee
558 Views
Hi,

I am having problems compiling/linking SETWINDOWTEXT and LOADIMAGE together in the same routine. Therein lies the workaround. This is the only problem which occured going from V6.5a to V6.6 which is not bad considering the size of the program.

Bill Buchholz

PROGRAM TESTREAD

USE DFLIB
USE DFWIN

CALL SETWINDOWTEXT (GETHWNDQQ(QWIN$FRAMEWINDOW),'TEST'C)

IRES = LOADIMAGE ('FRED.BMP'C,1,1)

END

!
!
! WITH DFWIN
!
!
!--------------------Configuration: TESTREAD - Win32 Debug--------------------
!Compiling Fortran...
!D:TESTREADTESTREAD.F90
!D:TESTREADTESTREAD.F90(8) : Error: There is no matching specific function for this generic function reference. [LOADIMAGE]
! IRES = LOADIMAGE ('FRED.BMP'C,1,1)
!---------------^
!Error executing df.exe.
!
!TESTREAD.OBJ - 1 error(s), 0 warning(s)
!--------------------Configuration: TESTREAD - Win32 Debug--------------------
!
!
!
! WITHOUT DFWIN
!
!
!Compiling Fortran...
!D:TESTREADTESTREAD.F90
!Linking...
!TESTREAD.OBJ : error LNK2001: unresolved external symbol _SETWINDOWTEXT@12
!Debug/TESTREAD.exe : fatal error LNK1120: 1 unresolved externals
!Error executing link.exe.
!
!TESTREAD.exe - 2 error(s), 0 warning(s)
0 Kudos
3 Replies
Steven_L_Intel1
Employee
558 Views
Bill,

I think I see what happened here... LoadImage exists in both DFLIB and USER32 (implied by DFWIN). In V6.5, there was no conflict becuse the declaration in USER32 was non-generic and the compiler could resolve between them based on the different signatures. But in 6.6, the USER32 version of LoadImage became a generic (to accomodate an "ease of use" improvement in the interface), and that means that it hides the version in DFLIB (I'm not sure if the compiler is supposed to give an error for this - I'll check.)

The easy fix is to say instead:

USE DFWIN, IGNORE => LOADIMAGE

This renames the LOADIMAGE you don't want.

There may be other cases like this - we'll check it out. I would ask that in the future you send problems like this (used to work but doesn't now) to vf-support@compaq.com instead of posting here.

Steve
0 Kudos
Steven_L_Intel1
Employee
558 Views
Oh, by the way, your sample program wouldn't compile at all in 6.5A because of the two different LoadImage declarations.

Steve
0 Kudos
Intel_C_Intel
Employee
558 Views
Steve,

Attached is a fragment of the program that did compile and link ok under
v6.5 and not under v6.6. The MAKEBMP routine that contained the
LOADIMAGE statement was not actually called. In the release version,
the linker output information that the routine would not be included
in the executable. I can only assume that it was included in the debug
version and thus satisfied the externals since it was part of the main
program file and not a separate program file in a library.

Bill

PROGRAM WMSVPROG
!
! Purpose : Minsurv menu program.
!

USE DFLIB
USE DFWIN

! CALL MAKEBMP

CALL SETWINDOWTEXT (GETHWNDQQ(QWIN$FRAMEWINDOW),IOSTR)

!
! EXIT PROGRAM
!
STOP

CONTAINS

!********************************************************************

SUBROUTINE MAKEBMP

KBSTR = 'D:WMSV01MDDIALWMSVPROG.BMP'C

IRES = LOADIMAGE (KBSTR,1,1)

END SUBROUTINE MAKEBMP

!********************************************************************

END PROGRAM WMSVPROG
0 Kudos
Reply