Allocates a text buffer and fills it with the value of the Text property.
virtual char * __fastcall GetText(void);
Description
Call GetText to obtain a dynamically allocated character buffer containing all of the strings in the list. Individual strings are separated by a carriage return and line feed. The caller is responsible for freeing the returned value using the StrDispose procedure.
This example uses an edit control and a button on a form. When the button is clicked, memory is allocated for a copy of the text in the edit control, the text is displayed in a message box, and then the memory is deallocated.
void __fastcall TForm1::Button1Click(TObject *Sender)
{
// Allocate memory.
char* psz = StrNew(Edit1->Text.c_str());
Application->MessageBox(psz, "StrNew, StrDispose Example", MB_OK);
// Deallocate memory.
StrDispose(psz);
}