BSTR SysAllocString(
OLECHAR FAR* sz
);
Allocates a new string and copies the passed string into it. Returns Null if there is insufficient memory, and if Null, Null is passed in.
If successful, points to a BSTR containing the string. If insufficient memory exists or sz was Null, returns Null.
You can free strings created with SysAllocString using SysFreeString.
inline void CStatBar::SetText(OLECHAR FAR* sz)
{
SysFreeString(m_bstrMsg);
m_bstrMsg = SysAllocString(sz);
}
Windows NT: Use version 3.1 and later.
Windows: Use Windows 95 and later.
Header: Declared in oleauto.h.
Import Library: Link with oleaut32.lib.