Hallo!
Ich habe folgendes Problem:
Ich erstelle ein Fenster:
|
Quellcode
|
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
|
WNDCLASSEX WindowClass = {sizeof (WNDCLASSEX),
CS_CLASSDC | CS_VREDRAW | CS_HREDRAW,
WindowProc,
0,
0,
Instance,
LoadIcon (Instance, MAKEINTRESOURCE (IDI_LOGO)),
NULL,
NULL,
NULL,
"Direct3D Window",
NULL};
Window = CreateWindowEx (0,
"Direct3D Window",
"Title"
WS_VISIBLE | WS_OVERLAPPEDWINDOW,
0,
0,
GetSystemMetrics (SM_CXSCREEN),
GetSystemMetrics (SM_CYSCREEN),
NULL,
NULL,
Instance,
NULL);
|
Alle Variablen sind deklariert.
Es wird auch wie geplant WindowProc mit WM_CREATE aufgerufen. Dann wird aber eine Exception ausgelöst.
Der Witz: Wenn ich diese Exception aber in der WinMain-Funktion abfange
|
Quellcode
|
1
2
3
4
5
6
7
8
|
try
{
/* ... */
}
catch (...)
{
MessageBox (NULL, "Exception abgefangen!", "Warnung!", 48);
}
|
, dann wird in der MessageBox-Funktion eine Ausnahme ausgelöst wird.
Lasse ich aber diese Anweisung weg, so wird die Exception wie geplant abgefangen und keine weitere Ausnahme ausgelöst.
Wie kann ich das Problem lösen?