[beginner] Help needed with threads + Forms
From: Gerhard Haslberger (ghaslbe_at_gmx.de)
Date: 03/21/04
- Next message: Maarten Wiltink: "Re: [beginner] Help needed with threads + Forms"
- Previous message: David: "Re: MP3-WAV source?"
- Next in thread: Maarten Wiltink: "Re: [beginner] Help needed with threads + Forms"
- Reply: Maarten Wiltink: "Re: [beginner] Help needed with threads + Forms"
- Reply: AlanGLLoyd: "Re: [beginner] Help needed with threads + Forms"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sun, 21 Mar 2004 13:27:48 +0100
hi,
i create a form in my mainprg
Download1 := TDownloadForm.create(Form1);
Download1.show;
Download1.startDownload('a','b');
Download1.close;
Download1.free;
in this form i start a thread in startDownload and startDownload also waits
until the thread is finished.
Problem:
I want to access other methods of TDownloadForm in the "Sycronised(Methods)"
in this threads but how can i call it there?
Download1 does not work bec its only known in the mainprogram...
Can i (and how? (type?) ) give the constructor of the thread a pointer to my
instance of TDownloadForm and then in the "Sycronised(Methods)"
call it via pointer.method_of_downloadform();
Can this work and/or what can i do?
---------------- src-example -------------
TDownloadForm = class(TForm)
...
procedure doinstall;
procedure startDownload(bla...);
...
private
MyClientThread: TMyClientThread;
end;
procedure TDownloadForm.startDownload(in_filename: String; in_outputdir:
String);
begin
MyClientThread :=TMyClientThread.Create(False, Socket,filename);
end;
procedure TMyClientThread.Execute;
begin
...
Synchronize(DisplayMemoryStream);
....
end;
procedure TMyClientThread.DisplayMemoryStream;
begin
HOWCANICALLIT.doinstall;
end;
procedure TDownloadForm.doinstall;
Begin
....
end;
- Next message: Maarten Wiltink: "Re: [beginner] Help needed with threads + Forms"
- Previous message: David: "Re: MP3-WAV source?"
- Next in thread: Maarten Wiltink: "Re: [beginner] Help needed with threads + Forms"
- Reply: Maarten Wiltink: "Re: [beginner] Help needed with threads + Forms"
- Reply: AlanGLLoyd: "Re: [beginner] Help needed with threads + Forms"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]