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

getcharwidth32

steve_konarski
Beginner
832 Views
In a fortran subroutine, I am trying to use the text function getcharwidth32.
The compiler gives warning
Variable ABC is used before its value has been defined
The call to the command is
ret=getcharwidth32(hdc,1,ntv,ABC)
and I get a last error via getlasterror of 87
which is The parameter is incorrect
At the top of the subroutine i have
use dfwinty
use gdi32
and define ABC to be
integer ABC(0:255)
Any suggestions
0 Kudos
2 Replies
Jugoslav_Dujic
Valued Contributor II
832 Views
Hint: when in doubt, do a "Find in Files" for requested symbol in

C:PROGRAM FILESINTELCOMPILERFORTRAN9.0IA32INCLUDE

and take a look at Fortran INTERFACE.

For GetCharWidth32, the last argument is

integer(LPINT) arg4 ! LPINT arg4

and it doesn't have a !DEC$ATTRIBUTES REFERENCE. That means that you need:

ret=GetCharWidth32(hdc,1,ntv,LOC(ABC))

(LPINTs, LPDWORDs etc. are always translated by Intel's translator software into integer(LPDWORD), instead of, perhaps more natural, integer(DWORD)+!DEC$ATTRIBUTES REFERENCE. That means that you always have to use LOC() in the calling sequence).
0 Kudos
steve_konarski
Beginner
832 Views
This works thanks again
0 Kudos
Reply