mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-08-26 19:33:31 +00:00
[ATL] Implement CSimpleStringT::Preallocate (#6574)
Used in `ATL::CStringW` and `ATL::CStringA`, for example: ``` ATL::CStringW cswItemText = ""; cswItemText.Preallocate(64); SendDlgItemMessageW(pdis->CtlID, LB_GETTEXT, pdis->itemID, reinterpret_cast<LPARAM>(cswItemText.GetBuffer())); cswItemText.ReleaseBuffer(); ``` This public function is used to allocate memory for the string via private PrepareWrite, but it's missing somehow. Now it shouldn't be.
This commit is contained in:
@@ -373,6 +373,11 @@ public:
|
||||
return m_pszData;
|
||||
}
|
||||
|
||||
void Preallocate(_In_ int nLength)
|
||||
{
|
||||
PrepareWrite(nLength);
|
||||
}
|
||||
|
||||
void ReleaseBufferSetLength(_In_ int nNewLength)
|
||||
{
|
||||
ATLASSERT(nNewLength >= 0);
|
||||
|
||||
Reference in New Issue
Block a user