DLL CALL SHGetFolderPathA in $WINSYSDIR$shell32.dll

Got a problem you cannot solve? Try here.
Post Reply
Alexander
Posts: 1
Joined: Fri Aug 07, 2009 5:57 am

DLL CALL SHGetFolderPathA in $WINSYSDIR$shell32.dll

Post by Alexander »

Hello everybody,

I have a problem to get the path of CSIDL_COMMON_APPDATA
of the function SHGetFolderPathA in $WINSYSDIR$shell32.dll

CSIDL_COMMON_APPDATA has the hex value 0x23, dec 35.

Here is a copy how I call the dll in IA

~InstallAware Clipboard Data~
~Call DLL Function~
~{06A156FA-C585-45D9-9216-0BDEDB8CD315}~
~$WINSYSDIR$shell32.dll,SHGetFolderPathA,"double word",LASTERROR,long,0,long,35,long,0,"double word",0,"pointer to string",$TARGETCOMMONAPPDIR$,$~
~mIDEFunc.dll\\mEXEFunc.dll~

But the variable $TARGETCOMMONAPPDIR$ which should held the result / directory of SHGetFolderPathA, is empty.

MSDN link:
http://msdn.microsoft.com/en-us/library ... S.85).aspx

So what is wrong.

Thanks a lot for your help.
MichaelNesmith
Posts: 3452
Joined: Thu Dec 22, 2005 7:17 pm
Contact:

Post by MichaelNesmith »

Did you try using Get Folder Location instead? Its got a quite extensive list of pre-defined folders, etc.
Michael Nesmith
Install[b]Aware[/b]
[i]Home of The Next Generation MSI Installer[/i]
Get your free copy today - http://www.installaware.com/
figo
Posts: 27
Joined: Thu May 21, 2009 3:06 am
Contact:

Re: DLL CALL SHGetFolderPathA in $WINSYSDIR$shell32.dll

Post by figo »

Hi Michael,
I too am attempting to use this function and was wondering if there solution you provided to Alexander addressed his inquiry?

I keep getting a DLLLOADFAILED when involking both SHGetFolderPath and/or SHGetFolderPathA.

Thanks,

- L
--------

If all else fails, Improvise!

http://www.luiscasillas.com
mills
Posts: 814
Joined: Tue Jul 06, 2010 7:10 pm
Location: Honolulu, HI

Re: DLL CALL SHGetFolderPathA in $WINSYSDIR$shell32.dll

Post by mills »

Alexander,

Are you sure that you are pointing to the DLL properly (full path)?
Andy Mills
InstallAware
Other Help:
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help - Press F1 in the InstallAware IDE.
figo
Posts: 27
Joined: Thu May 21, 2009 3:06 am
Contact:

Re: DLL CALL SHGetFolderPathA in $WINSYSDIR$shell32.dll

Post by figo »

I was able to solve my issue with the following code:

Code: Select all

~InstallAware Clipboard Data~
~Call DLL Function~
~{81809BBC-11B9-4463-9A38-42B300ED2C02}~
~$WINSYSDIR$Shell32.dll,SHGetFolderPath,"double word",FILE_HANDLE,long,NULL,long,35,long,NULL,"double word",SHGFP_TYPE_DEFAULT,"allocated string buffer (MAX_PATH length)",$APPDATA_PATH$,$~
~mIDEFunc.dll\mEXEFunc.dll~
--------

If all else fails, Improvise!

http://www.luiscasillas.com
Post Reply