Now i am writing a MFC program with opengl in it. And when i tried to combine opengl with MFC, i come across some problems: First, I defined a class named:CSCommTestDlg, and defined a member function with codes as follows:
void CSCommTestDlg::OpglMain(int argc, char* argv[])
{
glutDisplayFunc(displayCude);
}
displayCube is also a member function of class CSCommTestDlg, and glutDisplayFunc is a global funcion(an opengl function), the function declarations of glutDisplayFunc is as follows:
GLUTAPI void APIENTRY glutDisplayFunc(void (GLUTCALLBACK *func)(void));
Yes, just as you can see, the parameter of glutDisplayFunc is a function pointer, and i made it point to a member function displayCube, which seems illegal, and i got an error like that:
error C2664: 'glutDisplayFunc' : cannot convert parameter 1 from 'void (void)' to 'void (__cdecl *)(void)'
None of the functions with this name in scope match the target type
seems that i can't point to a member function in a global function, but i need it. How to fix it ?
JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)