hallo,
ich habe ne Klasse die ein Fenster representiert. Die Klasse hat ne Methode Create:
|
C-/C++-Quelltext
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
bool CWindow::Create(char* title, int width, int height, HINSTANCE hInstance)
{
m_hInst = hInstance;
closed = false;
WNDCLASSEX windowclass;
ZeroMemory(&windowclass, sizeof(WNDCLASSEX));
windowclass.cbSize = sizeof (WNDCLASSEX);
windowclass.style = CS_HREDRAW | CS_VREDRAW;
windowclass.lpfnWndProc = reinterpret_cast<WNDPROC>(WndProc);
windowclass.cbClsExtra = 0;
windowclass.cbWndExtra = 0;
windowclass.hInstance = m_hInst;
windowclass.hIcon = LoadIcon (NULL, IDI_APPLICATION);
windowclass.hIconSm = LoadIcon (NULL, IDI_APPLICATION);
windowclass.hCursor = LoadCursor (NULL, IDC_ARROW);
windowclass.hbrBackground = reinterpret_cast<HBRUSH>(16);
windowclass.lpszMenuName = NULL;
windowclass.lpszClassName = title;
RegisterClassEx(&windowclass);
m_hWnd = CreateWindowEx( NULL,
title,
title,
WS_OVERLAPPEDWINDOW | WS_VISIBLE,
CW_USEDEFAULT,
CW_USEDEFAULT,
width,
height,
NULL,
NULL,
m_hInst,
NULL);
int error = GetLastError();
if(m_hWnd!= NULL)
{
m_windows.push_back(this);
return true;
}
else return false;
}
|
Ich habe das Problem, dass der Debugger mir sagt, dass er m_hWnd nicht auswerten kann. Er kann mir noch nichtmal den Wert von error sagen. (Ausdruck kann nicht ausgewertet werden)
Das Fenster wird erzeugt, aber ich habe irgendwie kein Handle. Woran könnte das liegen?