🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Callback mechanics

#5959
From: Bob Gonder
Date: Wed, 22 Jun 2005 14:19
30 lines
2388 bytes
Remy Lebeau (TeamB) wrote:

>"Belongs" is not the best term to use. 

It was the best I could come up with. The callback is bound to the
function for the duration of the function. It is not an exclusive
binding (others may also bind to it), but it cannot be replaced during
the execution of the function (there might be some exceptions, but
that would be dirty code wouldn't it?).

>> Your MainWndProc is a subroutine of DispatchMessage,
>> and belongs to the thread/process that calls it.
>
>See above.  In the case of a window procedure, it is always called by the
>thread that creates the window.  DispatchMessage() is not the only way that
>a window procedure gets called.  SendMessage() can call a window procedure
>directly.

Doesn't sound like it..Sounds more like it places a message in the
original thead's queue, and the original thread's DispatchMessage
calls the callback. Otherwise, the original thead could be doing 2
things at the same time.
Doesn't SendMessage have to wait it's turn just like all the other
messages?

>  If SendMessage() is called from a different thread, Windows
>switches to the thread that owns the window and then that thread calls the
>window procedure.

So the owner thead calls it through DispatchMessage?
Technical Details
Message-ID: <vcrib197a9l8hpe8flhmrf2b8ae0m5mdu9@4ax.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.maxwell.syr.edu!feed5.newsreader.com!newsreader.com!news-out.newsgroups.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail
References: <42b7fc1d$1@newsgroups.borland.com> <42b84cd0$1@newsgroups.borland.com> <k60hb19l3b2jr36alinqvjlqkqgsrecd3j@4ax.com> <42b903e1$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,bcabb6910c82b605
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: Bob Gonder <notbg@notmindspring.invalid>
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Re: Callback mechanics
Date: Wed, 22 Jun 2005 07:19:18 -0700
Organization: MindSpring Enterprises, Inc.
Reply-To: notbg@notmindspring.invalid
Message-ID: <vcrib197a9l8hpe8flhmrf2b8ae0m5mdu9@4ax.com>
References: <42b7fc1d$1@newsgroups.borland.com> <42b84cd0$1@newsgroups.borland.com> <k60hb19l3b2jr36alinqvjlqkqgsrecd3j@4ax.com> <42b903e1$1@newsgroups.borland.com>
X-Newsreader: Forte Agent 1.93/32.576 English (American)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 67.77.146.41
X-Trace: newsgroups.borland.com 1119449956 67.77.146.41 (22 Jun 2005 07:19:16 -0700)
Lines: 33
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.maxwell.syr.edu!feed5.newsreader.com!newsreader.com!news-out.newsgroups.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail