I have some existing Pascal Windows code I'm trying to port for Linux and am getting multiple errors:
function TMainForm.BrowseForFolder(var Path: string): Boolean;
var
BI: TBrowseInfo;
p: PItemIDList;
s, t: string;
const
BIF_NONEWFOLDERBUTTON = $00000200;
begin
Result := False;
ZeroMemory(@BI,SizeOf(BI));
SetLength(t,MAX_PATH);
with BI do begin
hwndOwner := Handle;
pidlRoot := nil;
pszDisplayName := PChar(t);
lpszTitle := PChar(S_SelectPathToExplore);
ulFlags := BIF_NEWDIALOGSTYLE or BIF_NONEWFOLDERBUTTON or BIF_RETURNONLYFSDIRS or BIF_VALIDATE;
end;
p := SHBrowseForFolder(BI);
if Assigned(p) then
try
SetLength(s, MAX_PATH);
if SHGetPathFromIDList(p, PChar(s)) then begin
Result := True;
Path := PChar(s);
end;
finally
CoTaskMemFree(p);
end;
end;
MainFormUnit.pas(2152,7) Error: Identifier not found "TBrowseInfo"
MainFormUnit.pas(2153,6) Error: Identifier not found "PItemIDList"
MainFormUnit.pas(2159,3) Error: Identifier not found "ZeroMemory"
MainFormUnit.pas(2162,5) Error: Identifier not found "hwndOwner"
MainFormUnit.pas(2163,5) Error: Identifier not found "pidlRoot"
MainFormUnit.pas(2164,5) Error: Identifier not found "pszDisplayName"
MainFormUnit.pas(2165,5) Error: Identifier not found "lpszTitle"
MainFormUnit.pas(2166,5) Error: Identifier not found "ulFlags"
MainFormUnit.pas(2166,16) Error: Identifier not found "BIF_NEWDIALOGSTYLE"
MainFormUnit.pas(2166,63) Error: Identifier not found "BIF_RETURNONLYFSDIRS"
MainFormUnit.pas(2166,87) Error: Identifier not found "BIF_VALIDATE"
MainFormUnit.pas(2168,8) Error: Identifier not found "SHBrowseForFolder"
Am I missing a package or unit that handles this?
Units I have are:
uses
LCLIntf, LCLType, LMessages, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, IniFiles, StdCtrls, Grids, ComCtrls, Types,
ExtCtrls, Buttons, Organ, ToolWin, Menus, VirtualTrees, ImgList,
FakeActiveX, CheckLst, ObjectMatrixFrameUnit,
Themes,
{project units}
WoodFormUnit, ScanFormUnit, ExportFormUnit,
WarningFormUnit, ConfigurationFormUnit, SplashFormUnit;