A
arychen
Unregistered / Unconfirmed
GUEST, unregistred user!
bool TForm1::InitListColumn(int style)
{
//TODO: Add your source code here
switch(style){
case 0:
{
TListColumn *pcol;
pcol=ListView1->Columns->Add();
pcol->Caption="Num";
pcol->Width=45;
pcol=ListView1->Columns->Add();
pcol->Caption="URL Address...";
pcol->Width=250;
};
break;
case 1:
{
TListColumn *pcol;
pcol=ListView1->Columns->Add();
pcol->Caption="Num";
pcol->Width=38;
pcol=ListView1->Columns->Add();
pcol->Caption="主题";
pcol->Width=150;
pcol=ListView1->Columns->Add();
pcol->Caption="URL...";
pcol->Width=100;
};
break;
};
}
编译出现错误:
[C++ Error] Unit1.cpp(138): E2089 Identifier 'InitListColumn' cannot have a type qualifier
[C++ Error] Unit1.cpp(171): E2139 Declaration missing ;
[C++ Error] Unit1.cpp(171): E2134 Compound statement missing }
[C++ Warning] Unit1.cpp(171): W8070 Function should return a value
不知何缘故?
{
//TODO: Add your source code here
switch(style){
case 0:
{
TListColumn *pcol;
pcol=ListView1->Columns->Add();
pcol->Caption="Num";
pcol->Width=45;
pcol=ListView1->Columns->Add();
pcol->Caption="URL Address...";
pcol->Width=250;
};
break;
case 1:
{
TListColumn *pcol;
pcol=ListView1->Columns->Add();
pcol->Caption="Num";
pcol->Width=38;
pcol=ListView1->Columns->Add();
pcol->Caption="主题";
pcol->Width=150;
pcol=ListView1->Columns->Add();
pcol->Caption="URL...";
pcol->Width=100;
};
break;
};
}
编译出现错误:
[C++ Error] Unit1.cpp(138): E2089 Identifier 'InitListColumn' cannot have a type qualifier
[C++ Error] Unit1.cpp(171): E2139 Declaration missing ;
[C++ Error] Unit1.cpp(171): E2134 Compound statement missing }
[C++ Warning] Unit1.cpp(171): W8070 Function should return a value
不知何缘故?