ProgressBar for Upload with TIdHTTP

Ok, I'm wanting to have a progress bar as I upload.
I'm trying to use OnWork, BeginOnWork, and EndOnWork.
But I get the errors:
[code][BCC32 Error] Unit1.cpp(71): E2316 '_fastcall TForm1::IdHTTP1Work(TObject *,TWorkMode,const int)' is not a member of 'TForm1'
[BCC32 Error] Unit1.cpp(79): E2316 '_fastcall TForm1::IdHTTP1WorkBegin(TObject *,TWorkMode,const int)' is not a member of 'TForm1'
[BCC32 Error] Unit1.cpp(85): E2316 '_fastcall TForm1::IdHTTP1WorkEnd(TObject *,TWorkMode)' is not a member of 'TForm1'[/code]

Here's my code so far:
[code]void __fastcall TForm1::Button2Click(TObject *Sender)
TIdMultiPartFormDataStream *FormData = new TIdMultiPartFormDataStream;
TStringStream *Response = new TStringStream("");

if(OpenDialog1->Execute()) {
try {
FormData->AddFile("userfile", OpenDialog1->FileName, GetMIMETypeFromFile(OpenDialog1->FileName));
FormData->AddFormField("upload", "Uploading...");
Form1->IdHTTP1->Request->Referer = "";
Form1->IdHTTP1->Post("", FormData, Response);
Form1->Memo1->Text = Response->DataString;
delete FormData;
delete Response;


void __fastcall TForm1::IdHTTP1Work(TObject *Sender, TWorkMode AWorkMode,
const int AWorkCount)

void __fastcall TForm1::IdHTTP1WorkBegin(TObject *Sender,
TWorkMode AWorkMode, const int AWorkCountMax)
ProgressBar1->Max= AWorkCountMax;
void __fastcall TForm1::IdHTTP1WorkEnd(TObject *Sender,
TWorkMode AWorkMode)
Thank You.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!