1 /////////////////////////////////////////
\r
7 int APIENTRY WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
\r
9 // Displays a dialog contained in MyDLL.dll
\r
11 // Load the MyDLL.dll
\r
12 HMODULE hModule = LoadLibrary(_T("MyDLL.dll"));
\r
15 MessageBox(NULL, _T("Failed to load MyDLL.dll"), _T("Error"), MB_OK);
\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
24 // Call MyDLL's ShowDialog function
\r
27 // We get here when the dialog is closed
\r
28 FreeLibrary(hModule);
\r