- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
use gdi32
and define ABC to be
integer ABC(0:255)
Any suggestions
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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).
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).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This works thanks again

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page