Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
DevMode
Message
De
07/01/2000 09:14:10
Razvan Alexandru
Soft Team Solutions Srl
Bucharest, Roumanie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Titre:
DevMode
Divers
Thread ID:
00314434
Message ID:
00314434
Vues:
81
Dear Christof,
I downloaded Struct.Zip.
It's really useful but I still have some problems in using it.
My knowledge in C and API functions is poor.

I created a report generator for VFP's reports
to be used in an application to generate users new reports
and I need to get info about installed printers, get the dialog box
and get back information abot new settings of the printer.

In the above program I expect that "SetPointer"
fills the DevMode structure with info about my printer.
The debugger shows empty values.

What do I do wrong ?

Thanks in advance
Razvan & Catalina

???????????

Set ClassLib to Struct, WinStruct Additive

#include apidef.h

Do ApiDef

Declare Integer DocumentProperties in WinSpool.Drv as WS_DocumentProperties ;
Integer hWnd, ;
Integer hPrinter, ;
String pDeviceName, ;
Integer pDevModeOutput, ;
Integer pDevModeInput, ;
Integer fMode

Local loDevMode, hWnd, hPrinter, pDeviceName, pDevModeOutput, pDevModeInput, fMode

loDevMode = CreateObject("DEVMODE")

hWnd = 0
hPrinter = 0
pDeviceName = "HP DeskJet 660C"
pDevModeOutput = 0
pDevModeInput = 0
fMode = 0

= WS_OpenPrinter(pDeviceName, @hPrinter, NULL)

lnSizeInBytes = WS_DocumentProperties( ;
hWnd, ;
hPrinter, ;
pDeviceName, ;
pDevModeInput, ;
pDevModeOutput, ;
fMode)

lnPointer = loDevMode.GetPointer( lnSizeInBytes )

fMode = 4
pDevModeOutput = lnPointer

= WS_DocumentProperties( ;
hWnd, ;
hPrinter, ;
pDeviceName, ;
pDevModeInput, ;
pDevModeOutput, ;
fMode)

loDevMode.SetPointer( lnPointer )
loDevMode.FreePointer( lnPointer )

WS_ClosePrinter( m.lnHandle )
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform