Original Post
I am trying to learn openGL and am trying to learn and use native windows code rather than GLUT handling everything for me. Thus, I thought i'll write a general window wrapper around the openGL stuff, without really mixing the two functionalities. Thus, I made two modules: -myWin -Application For starting, I needed a window in which I could render my openGL stuff. Thus, I tried learning setting up my window in the myWin class. I followed some tutorials online, and have been able to get a basic framework done. "But", there are some bugs which I still dont understand in their entirety and that is what is messing me up :( Following are the errors to which I could not even understand the solutions posted online (found them via searching on the web): 1. I have this as a function member definition in my header file and defined in my code .cpp file. When I try to assign this method to the window : I get an error: I dont understand since the method signature is exactly the same as it expects. After a lot of searching, I found that making WndMsgProc static would solve my problem and the reason for that has got something to do with function pointers wrt classes. I don't understand how that works, but i'd like to know.. Also, if I make it static, I end up making all my other members static since it calls and accesses other members. I am really interested in finding another way of doing this. I think making things static is a bad thing to do and it breaches the OOPs idea. Its like making everything global.. Anyways, I would really appreciate if someone could tell me the right way to do things.. 2. There are more issues, like toggling between unicode and multiset character base, but i want to solve one problem at a time here.
LRESULT myWin::WndMsgProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
wc.lpfnWndProc = (WNDPROC)WndMsgProc;
error C2440: 'type cast' : cannot convert from 'overloaded-function' to 'WNDPROC'
None of the functions with this name in scope match the target type