mirror of
https://github.com/reactos/reactos.git
synced 2024-12-27 09:34:43 +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:
parent
4dc4ec2fe4
commit
c30b284373
1 changed files with 5 additions and 0 deletions
|
@ -373,6 +373,11 @@ public:
|
|||
return m_pszData;
|
||||
}
|
||||
|
||||
void Preallocate(_In_ int nLength)
|
||||
{
|
||||
PrepareWrite(nLength);
|
||||
}
|
||||
|
||||
void ReleaseBufferSetLength(_In_ int nNewLength)
|
||||
{
|
||||
ATLASSERT(nNewLength >= 0);
|
||||
|
|
Loading…
Reference in a new issue