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.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


BrowseForFolder endp

Thanks for the help!!
Posted on 2002-05-21 09:14:47 by eisodur
I suggest you download the Platform SDK.
The function CoTaskMemFree is explained in the helpfiles.

Posted on 2002-05-21 10:47:24 by Jurgen
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".
Posted on 2002-05-21 14:50:29 by japheth