About Printer Information, Specially to Ignacio Vazquez!
From: Sarfraz Bokhari (sarfraz_bokhari_at_yahoo.com)
Date: 10/31/03
- Previous message: Daaron: "Re: New IE Instance"
- Next in thread: Ignacio Vazquez: "Re: About Printer Information, Specially to Ignacio Vazquez!"
- Reply: Ignacio Vazquez: "Re: About Printer Information, Specially to Ignacio Vazquez!"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 31 Oct 2003 05:27:13 +0500
Hi group,
I want to get the printer information using TPrinterInfo2
when I call the API function GetPrinter x is 67 that means 67 bytes are
copied
But when I access any record var of TPrinterInfo2 I get the access
violation.
What I am missing. Keep in mind pointer always pintches me a lot. So, Please
put me an example instead of hind if you can!
Thanks in advance.
S Bokhari
=================================================
Here is my code:
procedure TfmPSetup.Button1Click(Sender: TObject);
var
PInfo: TPrinterInfo2;
x: Word;
begin
WinSpool.GetPrinter(Printer.Handle, 2, @PInfo, SizeOf(PInfo), @x);
// always access violation here, whatever I access the record variable
// I have read in the help that PChar can be typed-cast into string so I
did.
ShowMessage(string(PInfo.pLocation));
end;
=================================================
- Previous message: Daaron: "Re: New IE Instance"
- Next in thread: Ignacio Vazquez: "Re: About Printer Information, Specially to Ignacio Vazquez!"
- Reply: Ignacio Vazquez: "Re: About Printer Information, Specially to Ignacio Vazquez!"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]