Member Avatar for Thew

Hi,
I have some problem with my application and I've tried anything possible that is possible for me.
This is the code:

type
  DownloadCategory = class(TThread)
  private
    LibHandle: Thandle;
  protected
    //none
  public
    URL: string;
    procedure Start;
    procedure Stop;
  end;

implementation

procedure DownloadCategory.Start;
var
  GetHTTPResponse: function (url: PChar; var resp: string):boolean; {$IFDEF WIN32} stdcall; {$ENDIF}
begin
  {LibHandle := LoadLibrary('request.dll');
  if LibHandle >= 32 then
  begin
    GetHTTPResponse := GetProcAddress(LibHandle, 'GetHTTPResponse');
    GetHTTPResponse(PChar(URL),response);
    Stop;
  end else begin
    MessageBox(Self.Handle, 'Nepodarilo sa nadviazať kontakt s dynamicky prepojovanou knižnicou request.dll !', 'Chyba prepojenia s knižnicou', MB_ICONERROR);
  end;
end;

procedure DownloadCategory.Stop;
begin
FreeLibrary(LibHandle);
end;

But when I try to execute it:

procedure TForm2.Button1Click(Sender: TObject);
var dc:DownloadCategory;
begin
  if ComboBoxEx1.ItemIndex <> -1 then
  begin
    dc := DownloadCategory.Create(true);
    dc.URL := 'http://dll.xf.cz/list.php';
    dc.Resume;
  end;
end;

I receive exception: EAbstractError 'Abstract Error'.
What went wrong? :icon_cry:

TThread is an abstract class. You must override all purely virtual functions in the descendant class --in this case, you must override the Execute method.

Place the cursor over the word "TThread" and press F1 to read more and find an example.

Hope this helps.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.