The Wxutil.h header file in the Microsoft® DirectShow™ base classes provides helper functions for allocating and freeing task-allocated BSTR strings.
Function | Description |
FreeBSTR | Frees the task-allocated BSTR string. |
WriteBSTR | Creates a task-allocated BSTR string by allocating task-allocated memory and copying a wide string to it. |
Frees a task-allocated BSTR string from memory.
STDAPI FreeBSTR(
BSTR* pstr
);
Returns S_OK if successful, or S_FALSE if pstr is null.
Memory is allocated for passing between objects across interfaces by calling CoTaskMemAlloc. It is freed by calling CoTaskMemFree. You can allocate, pass, and free memory safely between objects created in different programming languages by using a central memory allocator.
Allocates and fills a task-allocated BSTR string.
STDAPI WriteBSTR(
BSTR* pstrDest,
LPCWSTR szSrc
);
Returns an HRESULT value.
Memory is allocated for passing between objects across interfaces by calling CoTaskMemAlloc. It is freed by calling CoTaskMemFree. By using a central memory allocator, memory can be allocated, passed, and freed safely between objects created in different programming languages.
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.