SysAllocString

sz)
OLECHAR FAR* sz

Allocates a new string and copies the passed string into it. Returns NULL if insufficient memory exists or if NULL is passed in.

Parameter

sz

A zero-terminated string to copy.

Return Value

If successful, points to a BSTR containing the string. If insufficient memory exists or sz was NULL, returns NULL.

Strings created with SysAllocString should be freed with SysFreeString.

Example

inline void CStatBar::SetText(OLECHAR FAR* sz)

{

SysFreeString(m_bstrMsg);

m_bstrMsg = SysAllocString(sz);

}

Software for developers
Delphi Components
.Net Components
Software for Android Developers
More information resources
MegaDetailed.Net
Unix Manual Pages
Delphi Examples