- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am trying to use SETSCROLLINFO in a fortran windows routine at the beginning of the routine I have
"use dfwinty"
and vinfo and hinfo are specified as a type (T_SCROLLINFO) structures ,
the calls to setscrollinfo are
ret= SetScrollinfo( hWnd, SB_VERT, vinfo,.TRUE.)
ret = SetScrollinfo( hWnd, SB_VERT, vinfo,.TRUE.)
when i compile i get
Error: This name does not have a type, and must have an explicit type. [SETSCROLLINFO]
i= SetScrollinfo( hWndd, SB_HORZ, hinfo,.TRUE.)
steve Konarski
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You will find its interface in the USER32 moddule, so add
USE USER32
to your program, alongside USE DFWINTY
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks - i am already using USER32 but prob got an old version (6.01) and the interface for setscrollinfo and getscrollinfo are not there have yopu the interface for these two functions - regards steve konarski
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I tried
interface
integer function SetScrollInfo( hwnd, mesg, wParam, lParam )
!DEC$ IF DEFINED(_X86_)
!DEC$ ATTRIBUTES STDCALL, ALIAS : '_SetScrollInfo@16' :: SetScrollInfo
!DEC$ ELSE
!DEC$ ATTRIBUTES STDCALL, ALIAS : 'SetScrollInfo' :: SetScrollInfo
!DEC$ ENDIF
integer hwnd
integer mesg
type (T_SCROLLINFO) wParam
logical lParam
end function
end interface
but it did not work
and got
Error: The type of the actual argument differs from the type of the dummy argument. [HINFO]
i= SetScrollinfo( hWndd, SB_HORZ, hinfo,.TRUE.)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Here is what's in USER32.F90 in my version of CVF (6.6C):
FUNCTION SetScrollInfo( arg1, &
arg2, &
arg3, &
arg4)
USE DFWINTY
integer(SINT) :: SetScrollInfo ! int
!DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'SetScrollInfo' :: SetScrollInfo
integer(HANDLE) arg1 ! HWND arg1
integer(SINT) arg2 ! int arg2
!DEC$ ATTRIBUTES REFERENCE, IGNORE_LOC, ALLOW_NULL :: arg3
TYPE(T_SCROLLINFO) arg3 ! LPCSCROLLINFO arg3
integer(BOOL) arg4 ! BOOL arg4
END FUNCTION
END INTERFACE
Note that arg4 is actually INTEGER (BOOL here does NOT mean LOGICAL!),. HANDLE, SINT and BOOL are all = 4 in DFWINTY, so arg1, arg2 and arg4 are all INTEGER(4).
The 'IGNORE_LOC, ALLOW_NULL' directive I have never seen before. I guess it means that without it, arg3 should be an integer pointer to the T_SCROLLINFO type arg3 structure, which would otherwise be obtained using LOC(arg3). You could try this if the above interface does not solve your problem.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
interface
integer function SetScrollInfo( hwnd, iSb, SI, bRedraw)
!DEC$ ATTRIBUTES STDCALL, ALIAS : '_SetScrollInfo@16' :: SetScrollInfo
!if T_SCROLLINFO is not defined in your DFWINTY,
!substitute a module of your own:
USE DFWINTY, ONLY: T_SCROLLINFO
integer hwnd
integer iSb
!DEC$ATTRIBUTES REFERENCE:: SI
type(T_SCROLLINFO) SI
logical bRedraw
end function
end interface
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
These and DECORATE would not be in CVF 6.1, I believe.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thjanks for the help - I managed to get the program working by using loc(hinfo) and loc(vinfo) in the call to setscrollinfo
steve

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