P
ppl_72
Unregistered / Unconfirmed
GUEST, unregistred user!
在uses 中已添加了printers,winspool;
procedure TForm25.SetPrinter;
var
Devs: PDevMode;
DevsP: Pointer;
DevSize: integer;
PrinterObject: THandle;
DevName: string;
begin
PrinterObject:= Printer.Handle;
DevName:= TPrinterDev(Printer.Printers.Objects[Printer.PrinterIndex]).Device;
//DevSize:=AdvancedDocumentProperties(0,PrinterObject,PChar(DevName),Devs,Devs,0);
1) DevSize:=AdvancedDocumentProperties(0,PrinterObject,PChar(DevName),Devs,Devs,0);
DevsP:=AllocMem(DevSize);
try
2) do
cumentProperties(0,PrinterObject,Pchar(DevName),DevsP,nil,DM_OUT_BUFFER);
Devs:=DevsP;
Devs^.dmFields:=DM_PAPERSIZE;
Devs^.dmPaperSize:=0;
Devs^.dmPaperLength:= 150;
Devs^.dmPaperWidth:= 100ue;
do
cumentProperties(0,PrinterObject,Pchar(DevName),DevsP,DevsP,DM_OUT_BUFFER or DM_IN_BUFFER);
finally
FreeMem(DevsP,DevSize);
end;
end;
可在编译程序时,出现这样问题:
1)[Error] khdy.pas(82): 不相容类型
2)[Error] khdy.pas(85): 不相容类型: '_devicemodeA'并且 'Pointer'
请各位大虾帮我。谢谢!
procedure TForm25.SetPrinter;
var
Devs: PDevMode;
DevsP: Pointer;
DevSize: integer;
PrinterObject: THandle;
DevName: string;
begin
PrinterObject:= Printer.Handle;
DevName:= TPrinterDev(Printer.Printers.Objects[Printer.PrinterIndex]).Device;
//DevSize:=AdvancedDocumentProperties(0,PrinterObject,PChar(DevName),Devs,Devs,0);
1) DevSize:=AdvancedDocumentProperties(0,PrinterObject,PChar(DevName),Devs,Devs,0);
DevsP:=AllocMem(DevSize);
try
2) do
cumentProperties(0,PrinterObject,Pchar(DevName),DevsP,nil,DM_OUT_BUFFER);
Devs:=DevsP;
Devs^.dmFields:=DM_PAPERSIZE;
Devs^.dmPaperSize:=0;
Devs^.dmPaperLength:= 150;
Devs^.dmPaperWidth:= 100ue;
do
cumentProperties(0,PrinterObject,Pchar(DevName),DevsP,DevsP,DM_OUT_BUFFER or DM_IN_BUFFER);
finally
FreeMem(DevsP,DevSize);
end;
end;
可在编译程序时,出现这样问题:
1)[Error] khdy.pas(82): 不相容类型
2)[Error] khdy.pas(85): 不相容类型: '_devicemodeA'并且 'Pointer'
请各位大虾帮我。谢谢!