Archived

This topic is now archived and is closed to further replies.

Eber Kain

Putting WndProc into a class?

Recommended Posts

Eber Kain    130
I cant get my program to compile if WndProc is in a class? this line (setting up the window class) wc.lpfnWndProc = WndProc; causes this error C:\Programming\Projects\msvc\OpenGL Helper Library\glh.cpp(151) : error C2440: ''='' : cannot convert from ''long (__stdcall glhs::*)(struct HWND__ *,unsigned int,unsigned int,long)'' to ''long (__stdcall *)(struct HWND__ *,unsigned int,unsigned int,long

Share this post


Link to post
Share on other sites
Guest Anonymous Poster   
Guest Anonymous Poster
Then the wndproc function and the function in your class are different in some way

Someone else will give you a better answer below:

Share this post


Link to post
Share on other sites
Eber Kain    130
well that worked, but now it acts like its not a member of the class.

It gives error on ever member variabe reference


I got a bypass to this problem, but makeing a dummy WndProc functions, and passing all its data to my WndProc class function.

LRESULT CALLBACK WndProc(HWND p_hwn,UINT p_msg,WPARAM p_wparam,LPARAM p_lparam) {
return glh.WProc(p_hwn, p_msg, p_wparam, p_lparam);
}

What sort of overhead would there be in something like this?

Edited by - Eber Kain on December 13, 2001 7:38:47 PM

Share this post


Link to post
Share on other sites