控件数组的问题或者是Tlist的问题!!!(本人分实在不多了,给的少,请大家包涵)(20分)

  • 主题发起人 主题发起人 今天能看见山
  • 开始时间 开始时间

今天能看见山

Unregistered / Unconfirmed
GUEST, unregistred user!
程序是这样的:
(TLineSeries*)SeriesList->Items[t]->Title=EngDataModule->SelectADOQuery->FieldByName("年龄")->AsString;
(TLineSeries*)SeriesList->Items[t]->Addy(IntRes[p-5],"入学",clRed);
(TLineSeries*)SeriesList->Items[t]->Addy(IntRes[p-4],"一级",clRed);
(TLineSeries*)SeriesList->Items[t]->Addy(IntRes[p-3],"二级",clRed);
(TLineSeries*)SeriesList->Items[t]->Addy(IntRes[p-2],"三级",clRed);
(TLineSeries*)SeriesList->Items[t++]->Addy(IntRes[p-1],"四级",clRed);
其中:
SeriesList->Add(lineStuSeries1);这个我已经加过了。
那里面的t是一个循环数,刚开始,也就是进行上面的语句的时候,t为0。也就是应该是在调用lineStuSeries1了。可是它给的错误是:
C++ Error] EngUnit.cpp(120): E2288 Pointer to structure required on left side of -> or ->*
[C++ Error] EngUnit.cpp(121): E2288 Pointer to structure required on left side of -> or ->*
[C++ Error] EngUnit.cpp(122): E2288 Pointer to structure required on left side of -> or ->*
[C++ Error] EngUnit.cpp(123): E2288 Pointer to structure required on left side of -> or ->*
[C++ Error] EngUnit.cpp(124): E2288 Pointer to structure required on left side of -> or ->*
[C++ Error] EngUnit.cpp(125): E2288 Pointer to structure required on left side of -> or ->*
是不是Items[]里不能是变量?还是我的控件数组没有弄好?各位帮忙看看。谢谢了!
 
我不知道可以作这样的控间数组吗,你可以试一试把Tag赋值,进行操作
 
将其中的某个“->”后加上"*"试试
以下资料就不定对你有用:
Pointer to Member Operators: .* and ->*
pm-expression :
cast-expression
pm-expression .* cast-expression
pm-expression ->* cast-expression
The binary operator .* combines its first operand, which must be an object of class type, with its second operand, which must be a pointer-to-member type.
The binary operator ->* combines its first operand, which must be a pointer to an object of class type, with its second operand, which must be a pointer-to-member type.
In an expression containing the .* operator, the first operand must be of the class type of the pointer to member specified in the second operand or of a type unambiguously derived from that class.
In an expression containing the ->* operator, the first operand must be of the type "pointer to the class type" of the type specified in the second operand, or it must be of a type unambiguously derived from that class.
Example
The following example calls the member function designated by pMemberFunc for the object pointed to by pObject and passes the parameter of 6:
// Example of the pointer to member operators
(pObject->*pMemberFunc) (6);
 
问题已经解决了
是这样的:
TLineSeries *ls
ls=(TLineSeries*)SeriesList->Items[t]
ls->Add(...)
 
后退
顶部