🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: VCL Form inside TThread->Execute

#148
From: James Williams
Date: Mon, 16 Jun 2008 15:40
32 lines
2706 bytes
There lies the problem.  The application that is used to develope the 
database client is not multi thread capable at all.  So the query must 
reside in the main application thread.  Hence the need to have a form 
created in the Thread->Execute method and allow the progress bar to work 
under that thread.

I have gotten it to work fine at the moment, but run into problems when I 
need to create multiple instances of separate threads of this progress bar. 
I think that this particular progress bar control is using a customized 
Timer instead of TTimer.  Hence causing drawing problems once a second 
thread is opened with the same control.  As for the borland VCL controls 
they work fine in these threads, no problems at all.


"danzer" <.> wrote in message news:48567d47$1@newsgroups.borland.com...
> James wrote:
>> I would, except that the application that uses this thread form in not a 
>> C++ Builder application.  In fact, it does not have its own support for 
>> multi-thread, however it does allow dll calls.
>>
>> Hence, I decided to wrap up a form object into a thread and place that 
>> into a dll.  Then they can create an instance and the form runs.  The 
>> reason I need this is because in their main application they may be 
>> executing a lengthy database query.  I wanted to provide a progress bar 
>> that shows that the application has not hung, but is retrieving data. 
>> They also want to use this when they download files, to indicate things 
>> are going well.
>>
>
> Have you considered having the thread do the "length database query" and 
> posting status messages to the main application?  I have used this method 
> and it works quite well. 
Technical Details
Message-ID: <48568b97$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news1.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <4853e32c$1@newsgroups.borland.com> <4853e7cb$1@newsgroups.borland.com> <485403a7@newsgroups.borland.com> <48567d47$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: "James Williams" <Jim_L_Williams@hotmail.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <4853e32c$1@newsgroups.borland.com> <4853e7cb$1@newsgroups.borland.com> <485403a7@newsgroups.borland.com> <48567d47$1@newsgroups.borland.com>
Subject: Re: VCL Form inside TThread->Execute
Date: Mon, 16 Jun 2008 10:40:39 -0500
Lines: 34
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.3790.3959
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.4133
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: 69.44.29.66
Message-ID: <48568b97$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1213631383 69.44.29.66 (16 Jun 2008 08:49:43 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news1.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail