Archived

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

Lurking

Register WndClass (ERROR)

Recommended Posts

Lurking    126
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
Lurking    126
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
Lurking    126
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