🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Callback mechanics

#5947
From: Bob Gonder
Date: Tue, 21 Jun 2005 21:20
34 lines
2050 bytes
Remy Lebeau (TeamB) wrote:

>"AlexB" <b.a.v@inbox.ru> wrote in message
>
>> What happens while Windows call my callback function?
>
>Nothing.  A callback is merely a function call like any other.
>
>> Does this call look like "interruption" of main (or another my) thread?
>
>No.
>
>> In what context Windows calls my callback function?
>
>In whatever context called the API function that then called the callback.

IOW, is this right Remy?

	EnumWindows(EnumProc, 0);
Your EnumProc is a subroutine of EnumWindows, and belongs to the
thread/process that called EnumWindows.

	DialogBox( hInstance, MAKEINTRESOURCE(Dlg2), 0, DlgProc );
Your DlgProc is a subroutine of DialogBox, and belongs to the
thread/process that called DialogBox.

	wc.lpfnWndProc = MainWndProc;
	CreateWindow();
	while (GetMessage(&msg,0,0,0) )
	{	TranslateMessage(&msg);
		DispatchMessage(&msg);
	}
Your MainWndProc is a subroutine of DispatchMessage, and belongs to
the thread/process that calls it.
Technical Details
Message-ID: <k60hb19l3b2jr36alinqvjlqkqgsrecd3j@4ax.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news2.google.com!newsread.com!newsprint.newsread.com!38.119.100.83.MISMATCH!news-out.nntp.be!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>

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: Tue, 21 Jun 2005 14:20:20 -0700
Organization: MindSpring Enterprises, Inc.
Reply-To: notbg@notmindspring.invalid
Message-ID: <k60hb19l3b2jr36alinqvjlqkqgsrecd3j@4ax.com>
References: <42b7fc1d$1@newsgroups.borland.com> <42b84cd0$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.41.150
X-Trace: newsgroups.borland.com 1119388818 67.77.41.150 (21 Jun 2005 14:20:18 -0700)
Lines: 37
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news2.google.com!newsread.com!newsprint.newsread.com!38.119.100.83.MISMATCH!news-out.nntp.be!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail