[progress Communities] [progress Openedge Abl] Forum Post: Re: .net Printersettings

  • Thread starter Thread starter Matt Gilarde
  • Start date Start date
Status
Not open for further replies.
M

Matt Gilarde

Guest
I'm not sure what calling SetHdevmode will do in this scenario, but SESSION:PRINTER-CONTROL-HANDLE is a handle to a PRINTDLG structure, not the handle to a DEVMODE structure. The PRINTDLG structure does contain a handle to a DEVMODE structure in the hDevMode member. Here's some (untested) code which gets the hDevMode member of the PRINTDLG struct pointed to by SESSION:PRINTER-CONTROL-HANDLE. This is for 32-bit OpenEdge; 64-bit will require modifications. DEFINE VARIABLE bOK AS LOGICAL. SYSTEM-DIALOG PRINTER-SETUP UPDATE bOK. IF bOK = TRUE THEN DO: DEFINE VARIABLE hDevMode AS INTEGER. DEFINE VARIABLE lpPrintDlg AS INTEGER. DEFINE VARIABLE PrintDlg AS MEMPTR. DEFINE VARIABLE bResult AS INTEGER. RUN GlobalLock(SESSION:PRINTER-CONTROL-HANDLE, OUTPUT lpPrintDlg). SET-POINTER-VALUE(PrintDlg) = lpPrintDlg. hDevMode = GET-LONG(PrintDlg, 9). RUN GlobalUnlock(SESSION:PRINTER-CONTROL-HANDLE, OUTPUT bResult). END. PROCEDURE GlobalLock EXTERNAL "kernel32.dll": DEFINE INPUT PARAMETER hMem AS LONG. DEFINE RETURN PARAMETER hAddr AS LONG. END PROCEDURE. PROCEDURE GlobalUnlock EXTERNAL "kernel32.dll": DEFINE INPUT PARAMETER hMem AS LONG. DEFINE RETURN PARAMETER bResult AS LONG. END PROCEDURE.

Continue reading...
 
Status
Not open for further replies.
Back
Top