🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Simulate Synchronize()

#5180
From: Remy Lebeau (TeamB)
Date: Fri, 30 Sep 2005 17:35
24 lines
1929 bytes
"tinyabs" <nospam@me.com> wrote in message
news:433d6e38$1@newsgroups.borland.com...

> How to I achieve effect of calling Synchronize() of TThread
> class without using TThread class?

In BCB v5 and earlier, TThread creates a window in the main thread, and then
Synchronize() sends a message to that window via SendMessage().  TThread has
a member that stores the specified class method so that when the message is
received by the window in the main thread, the class method can then be
called.

In BCB v6, TThread no longer does any of that.  Now, TThread uses a global
list of method pointers instead.  Synchronize() adds the specified class
method to that list, along with a Win32 API event object (ala
CreateEvent()).  Then a message is posted to the main thread via
PostMessage().  After Synchronize() puts a method into the list, it waits
for the event object to be signaled.  When the main thread is idle, or the
Synchronize() message is received, the main thread runs through the list,
calling all of the stored methods and signalling their events.


Gambit
Technical Details
Message-ID: <433d773b$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!solnet.ch!solnet.ch!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <433d6e38$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,70c83516558f2780
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <433d6e38$1@newsgroups.borland.com>
Subject: Re: Simulate Synchronize() 
Date: Fri, 30 Sep 2005 10:35:22 -0700
Lines: 27
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1409
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
NNTP-Posting-Host: 68.69.17.41
Message-ID: <433d773b$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1128101691 68.69.17.41 (30 Sep 2005 10:34:51 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!solnet.ch!solnet.ch!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail