English
Source / code snippets

directly Print printer Raw Rawdatatoprinter Steuerbefehle

 
sometimes must one Steuerbefehle directly on a printer Send,
so GEHTS:
CompileMarkSeparation
RawDataToPrinter("Druckername","text")
DEF OpenPrinterA(3) !"winspool.drv","OpenPrinterA"
DEF StartDocPrinter(3) !"winspool.drv","StartDocPrinterA"
DEF StartPagePrinter(1) !"winspool.drv","StartPagePrinter"
DEF WritePrinter(4) !"winspool.drv","WritePrinter"
DEF EndPagePrinter(1) !"winspool.drv","EndPagePrinter"
DEF EndDocPrinter(1) !"winspool.drv","EndDocPrinter"
DEF ClosePrinter(1) !"winspool.drv","ClosePrinter"

BOOL RawDataToPrinter( string szPrinterName, string text){

    long lpData=addr(text),dwCount=len(text)
    long hPrinter=globalAlloc(gPTR,4)
    long DocInfo=globalAlloc(gPTR,12)
    long dwJob
    long dwBytesWritten=globalAlloc(gPTR,4)
    string raw="RAW"
    string docname="Druckauftrag"
    long docinfo&,0=addr(docname),0,addr(raw)
    long tmp=globalAlloc(gPTR,128)
    char tmp&,0=szPrinterName
    casenot OpenPrinterA( tmp, hPrinter, 0 ) : return false
    hPrinter=long(hPrinter,0)
    dwJob = StartDocPrinter( hPrinter, 1, DocInfo )
    StartPagePrinter( hPrinter )
    WritePrinter( hPrinter, lpData, dwCount, dwBytesWritten )
    EndPagePrinter( hPrinter );
    EndDocPrinter( hPrinter );
    ClosePrinter( hPrinter );
    return TRUE
nt color=#0000FF>}
 
05/08/15  
 



Achso,

the function are missing yet lauter globalFree's,
everywhere where by globalAlloc memory gotten watts.
 
05/08/15  
 



Zum Quelltext


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

4.980 Views

Untitledvor 0 min.
Uwe Lang06/19/23
RudiB.01/18/22
p.specht11/20/21
Manfred Barei11/19/21
More...

Themeninformationen

this Topic has 1 subscriber:

iF (2x)


Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie