Commit before breaking everything
[matches/honours.git] / research / transmission_spectroscopy / TOF / Win32++ / samples / DLL / src / main.cpp
1 /////////////////////////////////////////\r
2 // main.cpp\r
3 \r
4 #include "stdafx.h"\r
5 \r
6 \r
7 int APIENTRY WinMain(HINSTANCE, HINSTANCE, LPSTR, int)\r
8 {\r
9         // Displays a dialog contained in MyDLL.dll\r
10 \r
11         // Load the MyDLL.dll\r
12         HMODULE hModule = LoadLibrary(_T("MyDLL.dll"));\r
13         if (0 == hModule)\r
14         {\r
15                 MessageBox(NULL, _T("Failed to load MyDLL.dll"), _T("Error"), MB_OK);\r
16                 return 0;\r
17         }\r
18         \r
19         // Create a pointer to MyDLL's ShowDialog function\r
20         typedef void WINAPI SHOWDIALOG();\r
21         SHOWDIALOG* pfnShowDialog = (SHOWDIALOG*)::GetProcAddress(hModule, "ShowDialog");\r
22         assert(pfnShowDialog);\r
23         \r
24         // Call MyDLL's ShowDialog function\r
25         pfnShowDialog();\r
26 \r
27         // We get here when the dialog is closed\r
28         FreeLibrary(hModule);\r
29 \r
30         return 0;\r
31 }\r
32 \r
33 \r
34 \r

UCC git Repository :: git.ucc.asn.au