home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 15 / CD_ASCQ_15_070894.iso / vrac / memsz231.zip / PROCESS.CPP < prev    next >
Text File  |  1994-01-25  |  980b  |  47 lines

  1. // Class PROCESS: Encapsulates the startup/shutdown logic for a OS/2-PM process.
  2.  
  3. #define INCL_BASE
  4. #define INCL_WIN
  5. #include <os2.h>
  6.  
  7. #include "debug.h"
  8. #include "except.h"
  9.  
  10. #include "process.h"
  11.  
  12.  
  13. // Constructor
  14.  
  15. Process::Process ( LONG QueueSize )
  16. {
  17.   DosError ( FERR_DISABLEEXCEPTION ) ;
  18.  
  19.   ExceptionRecord.prev_structure = 0 ;
  20.   ExceptionRecord.ExceptionHandler = ExceptionHandler ;
  21.   DosSetExceptionHandler ( &ExceptionRecord ) ;
  22.  
  23.   Anchor = WinInitialize ( 0 ) ;
  24.   if ( Anchor == 0 )
  25.   {
  26. //  Log ( "ERROR: Unable to initialize for windowing.\r\n" ) ;
  27.     DosExit ( EXIT_PROCESS, 1 ) ;
  28.   }
  29.  
  30.   Queue = WinCreateMsgQueue ( Anchor, QueueSize ) ;
  31.   if ( Queue == 0 )
  32.   {
  33. //  Log ( "ERROR: Unable to create process message queue.\r\n" ) ;
  34.     DosExit ( EXIT_PROCESS, 1 ) ;
  35.   }
  36. }
  37.  
  38.  
  39. // Destructor
  40.  
  41. Process::~Process ( )
  42. {
  43.   WinDestroyMsgQueue ( Queue ) ;
  44.   WinTerminate ( Anchor ) ;
  45.   DosUnsetExceptionHandler ( &ExceptionRecord ) ;
  46. }
  47.