怎么给动态生成的IdHTTP控件挂上事件
比如
void __fastcall TForm1::IdHTTP1WorkBegin(TObject *ASender,
TWorkMode AWorkMode, __int64 AWorkCountMax)
{
}
//---------------------------------------
void __fastcall TForm1::IdHTTP1Work(TObject *ASender, TWorkMode AWorkMode,
__int64 AWorkCount)
{
}
//---------------------------------------
void __fastcall TForm1::IdHTTP1WorkEnd(TObject *ASender,
TWorkMode AWorkMode)
{
}
这三个事件
[解决办法]
void __fastcall TForm1::CreateIdHTTP(){ TIdHTTP *http = new TIdHTTP(this); http->OnWorkBegin = IdHTTP1WorkBegin; http->OnWork = IdHTTP1Work; http->OnWorkEnd = IdHTTP1WorkEnd; }
[解决办法]
南果梨给的代码就是纯代码生成的啊,IdHTTP1WorkBegin、IdHTTP1Work这类事件代码也可以自己写的,不用非得放上IdHTTP控件才有。
[解决办法]