Y
ynhhr
Unregistered / Unconfirmed
GUEST, unregistred user!
1.我在win98中设计好的界面,拿到win2k server下,组件大小及位置都发生变化,甚至出现组件重叠的现象,怎么处理?
2.我用以下代码来设置纸张大小,但实际打印结果还是用默认的纸张(A4)大小,这是何故?
var
ADevice,ADriver,APort : array[0..255] of Char;
DeviceHandle : THandle ;
DevMode : PDeviceMode ;
begin
Printer.GetPrinter(ADevice,ADriver,APort,DeviceHandle);
if DeviceHandle = 0 then
begin
Printer.PrinterIndex := Printer.PrinterIndex;
Printer.GetPrinter(ADevice,ADriver,APort,DeviceHandle);
end;
if DeviceHandle = 0 then
begin
Raise Exception.Create('无法初始化TDeviceMode结构!');
end
else
begin
DevMode := GlobalLock(DeviceHandle);
end;
DevMode.dmFields := DM_PAPERSIZE or DevMode.dmFields ;
DevMode.dmPaperSize := 0;
DevMode.dmFields := DM_PAPERWIDTH or DevMode.dmFields ;
DevMode.dmPaperWidth := 2579 ;
DevMode.dmFields := DM_PAPERLENGTH or DevMode.dmFields ;
DevMode.dmPaperLength := 1821 ;
{
此处为打印输出语句
}
end;
2.我用以下代码来设置纸张大小,但实际打印结果还是用默认的纸张(A4)大小,这是何故?
var
ADevice,ADriver,APort : array[0..255] of Char;
DeviceHandle : THandle ;
DevMode : PDeviceMode ;
begin
Printer.GetPrinter(ADevice,ADriver,APort,DeviceHandle);
if DeviceHandle = 0 then
begin
Printer.PrinterIndex := Printer.PrinterIndex;
Printer.GetPrinter(ADevice,ADriver,APort,DeviceHandle);
end;
if DeviceHandle = 0 then
begin
Raise Exception.Create('无法初始化TDeviceMode结构!');
end
else
begin
DevMode := GlobalLock(DeviceHandle);
end;
DevMode.dmFields := DM_PAPERSIZE or DevMode.dmFields ;
DevMode.dmPaperSize := 0;
DevMode.dmFields := DM_PAPERWIDTH or DevMode.dmFields ;
DevMode.dmPaperWidth := 2579 ;
DevMode.dmFields := DM_PAPERLENGTH or DevMode.dmFields ;
DevMode.dmPaperLength := 1821 ;
{
此处为打印输出语句
}
end;