bin seit kurzer Zeit Lazarus Fan und versuche jetzt meine alten Delphi Programme zu portieren.
Lazarus 0.98.2, Fpc 2.2.4, Zielsystem : x86_64-win64
Die Dialoge : PrinterSetupDialog / PrintDialog werden bei Execute nicht angezeigt (keine Fehlermeldung !), nachzuvollziehen mit dem Beispiel "selectprinter" unter ...\lazarus\components\printers\samples\dialogs\, bei Ziel Win_32 funktioniert alles auch unter Vista 64/ Win 7 64. Beim Analysieren ist mir folgendes aufgefallen : die Records tagPD und tagPSD in WinUtilPrn.pas sind als packed record definiert, das scheint bei Ziel BS win_64 so nicht zu funktionieren (ich nehme an, die Funktionspointer müssen auf 64 bit ausgerichtet sein), da ich die Funktionalität dringend brauche, habe mir jetzt so beholfen:
WinUtilPrn.pas :
Code: Alles auswählen
...
TFcntHook = function(Wnd: HWND; uiMsg: UINT; wParam: WPARAM; lParam: LPARAM): UINT_PTR; stdcall;
{$IFDEF CPU64}
// das ist der neue Teil
tagPSD= record
lStructSize : DWORD;
hWndOwner : HWND;
hDevMode : HGLOBAL;
hDevNames : HGLOBAL;
Flags : DWORD;
ptPaperSize : TPOINT;
rtMinMargin : TRECT;
rtMargin : TRECT;
hInstance : HINST;
lCustData : LPARAM;
lpfnPageSetupHook : TFcntHook;
lpfnPagePaintHook : TFcntHook;
lpPageSetupTemplateName : pChar;
hPageSetupTemplate : HGLOBAL;
end;
{$ELSE}
// so ist es im Original
tagPSD= packed record
lStructSize : DWORD;
hWndOwner : HWND;
hDevMode : HGLOBAL;
hDevNames : HGLOBAL;
Flags : DWORD;
ptPaperSize : TPOINT;
rtMinMargin : TRECT;
rtMargin : TRECT;
hInstance : HINST;
lCustData : LPARAM;
lpfnPageSetupHook : TFcntHook;
lpfnPagePaintHook : TFcntHook;
lpPageSetupTemplateName : pChar;
hPageSetupTemplate : HGLOBAL;
end;
{$ENDIF}
{$IFDEF CPU64}
// das ist der neue Teil
tagPD=Record
lStructSize : DWORD;
hWndOwner : HWND;
hDevMode : HGLOBAL;
hDevNames : HGLOBAL;
hDC : HDC;
Flags : DWORD;
nFromPage : Word;
nToPage : Word;
nMinPage : Word;
nMaxPage : Word;
nCopies : Word;
hInstance : HINST;
lCustData : LPARAM;
lpfnPrintHook: TFcntHook;
lpfnSetupHook: TFcntHook;
lpPrintTemplateName: PChar;
lpSetupTemplateName: PChar;
hPrintTemplate : HGLOBAL;
hSetupTemplate : HGLOBAL;
end;
{$ELSE}
// so ist das im Original
tagPD=packed Record
lStructSize : DWORD;
hWndOwner : HWND;
hDevMode : HGLOBAL;
hDevNames : HGLOBAL;
hDC : HDC;
Flags : DWORD;
nFromPage : Word;
nToPage : Word;
nMinPage : Word;
nMaxPage : Word;
nCopies : Word;
hInstance : HINST;
lCustData : LPARAM;
lpfnPrintHook: TFcntHook;
lpfnSetupHook: TFcntHook;
lpPrintTemplateName: PChar;
lpSetupTemplateName: PChar;
hPrintTemplate : HGLOBAL;
hSetupTemplate : HGLOBAL;
end;
{$ENDIF}
...
Lazarus : 0.98.2
FPC : 2.2.4
Ziel BS: x86_64-Win64
BS : Win Vista 64 SP 2, Win 7 64
Gruss Edwin