VIeditorlover 0 Junior Poster

Hi,

I am bound to use VCF15.ocx and need to set printer programmatically.
According to the help file it can be done via PrintDevMode property,
but there isn't any *working* example available. Any ideas?

Thanks!


PrintDevMode Property

Member of: F1Book, F1BookView

Remarks

The DEVMODE data structure contains information about the device initialization and environment of a printer. This property returns the current values of the DEVMODE structure, makes any necessary changes, and sets PrintDevMode to write out those changes. This property may return NULL if the DEVMODE structure in Formula One has not been initialized.
You can also allocate your own DEVMODE structure and then set PrintDevMode. If you allocate your own structure and pass it to PrintDevMode, Formula One frees its own DEVMODE structure and keeps the one you passed in. You should not refer to this DEVMODE after passing it to PrintDevMode.

Important Never GlobalFree the DEVMODE returned via PrintDevMode.

Example

typedef struct _devicemode {// dvmd

BCHAR dmDeviceName[32];WORD dmSpecVersion;
WORD dmDriverVersion;WORD dmSize;
WORD dmDriverExtra;DWORD dmFields;
short dmOrientation;short dmPaperSize;
short dmPaperLength;short dmPaperWidth;
short dmScale;short dmCopies;
short dmDefaultSource;short dmPrintQuality;
short dmColor;short dmDuplex;
short dmYResolution;short dmTTOption;
short dmCollate;BCHAR dmFormName [32];
DWORD dmLogPixels;DWORD dmBitsPerPel;
DWORD dmPelsWidth;DWORD dmPelsHeight;

DWORD dmDisplayFlags;DWORD dmDisplayFrequency;
} DEVMODE;