Page 1 of 1

DLL CALL SHGetFolderPathA in $WINSYSDIR$shell32.dll

Posted: Fri Aug 07, 2009 6:11 am
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.

Posted: Fri Aug 07, 2009 9:20 am
by MichaelNesmith
Did you try using Get Folder Location instead? Its got a quite extensive list of pre-defined folders, etc.

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

Posted: Fri Aug 06, 2010 11:22 am
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

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

Posted: Fri Aug 06, 2010 7:43 pm
by mills
Alexander,

Are you sure that you are pointing to the DLL properly (full path)?

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

Posted: Fri Aug 06, 2010 11:03 pm
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~