Article View: borland.public.delphi.nativeapi
Article #187Displaying form/dialog from thread other than application main thread
From: Richard Lang
Date: Fri, 19 Mar 2004 05:08
Date: Fri, 19 Mar 2004 05:08
40 lines
2569 bytes
2569 bytes
Hi all, I'm currently working on a single threaded application that makes extensive use of legacy libraries and 3rd party DLLs for file import/export/conversion, operations that can sometimes take rather a long time. We currently have a 'busy' dialog withn a cute animation, progress bar, status message and cancel button that we show when running a lengthy conversion, however it's user responsiveness is rather poor as it relies on application.ProcessMessage calls from callbacks in the conversion libraries, which are not provided in all libraries and even when available are not always called as often as one would like. I would like to improve the responsiveness of the busy dialog with a multi-threading approach in which the dialog window is created in a seperate thread which then runs a message pump, but understand that this is not straightforward. I've had a good look through this forums archives and understand the "thread-unsafeness" of the VCL heirachy, the mechanics of the Synchronise() method etc. etc. (The conceptually pure concept of shifting the file conversion routines to worker threads is way more work and trouble than it's worth, I'm after a quick and contained fix I can apply to the 'Busy' module.) As I understand it I have two options, I just wanted to bounce the problem off the group in case there was another angle I hadn't considered. 1) Implement my dialog solely with WinAPI calls (no VCL) 2) Wrap my dialog up in a DLL Any other suggestions??? Thanks Richard Lang MAIL: richardDOTlangATtrimbleDOTcoDOTnz
Technical Details
Message-ID:
<6808bdb1.0403182108.3a5f5a80@posting.google.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!postnews2.google.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f94dd,108e0fa542717963,start X-Google-Attributes: gidf94dd,public X-Google-Thread: 1043cf,108e0fa542717963,start X-Google-Attributes: gid1043cf,public X-Google-ArrivalTime: 2004-03-18 21:08:16 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!postnews2.google.com!not-for-mail From: richardlang@my-deja.com (Richard Lang) Newsgroups: borland.public.delphi.nativeapi,borland.public.delphi.objectpascal Subject: Displaying form/dialog from thread other than application main thread Date: 18 Mar 2004 21:08:15 -0800 Organization: http://groups.google.com Lines: 40 Message-ID: <6808bdb1.0403182108.3a5f5a80@posting.google.com> NNTP-Posting-Host: 210.86.12.221 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1079672896 28778 127.0.0.1 (19 Mar 2004 05:08:16 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 19 Mar 2004 05:08:16 +0000 (UTC)