C++生成器TstringGrid从特定单元格获取字符串

C++ builder TstringGrid get string from specific cell

本文关键字:单元格 获取 字符串 TstringGrid C++      更新时间:2023-10-16

大家好,我有 C++ tStringGrid

我想从带有坐标的特定单元格中获取字符串

我试过这个但没有运气:

UnicodeString cell_obj = StringGrid1->Objects[3][2]->ToString();

错误:

Access violation at address 00407617 in module 'NGG_Client.exe'. Read of address 00000000.

请帮忙。

我没有一个可以构建它的工作开发环境,但请尝试:

assert( StringGrid1->ColCount > 3 && StringGrid1->RowCount > 2 );
UnicodeString cell_str = StringGrid1->Cells[3][2];

这可能是一个AnsiString而不是一个UnicodeString