Original Post
I''m a newbie on C++ and I''ve got a problem with casting.
My problem is when I want to create A windows in OpenGL context I must Specify the WNDPROC callback procedure to manage the system messages.
So my callback must access the field of a class, so it''s included in my class:
LRESULT CALLBACK MyClass::WndProc(....);
and when I register my window class
wc.lpfnWndProc = (WNDPROC)WndProc;
It occurs a link error (with VC6):
[
error C2440: ''='' : cannot convert from ''long (__stdcall MyClass::*)(struct HWND__ *,unsigned int,unsigned int,long)'' to ''long (__stdcall *)(struct HWND__ *,unsigned int,unsigned int,long)''
There is no context in which this conversion is possible
]
So if I put the Callback as a friend of MyClass the link error is no more, but I cannot access datas from my object instance.
Can someone tell me how to do, and if I wrong to do like that.
Is there a special casting to do?
Thanks For ALL
I''''m 4 & I draw