Frees a block of task memory previously allocated through a call to the CoTaskMemAlloc or CoTaskMemRealloc function.
void CoTaskMemFree( __in_opt LPVOID pv );
A pointer to the memory block to be freed. If this parameter is NULL, the function has no effect.
The CoTaskMemFree function uses the default OLE allocator.
The number of bytes freed equals the number of bytes that were originally allocated or reallocated. After the call, the memory block pointed to by pv is invalid and can no longer be used.
Send comments about this topic to Microsoft
Build date: 10/22/2009
<DllImport("ole32.dll")> _ Public Shared Sub CoTaskMemFree(ByVal ptr As IntPtr) End Sub
[DllImport("ole32.dll")] public static extern void CoTaskMemFree(IntPtr ptr);