Главная страница | назад





Article #16455: Getting bin names from your printer

 Question and Answer Database

FAQ1455D.txt - Getting bin names from your printer

Category   :Printing
Platform   :All-32Bit
Product    :

Question:
How do I retrieve the bin names of all bins for a particular 
printer using DeviceCapabilities?


Answer:
Here's a very simple app to do this. Just start a brand new
project in Delphi and drop down a TButton and a TMemo. Then 
double click the button and paste this code snippet over the 
corresponding code in the implementation of Unit1.

uses
  WinSpool;

const
  PName = 'DELPHI III';
  PPort = '\\CONAN\DELPHI_III';

procedure TForm1.Button1Click(Sender: TObject);
var
  i : Integer;
  p : PChar;
begin
  GetMem(p,24*DeviceCapabilities(PName,PPort,DC_BINNAMES,nil,nil));
  with Memo1, Lines do begin
    Clear;
    for i:=1 to DeviceCapabilities(PName,PPort,DC_BINNAMES,p,nil) do
      Add(p+24*(i-1));
  end;
  FreeMem(p);
end;


4/2/99 11:23:40 AM
 

Last Modified: 01-SEP-99