home *** CD-ROM | disk | FTP | other *** search
/ Beginning C++ Through Gam…rogramming (2nd Edition) / BCGP2E.ISO / bloodshed / devcpp-4.9.9.2_setup.exe / Templates / Dll_c.txt < prev    next >
Text File  |  2003-02-12  |  788b  |  35 lines

  1. /* Replace "dll.h" with the name of your header */
  2. #include "dll.h"
  3. #include <windows.h>
  4. #include <stdio.h>
  5. #include <stdlib.h>
  6.  
  7. DLLIMPORT void HelloWorld ()
  8. {
  9.     MessageBox (0, "Hello World from DLL!\n", "Hi", MB_ICONINFORMATION);
  10. }
  11.  
  12.  
  13. BOOL APIENTRY DllMain (HINSTANCE hInst     /* Library instance handle. */ ,
  14.                        DWORD reason        /* Reason this function is being called. */ ,
  15.                        LPVOID reserved     /* Not used. */ )
  16. {
  17.     switch (reason)
  18.     {
  19.       case DLL_PROCESS_ATTACH:
  20.         break;
  21.  
  22.       case DLL_PROCESS_DETACH:
  23.         break;
  24.  
  25.       case DLL_THREAD_ATTACH:
  26.         break;
  27.  
  28.       case DLL_THREAD_DETACH:
  29.         break;
  30.     }
  31.  
  32.     /* Returns TRUE on success, FALSE on failure */
  33.     return TRUE;
  34. }
  35.