• Advertisement

Archived

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

Register WndClass (ERROR)

This topic is 5888 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey, for some reason when i compile my window i always get the "failed to register class" error. After i compile the code 3 times i get a linker error. I dont think its my code that is the problem. I checked everything over and it seems to be set up fine. Could it be my OS (WinXP)? If you need me to post code i will. Thanx if you can help me. - Lurking

Share this post


Link to post
Share on other sites
Advertisement
WNDCLASS wc;

hInstance = GetModuleHandle(NULL);
wc.style = CS_HREDRAW | CS_VREDRAW | CS_OWNDC;
wc.lpfnWndProc = (WNDPROC)::WndProc;
wc.cbClsExtra = 0;
wc.cbWndExtra = 0;
wc.hInstance = hInstance;
wc.hIcon = LoadIcon(NULL, IDI_WINLOGO);
wc.hCursor = LoadCursor(NULL, IDC_ARROW);
wc.hbrBackground = NULL;
wc.lpszMenuName = NULL;
wc.lpszClassName = "OpenGL";

if(!RegisterClass(&wc))
{
MessageBox(NULL,"Failed to Register Class!","ERROR", MB_OK | MB_ICONEXCLAMATION);
return FALSE;
}

Share this post


Link to post
Share on other sites
WNDCLASS wc;

hInstance = GetModuleHandle(NULL);
wc.style = CS_HREDRAW | CS_VREDRAW | CS_OWNDC;
wc.lpfnWndProc = (WNDPROC)::WndProc;
wc.cbClsExtra = 0;
wc.cbWndExtra = 0;
wc.hInstance = hInstance;
wc.hIcon = LoadIcon(NULL, IDI_WINLOGO);
wc.hCursor = LoadCursor(NULL, IDC_ARROW);
wc.hbrBackground = NULL;
wc.lpszMenuName = NULL;
wc.lpszClassName = "OpenGL";

if(!RegisterClass(&wc))
{
MessageBox(NULL,"Failed to Register Class!","ERROR", MB_OK | MB_ICONEXCLAMATION);
return FALSE;
}

Share this post


Link to post
Share on other sites

  • Advertisement