OLE代码编译报错,求解???
BCB6代码如下:
(ex.OleFunction("Cells")).OlePropertySet("Item",(Variant)1,(Variant)(i+1),(Variant)Table1->Fields[i]->FieldName);
在编译时为何会出现下列报错信息
[C++ Error] Unit1.cpp(55): E2288 Pointer to structure required on left side of -> or ->*
求解谢谢..............
[解决办法]
重点是Table1->Fields[i],应该是Table1->Fields->Fields[i]才对。所以,代码改成:
ex.OleFunction("Cells").OlePropertySet("Item", 1, i + 1,
WideString(Table1->Fields->Fields[i]->FieldName));