home *** CD-ROM | disk | FTP | other *** search
/ PC Pro 1998 April / DPPCPRO0498.ISO / April / MathCad / SETUP / DATA.Z / USERPACK.C < prev    next >
Encoding:
C/C++ Source or Header  |  1997-05-05  |  1.1 KB  |  44 lines

  1. #include "mcadincl.h"
  2.     
  3.     extern FUNCTIONINFO realsum, transpose;
  4.     
  5.     
  6.     char *ErrorMessageTable[] = {
  7.     "argument must be real",    //  error 1 --  argument must be real
  8.     "insufficient memory",      //  error 2 --  memory allocation error
  9.     "interrupted"               //  error 3 --  execution interrupted
  10.     };
  11.  
  12.  
  13. BOOL WINAPI DllEntryPoint (HANDLE hDLL, DWORD dwReason, LPVOID lpReserved)
  14. {
  15.   switch (dwReason)
  16.   {
  17.     case DLL_PROCESS_ATTACH:
  18.     {
  19.  
  20.       // DLL is attaching to the address space of the current process.
  21.       //
  22.           if (!CreateUserErrorMessageTable( hDLL, 3, ErrorMessageTable ) )
  23.                 break;
  24.  
  25.           if ( CreateUserFunction( hDLL, &realsum ) == NULL )
  26.                 break;
  27.  
  28.           CreateUserFunction( hDLL, &transpose);
  29.  
  30.         break;
  31.     }
  32.  
  33.      case DLL_THREAD_ATTACH:        // A new thread is being created in the current process.
  34.      case DLL_THREAD_DETACH:        // A thread is exiting cleanly.
  35.      case DLL_PROCESS_DETACH:      // The calling process is detaching the DLL from its address space.
  36.  
  37.         break;
  38.   }
  39.   return TRUE;
  40. }
  41.  
  42.     
  43.  
  44.