GetSpecialFolder() , how !?

delphi package - easy access to shell apis
Post Reply
Crypt
Posts: 3
Joined: Tue Mar 23, 2010 7:44 am

GetSpecialFolder() , how !?

Post by Crypt »

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 :

Code: Select all

GetSpecialFolder(sfProgramFiles)
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 »

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 »

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:ANSIstring;
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 »

thanks pal, problem solved, yes I'm using the latest version of madcollection supporting delphi 2010 .
best regards .
Post Reply