🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #134

Re: VCL Form inside TThread->Execute

#134
From: Ed Mulroy [TeamB]
Date: Sat, 14 Jun 2008 15:46
41 lines
2325 bytes
For reliability and best performance VCL visuals are best handled in a 
single thread as the VCL does not contain elements to by default handle 
intra-thread issues.  My opinion is that you should post something to the 
main thread for that form.

To get others' opinions post to a group which better relates to the subject 
of your message.  This group might be a good one to post in:
    borland.public.cppbuilder.vcl.components.using

.  Ed

> James L. Williams wrote in message
> news:4853e32c$1@newsgroups.borland.com...
>
> I would like to create a form that exists inside a Thread.  I want this so 
> that the forms graphics updates are handled inside of a thread.
>
> I do something like the following:
>
> Thread::Execute()
> {
>        MSG msg;
>        TmyForm * myForm = new TmyForm(NULL);
>        myForm->Parent = NULL;
>        myForm->ParentWindow = GetDesktopWindow();
>        myForm->Left = 10;
>        myForm->Top = 10;
>        myForm->Width = 500;
>        myForm->Height = 500;
>        myForm->Visible = true;
>        while(GetMessage(msg,NULL,0,0))
>        {
>
>             if(Terminated) break;
>                TranslateMessage(&msg);
>              DispatchMessage(&msg);
>        }
>        delete myForm;
> }
>
> Is this a good way to do it, or is there a better way?
Technical Details
Message-ID: <4853e7cb$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news1.google.com!news.glorb.com!tudelft.nl!txtfeed1.tudelft.nl!newsfeed.straub-nv.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <4853e32c$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,de2c8c187b28c177
X-Google-Attributes: gid10cc67,domainid0,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Ed Mulroy [TeamB]" <dont_email_me@bitbuc.ket>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <4853e32c$1@newsgroups.borland.com>
Subject: Re: VCL Form inside TThread->Execute
Date: Sat, 14 Jun 2008 11:46:19 -0400
Lines: 43
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5512
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: 69.142.0.27
Message-ID: <4853e7cb$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1213458379 69.142.0.27 (14 Jun 2008 08:46:19 -0700)
X-Authenticated-User: edmulroy
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news1.google.com!news.glorb.com!tudelft.nl!txtfeed1.tudelft.nl!newsfeed.straub-nv.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail