delphi package - easy access to shell apis
Crypt
Posts: 3 Joined: Tue Mar 23, 2010 7:44 am
Post
by Crypt » Tue Mar 23, 2010 8:39 am
Hey there
I have been using GetSpecialFolder from madshell unit,
I looked at the source examples provided with madcollection documentation.
don't know what's the problem .
here's the log :
Code: Select all
[DCC Error] Unit1.pas(30): E2035 Not enough actual parameters
don't know how to define the second parameter .
also here's the example provided in documentation :
and here's my code :
Code: Select all
procedure TForm1.Button1Click(Sender: TObject);
var
prg:String;
begin
prg:= GetSpecialFolder(sfProgramFiles) ;
end;
end.
Could anyone help?
Crypt
Posts: 3 Joined: Tue Mar 23, 2010 7:44 am
Post
by Crypt » Tue Mar 23, 2010 8:54 am
I have been tested it with delphi version 7.0 with success, but the issue is still around delphi 2010 with the following code that is working fine with delphi 7.0 :
Code: Select all
var
s:string;
begin
GetSpecialFolder(sfProgramFiles,s) ;
ShowMessage('program files is located at :'+s);
end;
the error is the same with the above post .
iPath
Posts: 25 Joined: Sat Dec 12, 2009 4:48 pm
Post
by iPath » Tue Mar 23, 2010 10:57 am
Crypt wrote: I have been tested it with delphi version 7.0 with success, but the issue is still around delphi 2010 with the following code that is working fine with delphi 7.0 :
Code: Select all
var
s:string;
begin
GetSpecialFolder(sfProgramFiles,s) ;
ShowMessage('program files is located at :'+s);
end;
the error is the same with the above post .
I think as of madShell version 1.3q GetSpecialFolder is declared this way:
function GetSpecialFolder(sf: TSpecialFolder; out path: AnsiString) : boolean;
So in both Delphi 7 and Delphi 2010 you must use it like this:
var
s:
ANSI string;
begin
GetSpecialFolder(sfProgramFiles,s) ;
ShowMessage('program files is located at :'+string(s));
end;
It works for me
p.s. Are you sure you use latest MadCollection 2x/3x?
Crypt
Posts: 3 Joined: Tue Mar 23, 2010 7:44 am
Post
by Crypt » Tue Mar 23, 2010 10:11 pm
thanks pal, problem solved, yes I'm using the latest version of madcollection supporting delphi 2010 .
best regards .