- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
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.
Link Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
SIZEOF returns an INTEGER(8) on the 64-bit platforms, but this argument to GetObject is always 32-bits. Use SIZEOF(LFbold,SINT) instead.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - Steve Lionel (Intel)
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Darn - I was sure we had extended SIZEOF that way. Ok, use INT(SIZEOF(arg),SINT). That will work on both platforms.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - Steve Lionel (Intel)
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.
![](/skins/images/8B6E2C8F64F54CBD7F7262AA46F575DA/responsive_peak/images/icon_anonymous_message.png)
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