Bonjour,
Dans un de mes programmes (OpenGL) que j'ai recupere sur le net, il est fait un truc comme ca :
Et cela fonctionne.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9 //Declaration de la fonction WndProc LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM); BOOL CreateGLWindow(char *title, int width, int height, int bits) { WNDCLASS wc; wc.lpfnWndProc = (WNDPROC) WndProc; ... }
Mais je veux mettre tout cela dans une classe:
Et ca il aime pas du tout :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6 BOOL CGLView::CreateGLWindow(char *title, int width, int height, int bits) { WNDCLASS wc; wc.lpfnWndProc = (WNDPROC) CGLView::WndProc; ... }
Comment dois-je declarer ce truc ?????error C2440: 'type cast' : cannot convert from '' to 'long (__stdcall *)(struct HWND__ *,unsigned int,unsigned int,long)'
None of the functions with this name in scope match the target type
Partager