Zitat von
S - tefano:
BlueStarHH: Hm. Wirklich komisch ^^
Wie sieht denn GetPrinter in Dialogs.pas bei Dir aus? Hab grob die gleiche Konfiguration (D2009 und XP)..
So sieht GetPrinter bei mir aus (OK mit D2009 unter XP):
Delphi-Quellcode:
var
Device, Driver, Port: array[0..1023] of char;
DevNames: PDevNames;
Offset: PChar;
begin
Printer.GetPrinter(Device, Driver, Port, DeviceMode);
if DeviceMode <> 0 then
begin
DeviceNames := GlobalAlloc(GHND, SizeOf(TDevNames) +
(StrLen(Device) + StrLen(Driver) + StrLen(Port) + 3) * SizeOf(Char));
DevNames := PDevNames(GlobalLock(DeviceNames));
try
Offset := PChar(PByte(DevNames) + SizeOf(TDevnames));
with DevNames^ do
begin
wDriverOffset := Offset - PChar(DevNames);
Offset := StrECopy(Offset, Driver) + 1;
wDeviceOffset := Offset - PChar(DevNames);
Offset := StrECopy(Offset, Device) + 1;
wOutputOffset := Offset - PChar(DevNames);;
StrCopy(Offset, Port);
end;
finally
GlobalUnlock(DeviceNames);
end;
end;
end;