I've been reading through past postings regarding the
Common Dialog printer set-up.
I've added the following code to my app:
so far, so good. This creates the printer dialog and appears to
work just fine.
Later, I've added:
The message box indicates that szTemp is garbage (approx 3 chars).
CreateDC returns 0.
Is there something obvious that I'm missing?
Help!
------------------
Bernard Ertl
Common Dialog printer set-up.
I've added the following code to my app:
Code:
GLOBAL pd AS PRINTDLGAPI ... pd.lStructSize = LEN(PRINTDLGAPI) pd.Flags = %PD_HIDEPRINTTOFILE OR %PD_NOPAGENUMS OR %PD_NOSELECTION OR %PD_USEDEVMODECOPIESANDCOLLATE PrintDlg pd ...
work just fine.
Later, I've added:
Code:
LOCAL szTemp AS ASCIIZ * 260 LOCAL ptrDM AS DEVMODE PTR ... IF pd.hDevMode THEN ptrDM = pd.hDevMode szTemp = @ptrDM.dmDeviceName PrintFmt.hDCPrinter = CreateDC( "", szTemp, "", BYVAL pd.hDevMode ) MSGBOX "hDC="+STR$( PrintFmt.hDCPrinter)+", szTemp = " + szTemp END IF ' <Farpoint Spread SSPrint call> IF pd.hDevMode THEN GlobalFree pd.hDevMode GlobalFree pd.hDevNames DeleteDC PrintFmt.hDCPrinter END IF
CreateDC returns 0.
Is there something obvious that I'm missing?
Help!
------------------
Bernard Ertl
Comment