Page 1 of 1

GetSpecialFolder() , how !?

Posted: Tue Mar 23, 2010 8:39 am
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?

Posted: Tue Mar 23, 2010 8:54 am
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 .

Posted: Tue Mar 23, 2010 10:57 am
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?

Posted: Tue Mar 23, 2010 10:11 pm
by Crypt
thanks pal, problem solved, yes I'm using the latest version of madcollection supporting delphi 2010 .
best regards .