🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.pascal.delphi.components.misc
Article #24

TForm inside a TThread

#24
From: Sterling Bates
Date: Fri, 06 Jul 2001 06:38
22 lines
1752 bytes
I'm use several TThreads to spawn instances of the same form multiple times;
ie:

procedure TSpawnFormThread.Execute;
begin
    FreeOnTerminate := true;
    with TMyForm.Create(nil) do
    begin
        ShowModal;
        Release;
    end;
end;

This tends to create interesting errors (window handle no longer valid) on
the Release of the form, and the message "Canvas does not allow drawing"
when activating a form (this primarly caused, it seems, by TRichEdit).

Another poster mentioned that only the main VCL thread properly handles
forms, but need to know if there's an elegant way to work with this.

Note: I *do* need to pop up multiple instances of the same form -- I'm open
to suggestions on other ideas.
Technical Details
Message-ID: <T1d17.12112$E93.2145422@news1.telusplanet.net>
Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!cyclone.bc.net!newsfeed.telusplanet.net!news1.telusplanet.net.POSTED!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 1091e5,4265b72517a20f0e,start
X-Google-Attributes: gid1091e5,public
X-Google-Thread: 109d99,4265b72517a20f0e,start
X-Google-Attributes: gid109d99,public
X-Google-ArrivalTime: 2001-07-05 23:39:53 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!cyclone.bc.net!newsfeed.telusplanet.net!news1.telusplanet.net.POSTED!not-for-mail
From: "Sterling Bates" <noone@nowhere.com>
Newsgroups: comp.lang.pascal.delphi.components.misc,borland.public.delphi.winapi
Subject: TForm inside a TThread
Lines: 24
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2462.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2462.0000
Message-ID: <T1d17.12112$E93.2145422@news1.telusplanet.net>
Date: Fri, 06 Jul 2001 06:38:43 GMT
NNTP-Posting-Host: 161.184.191.228
X-Trace: news1.telusplanet.net 994401523 161.184.191.228 (Fri, 06 Jul 2001 00:38:43 MDT)
NNTP-Posting-Date: Fri, 06 Jul 2001 00:38:43 MDT