Re: [Dev-C++] Subclass inside a class problem
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Brian B. <bcb...@ya...> - 2001-04-09 22:30:39
|
Hi,
Thank you all for this information, it helped greatly.
Respectfully,
Brian
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/
_______________________________________________
Dev-cpp-users mailing list
Dev...@li...
http://lists.sourceforge.net/lists/listinfo/dev-cpp-users
---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system
(http://www.grisoft.com).
Version: 6.0.145 / Virus Database: 69 - Release Date:
5/4/00
__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail.
http://personal.mail.yahoo.com/
|