16,471
社区成员
发帖
与我相关
我的任务
分享
if (pTextBox->StrSource == NULL)
{
pTextBox->StrSource = new FE_TCHAR[10];
pTextBox->SourcePoolSize = 10;
ZeroMemory(pTextBox->StrSource, sizeof(FE_TCHAR) * 10);
}
else
{
if (_tcslen(pTextBox->StrSource) + 1 > pTextBox->SourcePoolSize)
{
pTextBox->SourcePoolSize = pTextBox->SourcePoolSize + 50;
FE_TCHAR *old = pTextBox->StrSource;
pTextBox->StrSource = new FE_TCHAR[pTextBox->SourcePoolSize];
ZeroMemory(pTextBox->StrSource, sizeof(FE_TCHAR) * pTextBox->SourcePoolSize);
//memcpy(pTextBox->StrSource, old, sizeof(FE_TCHAR) * (pTextBox->SourcePoolSize - 10));
delete[] old; //出错在这里
}
}