Article View: borland.public.cppbuilder.nativeapi
Article #9471Re: Callback function as method class
From: Sam
Date: Fri, 09 Jul 2004 08:56
Date: Fri, 09 Jul 2004 08:56
32 lines
2027 bytes
2027 bytes
Okey !
But if I use the satic keyword for this function like this:
static LRESULT CALLBACK NewWindowProc(HWND hWnd, UINT msg, WPARAM w, LPARAM
l)
The compiler refused with this error in french:
E2092 La classe de stockage 'classe de stockage' n'est pas autoris�e ici
Translate:
E2092 the class of storage 'stockage class' is not authorized here
Why ?
Sam
"Eelke Klein" <e.klein@mplussoftware.nl> a �crit dans le message de
news:40ee47c8$1@newsgroups.borland.com...
> Sam wrote:
> > I need to drop this callback function as a method of a custom C++ class:
> > LRESULT CALLBACK NewWindowProc(HWND hWnd, UINT msg, WPARAM w, LPARAM l)
> > {
> > ...
> > return CallWindowProc(OldProc, hWnd, msg, w, l);
> > }
> > The compiler refused. It seems that a class can't has a callback as
method,
> > that is right ?
> Yes
>
> Windows callback functions should be normal functions or static member
> functions. Normal member functions won't work because they have an
> additional hidden parameter which is the object on which they are called.
>
> Eelke
Technical Details
Message-ID:
<40ee5da2@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!fr.ip.ndsoftware.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<40ee3b69@newsgroups.borland.com> <40ee47c8$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,68c63a4b5ad1dd83 X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII Reply-To: "Sam" <skneife3@wanadoo.fr> From: "Sam" <skneife3@wanadoo.fr> Newsgroups: borland.public.cppbuilder.nativeapi References: <40ee3b69@newsgroups.borland.com> <40ee47c8$1@newsgroups.borland.com> Subject: Re: Callback function as method class Date: Fri, 9 Jul 2004 10:56:11 +0200 Lines: 34 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: 80.13.245.243 Message-ID: <40ee5da2@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1089363362 80.13.245.243 (9 Jul 2004 01:56:02 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!fr.ip.ndsoftware.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail