Seite 1 von 2
LPRINT Library in's Programm einbinden ?
Verfasst: 03.12.2004 14:22
von arcus
hallo Leute,
ich bin ziemlicher Neuling mit PureBasic und versuche, direkt Rohdaten in den Drucker, besser gesagt in den Druckerspooler zu schreiben, also nicht ins Grafikobjekt Drucker reinzumalen sondern exakt das in den Spooler zu schreiben, was auch am Drucker ankommen soll. Dazu brauche ich glaub' ich LPRINT ? Aber ich raff irgendwie überhaupt nicht das System, wie ich diese Lib in meinen Quellcode einbinde bzw. die Funktionen der Lib nutze. Er sagt immer
LPRINT_GetDefaultPrinter () is not a function, an array or a linked list...
Ich hab das Prinzip noch nicht begriffen. Bei PowerBasic gab es $Include-Befehle zum Einbinden.
Bitte helft mir !

Verfasst: 03.12.2004 15:06
von nicolaus
geh doch mal zu
PureArea.net und such dort mal im CodeArchiv da wirst du sicher was finden was dir weiter hilft.
Verfasst: 03.12.2004 15:29
von Falko
Eine Frage,
welche Lib benutzt du dazu um dies Funktion "LPRINT_GetDefaultPrinter ()" anwenden zu wollen?
Diese Lib müsste eigendlich in's userlibrary-Verzeichnis von PB kopiert
werden und die Funktion wird dann direkt als BasicBefehl ausgeführt.
Es sei denn, der Funktionsname hat einen Schreibfehler etc.
Gruss Falko
Verfasst: 03.12.2004 15:48
von arcus
habe diese Lib gefunden:
http://purebasic.new.myforums.net/viewtopic.php?t=12537
ich habe sie in das Verzeichnis
\Programme\PureBasic\PureLibraries\UserLibraries
kopiert. Geht aber nicht...

Verfasst: 03.12.2004 16:18
von Falko
PureLPRINT purebasic library
LPRINT_OpenPrinter(PrinterName.s)
LPRINT_ClosePrinter()
LPRINT_StartDoc(JobName.s)
LPRINT_EndDoc()
LPRINT_Print(Text.s)
LPRINT_PrintN(Text.s)
LPRINT_NewPage()
LPRINT_GetDefaultPrinter()
LPRINT_GetInstalledPrinters()
by Gnozal [
gnozal@freenet.de]
Also bei mir funktioniert diese Lib auch nicht und diese wurde wohl nicht unter XP getestet. Kann sein, das die LIB mit den API-Funktionen für die
win.ini arbeitet. Am besten mal den Proger
gnozal@freenet.de
direkt anfragen.
MfG Falko
Verfasst: 04.12.2004 13:05
von gnozal
I am not at home right now but I think I use this code :
Code: Alles auswählen
Procedure.s GetDefaultPrinter()
STDPrinterName$ = Space(260)
ImprimanteParDefaut.s = ""
If GetPrivateProfileString_("WINDOWS","DEVICE","", @STDPrinterName$, 260, "Win.Ini")
ImprimanteParDefaut = StringField(STDPrinterName$, 1,",")
EndIf
ProcedureReturn ImprimanteParDefaut
EndProcedure
Works for me with Win98 and NT4 (I don't have WinXP).
Verfasst: 04.12.2004 21:09
von Falko
gnozal hat geschrieben:I am not at home right now but I think I use this code :
Code: Alles auswählen
Procedure.s GetDefaultPrinter()
STDPrinterName$ = Space(260)
ImprimanteParDefaut.s = ""
If GetPrivateProfileString_("WINDOWS","DEVICE","", @STDPrinterName$, 260, "Win.Ini")
ImprimanteParDefaut = StringField(STDPrinterName$, 1,",")
EndIf
ProcedureReturn ImprimanteParDefaut
EndProcedure
Works for me with Win98 and NT4 (I don't have WinXP).
@gnozal
Your (this) sorce is going on WinXP
Have you more sources (Procedures) from your PrintLib?
Thanks from german
Falko
Verfasst: 06.12.2004 12:15
von gnozal
If this works with XP, then the same function from the LIB [LPRINT_GetDefaultPrinter()] should work too ! What's the problem with the lib ? I use it with 98 and NT and it works well.
The error 'LPRINT_GetDefaultPrinter () is not a function, an array or a linked list..' means the lib is not correctly installed.
Verfasst: 06.12.2004 16:39
von Falko
@gnozal
Sorry, this my error. I would printing to a 'Data Becker' PDF-Printer.
The Lib make an error.
Just i've installed my Epson Stylus Colour over usb, your lib is ok.
I see the spool in the task for each time, but your testcode dosen't
printing it.
Falko
Verfasst: 06.12.2004 17:08
von gnozal
@Falko : I don't understand
Just i've installed my Epson Stylus Colour over usb, your lib is ok.
--> It works ?
I see the spool in the task for each time, but your testcode dosen't
printing it.
--> It don't work ?
Please keep in mind that the lib don't work with GDI only and/or Postscript printers. It should work with PCL or EPSON compatible printers (eg. DOS compatible). I have only tested it with HP and OKI printers and with Win98 / NT4.
PS : in the test code, there is a LPRINT instruction wich works only with PCL compatible printers ("LPRINT_Print(Chr(27) + "E")