Stragen
11-02-2002, 04:21 AM
Before today, the last time I did any coding was two months ago. At the time I had Windows 2000 installed and my program operated exactly as it was intended. Since then I have installed Windows XP. This morning to my dismay I discovered that my program no longer operates, causing an exception in user32.dll upon execution.
I found that the exception was occuring upon calling the RegisterClass function, as demonstrated in the code below:
bool Win32_Window::Register(WNDPROC proc)
{
hInstance = GetModuleHandle(NULL);
WNDCLASS wc;
wc.style = CS_HREDRAW | CS_VREDRAW | CS_OWNDC;
wc.lpfnWndProc = proc;
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.lpszClassName = WIN_CLASSNAME;
if(!RegisterClass(&wc)) return false;
return true;
}
Due to my total lack of skill I am unable to resolve this problem and are forced to ask the question: If this code works for Win2K, why not for XP? Am I missing something obvious? Do I suck?
Are there changes in the structs or functions relating to this proccess in the Win32 API in WindowsXP? If so, where is documentation available? (as I was unable to find any)
I found that the exception was occuring upon calling the RegisterClass function, as demonstrated in the code below:
bool Win32_Window::Register(WNDPROC proc)
{
hInstance = GetModuleHandle(NULL);
WNDCLASS wc;
wc.style = CS_HREDRAW | CS_VREDRAW | CS_OWNDC;
wc.lpfnWndProc = proc;
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.lpszClassName = WIN_CLASSNAME;
if(!RegisterClass(&wc)) return false;
return true;
}
Due to my total lack of skill I am unable to resolve this problem and are forced to ask the question: If this code works for Win2K, why not for XP? Am I missing something obvious? Do I suck?
Are there changes in the structs or functions relating to this proccess in the Win32 API in WindowsXP? If so, where is documentation available? (as I was unable to find any)