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

Getting Font information 64-bit

dannycat
New Contributor I
618 Views
In my continuing quest to convert my application to 64-bit I have hit another snag. I have a routine that obtains a font using the handle, and resets the font weight and then uses the new settings for a dialog box control. See example below.
subroutine dlg_SetBold(dlg,idc,istyle)
!****************************************************************
! Set Font Style of Control
!****************************************************************
implicit none

! Arguments type(DIALOG) :: dlg
integer,intent(in) :: idc
integer,intent(in) :: istyle

! Local Variables
integer(HANDLE),save :: hFont=0
integer(BOOL) :: iret

! Get Current Font
if(hfont.eq.0) then
hFont = SendDlgItemMessage(dlg%hWnd, idc, WM_GETFONT, 0, 0 )
iret = GetObject(hFont, sizeof(LFbold), LOC(LFbold))
LFbold%lfWeight = istyle
hBoldFont = CreateFontIndirect(LFbold)
endif
iret = SendDlgItemMessage(dlg%hWnd, idc, WM_SETFONT, hBoldFont, MAKELPARAM(TRUE,0) )

return
end subroutine

The LFbold is a Global (T_LOGFONT) variable (this subroutine is extracted from a module). The x64 compiler comes up with the following message: 1>C:\Win\FEM2000\Modules\DFLogmX.f90(679): warning #6075: The data type of the actual argument does not match the definition. [SIZEOF]. The message refers to the GetObj function, what is the correct way to do this? Any help will be much appreciated.
0 Kudos
4 Replies
Steven_L_Intel1
Employee
618 Views
SIZEOF returns an INTEGER(8) on the 64-bit platforms, but this argument to GetObject is always 32-bits. Use SIZEOF(LFbold,SINT) instead.
0 Kudos
dannycat
New Contributor I
618 Views
SIZEOF returns an INTEGER(8) on the 64-bit platforms, but this argument to GetObject is always 32-bits. Use SIZEOF(LFbold,SINT) instead.

Steve, I justtried this but it doesn't compile.

C:WinFEM2000ModulesDFLogmX.f90(679): error #6506: This intrinsic procedure reference contains too many arguments. [SIZEOF]
C:WinFEM2000ModulesDFLogmX.f90(679): warning #6075: The data type of the actual argument does not match the definition. [SIZEOF]

I need it to work in both 32 and 64 bit applications.
0 Kudos
Steven_L_Intel1
Employee
618 Views
Darn - I was sure we had extended SIZEOF that way. Ok, use INT(SIZEOF(arg),SINT). That will work on both platforms.
0 Kudos
dannycat
New Contributor I
618 Views
Darn - I was sure we had extended SIZEOF that way. Ok, use INT(SIZEOF(arg),SINT). That will work on both platforms.

Thanks Steve, that seems to have done the trick.
0 Kudos
Reply