win32: fix win32dialogs compilation with recent fpc 2.5.1 on win64 platform (based on patch of Cyrax, issue #0019163)

git-svn-id: trunk@30301 -
This commit is contained in:
paul 2011-04-15 13:04:12 +00:00
parent 2eac29c467
commit d9dfb7ca86
2 changed files with 5 additions and 5 deletions

View File

@ -154,7 +154,7 @@ type
{$endif} {$endif}
function OpenFileDialogCallBack(Wnd: HWND; uMsg: UINT; wParam: WPARAM; function OpenFileDialogCallBack(Wnd: HWND; uMsg: UINT; wParam: WPARAM;
lParam: LPARAM): UINT; stdcall; lParam: LPARAM): UINT_PTR; stdcall;
function SaveApplicationState: TApplicationState; function SaveApplicationState: TApplicationState;
procedure RestoreApplicationState(AState: TApplicationState); procedure RestoreApplicationState(AState: TApplicationState);
@ -480,7 +480,7 @@ end;
} }
function OpenFileDialogCallBack(Wnd: HWND; uMsg: UINT; wParam: WPARAM; function OpenFileDialogCallBack(Wnd: HWND; uMsg: UINT; wParam: WPARAM;
lParam: LPARAM): UINT; stdcall; lParam: LPARAM): UINT_PTR; stdcall;
var var
OpenFileNotify: LPOFNOTIFY; OpenFileNotify: LPOFNOTIFY;
OpenFileName: Windows.POPENFILENAME; OpenFileName: Windows.POPENFILENAME;
@ -701,7 +701,7 @@ begin
{$endif} {$endif}
nMaxFile := FileNameBufferLen + 1; // Size in TCHARs nMaxFile := FileNameBufferLen + 1; // Size in TCHARs
lpfnHook := @OpenFileDialogCallBack; lpfnHook := LPOFNHOOKPROC(@OpenFileDialogCallBack);
Flags := GetFlagsFromOptions(AOpenDialog.Options); Flags := GetFlagsFromOptions(AOpenDialog.Options);
New(DialogRec); New(DialogRec);
// new initializes the filename fields, because ansistring and widestring // new initializes the filename fields, because ansistring and widestring

View File

@ -99,7 +99,7 @@ implementation
{$R *.res} {$R *.res}
function OpenPictureDialogCallBack(hWnd: Handle; uMsg: UINT; wParam: WPARAM; function OpenPictureDialogCallBack(hWnd: Handle; uMsg: UINT; wParam: WPARAM;
lParam: LPARAM): UINT; stdcall; lParam: LPARAM): UINT_PTR; stdcall;
var var
OpenFileName: Windows.POPENFILENAME; OpenFileName: Windows.POPENFILENAME;
DialogRec: POpenFileDialogRec; DialogRec: POpenFileDialogRec;
@ -162,7 +162,7 @@ begin
Move(PChar(AnsiString(ResName))^, lpTemplateName^, Length(ResName)); Move(PChar(AnsiString(ResName))^, lpTemplateName^, Length(ResName));
end; end;
Flags := Flags or OFN_ENABLETEMPLATE; Flags := Flags or OFN_ENABLETEMPLATE;
lpfnHook := @OpenPictureDialogCallBack; lpfnHook := LPOFNHOOKPROC(@OpenPictureDialogCallBack);
end; end;
end; end;