Skip to content

Commit c4cdde4

Browse files
committed
tweak project templates
1 parent 3d7a1a0 commit c4cdde4

File tree

2 files changed

+24
-26
lines changed

2 files changed

+24
-26
lines changed

visuald/Templates/ProjectItems/DynamicLib/dllmain.d

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,27 @@ __gshared HINSTANCE g_hInst;
88
extern (Windows)
99
BOOL DllMain(HINSTANCE hInstance, ULONG ulReason, LPVOID pvReserved)
1010
{
11-
final switch (ulReason)
11+
switch (ulReason)
1212
{
13-
case DLL_PROCESS_ATTACH:
14-
g_hInst = hInstance;
15-
dll_process_attach( hInstance, true );
16-
break;
17-
18-
case DLL_PROCESS_DETACH:
19-
dll_process_detach( hInstance, true );
20-
break;
21-
22-
case DLL_THREAD_ATTACH:
23-
dll_thread_attach( true, true );
24-
break;
25-
26-
case DLL_THREAD_DETACH:
27-
dll_thread_detach( true, true );
28-
break;
13+
case DLL_PROCESS_ATTACH:
14+
g_hInst = hInstance;
15+
dll_process_attach(hInstance, true);
16+
break;
17+
18+
case DLL_PROCESS_DETACH:
19+
dll_process_detach(hInstance, true);
20+
break;
21+
22+
case DLL_THREAD_ATTACH:
23+
dll_thread_attach(true, true);
24+
break;
25+
26+
case DLL_THREAD_DETACH:
27+
dll_thread_detach(true, true);
28+
break;
29+
30+
default:
31+
break;
2932
}
3033
return true;
3134
}

visuald/Templates/ProjectItems/WindowsApp/winmain.d

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,18 @@ int WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int n
88
{
99
int result;
1010

11-
void exceptionHandler(Throwable e)
12-
{
13-
throw e;
14-
}
15-
1611
try
1712
{
18-
Runtime.initialize(&exceptionHandler);
13+
Runtime.initialize();
1914

2015
result = myWinMain(hInstance, hPrevInstance, lpCmdLine, nCmdShow);
2116

22-
Runtime.terminate(&exceptionHandler);
17+
Runtime.terminate();
2318
}
24-
catch (Throwable o) // catch any uncaught exceptions
19+
catch (Throwable o) // catch any uncaught exceptions
2520
{
2621
MessageBoxA(null, cast(char *)o.toString(), "Error", MB_OK | MB_ICONEXCLAMATION);
27-
result = 0; // failed
22+
result = 0; // failed
2823
}
2924

3025
return result;

0 commit comments

Comments
 (0)