Hi there,
i am using a code but like to understand what is doing the function CoTaskMemFree(first question). It's an OLE32 function which is not listed in the standard win32API ref. Somebody any idea??
And the second question is: why is browse for folder not a common dialog box like GetOpenFileName is this because it's not implemented in kernel but in shell32 or not??? i'm confused a bit:confused:
here is the code snip:
BrowseForFolder proc ParenthWnd:DWORD
mov eax,ParenthWnd
mov BInfo.hwndOwner,eax
mov BInfo.pidlRoot,0
mov BInfo.lpszTitle,offset Text
mov BInfo.ulFlags,BIF_RETURNONLYFSDIRS
mov BInfo.lpfn,0
mov BInfo.lParam,0
mov BInfo.iImage,0
invoke SHBrowseForFolder,ADDR BInfo
.if eax != 0
push eax
invoke SHGetPathFromIDList,eax,ADDR workDir
call CoTaskMemFree
.endif
ret
BrowseForFolder endp
Thanks for the help!!
i am using a code but like to understand what is doing the function CoTaskMemFree(first question). It's an OLE32 function which is not listed in the standard win32API ref. Somebody any idea??
And the second question is: why is browse for folder not a common dialog box like GetOpenFileName is this because it's not implemented in kernel but in shell32 or not??? i'm confused a bit:confused:
here is the code snip:
BrowseForFolder proc ParenthWnd:DWORD
mov eax,ParenthWnd
mov BInfo.hwndOwner,eax
mov BInfo.pidlRoot,0
mov BInfo.lpszTitle,offset Text
mov BInfo.ulFlags,BIF_RETURNONLYFSDIRS
mov BInfo.lpfn,0
mov BInfo.lParam,0
mov BInfo.iImage,0
invoke SHBrowseForFolder,ADDR BInfo
.if eax != 0
push eax
invoke SHGetPathFromIDList,eax,ADDR workDir
call CoTaskMemFree
.endif
ret
BrowseForFolder endp
Thanks for the help!!
I suggest you download the Platform SDK.
The function CoTaskMemFree is explained in the helpfiles.
http://www.microsoft.com/msdownload/platformsdk/sdkupdate/
The function CoTaskMemFree is explained in the helpfiles.
http://www.microsoft.com/msdownload/platformsdk/sdkupdate/
CoTaskMemFree frees memory :) . Normally this is a memory pointer you have got from a previous call to COM/OLE (StringFromIID() for example). Possibly COM/OLE uses its own heap and you dont know the heap id.
BrowseForFolder is implemented by the shell and is no USER stuff. The shell is no core component, windows can work with any app as "shell".
BrowseForFolder is implemented by the shell and is no USER stuff. The shell is no core component, windows can work with any app as "shell".