Programming Tips - Win32: Replace SHGetMalloc()

Date: 2023jun8 Language: C/C++ OS: Windows Q. Win32: Replace SHGetMalloc() A. You don't have to use SHGetMalloc() any more. Use CoTaskMemFree() instead. For example, old code:
LPMALLOC pMalloc = NULL; SHGetMalloc(&pMalloc); if (pMalloc) { pMalloc->Free(pidl); pMalloc->Release(); }
Can be replaced with just:
CoTaskMemFree(pidl);
This is simpler and less error prone.