MCPcopy Create free account
hub / github.com/Squirrel/Squirrel.Windows / AllocSysString

Method AllocSysString

src/Setup/wtl90/atlmisc.h:2082–2094  ·  view source on GitHub ↗

OLE BSTR support (use for OLE automation)

Source from the content-addressed store, hash-verified

2080#ifndef _ATL_NO_COM
2081 // OLE BSTR support (use for OLE automation)
2082 BSTR AllocSysString() const
2083 {
2084#if defined(_UNICODE) || defined(OLE2ANSI)
2085 BSTR bstr = ::SysAllocStringLen(m_pchData, GetData()->nDataLength);
2086#else
2087 int nLen = MultiByteToWideChar(CP_ACP, 0, m_pchData,
2088 GetData()->nDataLength, NULL, NULL);
2089 BSTR bstr = ::SysAllocStringLen(NULL, nLen);
2090 if(bstr != NULL)
2091 MultiByteToWideChar(CP_ACP, 0, m_pchData, GetData()->nDataLength, bstr, nLen);
2092#endif
2093 return bstr;
2094 }
2095
2096 BSTR SetSysString(BSTR* pbstr) const
2097 {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected