GetPrinterA,SetPrinterA

forum.sourcecode (2000-2005) & forum.td.sourcecode (2005-2010)
Marc

GetPrinterA,SetPrinterA

Post by Marc » 16 Aug 2006, 08:59

 Posted by:  Marc 

Hallo,

Are the Parameters of the functions GetPrinterA and SetPrinterA correct?

Function: GetPrinterA
Description:
Export Ordinal: 0
Returns
Boolean: BOOL
Parameters
Number: HANDLE
Number: DWORD
String: LPVOID
Number: DWORD
Receive Number: LPDWORD

Function: SetPrinterA
Description:
Export Ordinal: 0
Returns
Boolean: BOOL
Parameters
Number: HANDLE
Number: DWORD
String: LPCSTR
String: LPVOID

Jeff Luther
Site Admin
Site Admin
United States of America
Posts: 2385
Joined: 04 Mar 2017, 18:34
Location: Palm Springs, California

Re: GetPrinterA,SetPrinterA

Post by Jeff Luther » 16 Aug 2006, 18:14

 Posted by:  Jeff Luther 

I have a link on my 'gupta' page, shown below, that has a SALExtension.zip
link for downloading. That's (to me, anyway) a kind of cross-reference to
most of the Win. API functions, constant declarations, etc. I'd suggest
downloading that for future reference.

In the meantime, your Getxxx() below is what's in the SalExt. code. SetPrinterA(),
however, is different there to some minor extent:
Function: SetPrinterA
Description:
Export Ordinal: 0
Returns
Boolean: BOOL
Parameters
Number: HANDLE
! Printerhandle
Number: DWORD
! Level
Number: LPVOID
! nAddrBuffer
Number: DWORD

and MSDN: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/prntspol_13ua.asp
has SetPrinter() as:
BOOL SetPrinter(
HANDLE hPrinter, // handle to printer object
DWORD Level, // information level
LPBYTE pPrinter, // printer data buffer
DWORD Command // printer-state command
);

TD doesn't have LPBYTE, so LPVOID is likely correct in the SALExt's declaration.

Best Regards,
Jeff Luther/PC Design
info: www.pulpcards.com/gupta/

Marc

Re: GetPrinterA,SetPrinterA

Post by Marc » 25 Aug 2006, 08:03

 Posted by:  Marc 

I now what you mean.

The nNbCopies is declared only for test. In the later Version i will define
nNbCopies as an Parameter.

The SetPrinterA Function do not write back the changed Devmode. When i
review the attitudes of Printersettings, the amount of the copies is not
changed. I want to print of each Program. The pressure edition must contain
then the desired number of copies.

Marc

Re: GetPrinterA,SetPrinterA

Post by Marc » 25 Aug 2006, 10:35

 Posted by:  Marc 

Hallo

I found the problem.

Now the procedure works fine.

Once again thank you very much for your aid.

Best Regards,
Marc

You do not have the required permissions to view the files attached to this post.

Return to “td.sourcecode”

Who is online

Users browsing this forum: [Ahrefs] and 0 guests