OK, so I must be blind. This is code that used to run, and it doesn't do so anymore:
Specifically, CreateWindow returns a 0 handle. The 2nd call to GetLastError() returns 87 (invalid parameter value), or crashes the debugger (connection lost to device).
The only Windows code that has been executed up to this point is:
Does anyone see what the issue is?
Thanks,
HM
- Code:
hInstance = GetModuleHandle(NULL);
wndclass.style = CS_HREDRAW | CS_VREDRAW /*| CS_OWNDC*/;
wndclass.lpfnWndProc = (WNDPROC)DefWindowProc;
wndclass.cbClsExtra = 0;
wndclass.cbWndExtra = 0;
wndclass.hInstance = hInstance;
wndclass.hIcon = 0;/*LoadIcon(NULL, IDI_APPLICATION);*/
wndclass.hCursor = 0;
wndclass.hbrBackground = 0;
wndclass.lpszMenuName = NULL;
wndclass.lpszClassName = L"windowClassName";
atom = RegisterClass(&wndclass);
error = GetLastError();
hwnd = CreateWindow(
wndclass.lpszClassName,
L"windowName",
/*WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN | WS_CLIPSIBLINGS*/ WS_VISIBLE,
CW_USEDEFAULT,
CW_USEDEFAULT,
CW_USEDEFAULT,
CW_USEDEFAULT,
NULL,
NULL,
hInstance,
NULL);
if (!hwnd) {
error = GetLastError();
return 0;
}
Specifically, CreateWindow returns a 0 handle. The 2nd call to GetLastError() returns 87 (invalid parameter value), or crashes the debugger (connection lost to device).
The only Windows code that has been executed up to this point is:
- Code:
HDC nativeCreateDisplay(void)
{
return hdc = GetDC(NULL);
}
Does anyone see what the issue is?
Thanks,
HM