GetSpecialFolder() , how !?

delphi package - easy access to shell apis

GetSpecialFolder() , how !?

Postby 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 :
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

Postby 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 .
Crypt
 
Posts: 3
Joined: Tue Mar 23, 2010 7:44 am

Postby 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: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?
iPath
 
Posts: 25
Joined: Sat Dec 12, 2009 4:48 pm

Postby 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 .
Crypt
 
Posts: 3
Joined: Tue Mar 23, 2010 7:44 am


Return to madShell

Who is online

Users browsing this forum: No registered users and 3 guests