Re: [Dev-C++] Subclass inside a class problem
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Michael P. <mdp...@ya...> - 2001-04-07 03:23:27
|
You are not wrong Elias. All Callback functions must
be static. The windows calling procedure does not know
about the implicit 'this' pointer that is passed to
every non-static class member function. With out the
'this' pointer, the appropriate instance of the class
can not be called.
Static functions do not have a this pointer and are
unaware of a specific class instance. You must always
find a way to pass or store a pointer to your class if
you need it when a callback is fired.
--- Elias Pschernig <eli...@ao...> wrote:
> ...
> >
> > class akorichedit{
> > private:
> > //...
> > WNDPROC wpOrigRichEditProc;
> > LRESULT CALLBACK RichEditSubclassProc(HWND hwnd,
> UINT
> > uMsg, WPARAM wParam, LPARAM lParam);
> > //...
> > public:
> > void create();
> > //...
> > };
> >
> ...
>
> I think callback functions have to be static. (I
> remember reading
> something about this in one of the microsoft
> examples - but maybe i'm
> wrong)
>
> Elias Pschernig
>
>
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
>
http://lists.sourceforge.net/lists/listinfo/dev-cpp-users
__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail.
http://personal.mail.yahoo.com/
|