- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
PrintDlg function. See the PrintFile_1.f90 file attached.
By Default, the orientation is in portrait.
Could you please tell me. How to change (in the program) the orientation
by Default into landscape?
I am using Compaq Visual Fortran 6.6.
Thank you for your help.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
subroutine
testuse
ifwinimplicit none
type
(T_PRINTDLG) pdtype
(T_DEVMODE) devminteger
ldevm, alloc_statinteger
, allocatable :: idevm(:)devm%field1.dmOrientation= DMORIENT_LANDSCAPE
devm%dmFields = DM_ORIENTATION
! Indication of filled orientation field ldevm = sizeof(devm) allocate(idevm(ldevm), stat=alloc_stat) call CopyMemory(loc(idevm), loc(devm), ldevm)pd%hDevMode =
loc(idevm) ! fill other pd fields !..... deallocate(idevm) ! after pd has been used end program testI am not sure about the used allocation. I have used T_DEVMODE to retrieve some information in an already filled structure. In that case an integer handle is known and the following code is used:
integer idevn, idevm, jdevm, ldevm
! call subroutine to retrieve a T_DEVNAME and a T_DEVMODE structure.
! the integers idevn and idevm arehandles to the structures
call getpr(idevn, idevm)
ldevm = sizeof(devmode)
jdevm= GlobalLock(idevm)
call CopyMemory(loc(devmode), jdevm, ldevm)
! Get number of copies
ncopy = devmode%dmCopies
! Get orientation
orient = devmode%field1%dmOrientation
retval = GlobalUnlock(idevm)
retval = GlobalFree(idev m)
subroutine
testuse
ifwinimplicit none
type
(T_PRINTDLG) pdtype
(T_DEVMODE) devminteger
ldevm, alloc_statinteger
, allocatable :: idevm(:)devm%field1.dmOrientation= DMORIENT_LANDSCAPE
devm%dmFields = DM_ORIENTATION
! Indication of filled orientation field ldevm = sizeof(devm) allocate(idevm(ldevm), stat=alloc_stat) call CopyMemory(loc(idevm), loc(devm), ldevm)pd%hDevMode =
loc(idevm) ! fill other pd fields !..... deallocate(idevm) ! after pd has been used end program testI am not sure about the used allocation. I have used T_DEVMODE to retrieve some information in an already filled structure. In that case an integer handle is known and the following code is used:
integer idevn, idevm, jdevm, ldevm
! call subroutine to retrieve a T_DEVNAME and a T_DEVMODE structure.
! the integers idevn and idevm arehandles to the structures
call getpr(idevn, idevm)
ldevm = sizeof(devmode)
jdevm= GlobalLock(idevm)
call CopyMemory(loc(devmode), jdevm, ldevm)
! Get number of copies
ncopy = devmode%dmCopies
! Get orientation
orient = devmode%field1%dmOrientation
retval = GlobalUnlock(idevm)
retval = GlobalFree(id evm)
I am not sure if in the first example also GlobalLock etc. has to be used, but I hope you have with these examples enough information to make a working piece of software.
Guus
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

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