I’m using ICommandText::GetCommandText method.
According to the MSDN documentation (http://msdn.microsoft.com/en-us/library/ms709825(v=VS.85).aspx) I need to use IMalloc::Free to release the memory allocated for LPOLESTR *ppwszCommand output parameter.
How do I use this interface to do that?
Just pass it to
CoTaskMemFree, it’s wrapping the same default OLE allocatorCoGetMallocis exposing.CoTaskMemAlloc/Freeare convenient shortcuts toIMallocinterface of the default OLE allocator so you can skip the cumbersome interface altogether.