Hi everybody,
I had a question, and I guess it is about conversions too. I'm building a class that handles my own GUI, and now I want it to handle the messages posted to the window it belongs to. So I thought I could subclass it. But I can't set the windowproc of the window to a member of the class, I keep getting a conversion error:
c:\program files\visual studio\vc6\projecten\gui test\guiclass.cpp(40) : error C2440: 'type cast' : cannot convert from 'long (__cdecl ClsGUI::*)(struct HWND__ *,unsigned int,unsigned int,long)' to 'long'
Conversion is a valid standard conversion, which can be performed implicitly or by use of static_cast, C-style cast or function-style cast
with the code
SetWindowLong(hWnd, GWL_WNDPROC, (long)windowProc);
where windowProc is a member of the GUI class.
Is there a way to do this? Or is it impossible, because of the way classes work? The members have addresses don't they? Then why can't I pass it to the function? Or am I mistaking and don't classes work this way?
And should I use a class for this type of thing? I guess I'm sort of remaking the Windows API, but I wanted to keep it simple and encapsule it in a class. Should I forget about the class and just use functions? (I guess you won't need more than one instance of the GUI class anyway...)
and BTW should I restrict the maximum frames per second?
Joren



LinkBack URL
About LinkBacks


