home *** CD-ROM | disk | FTP | other *** search
/ Windows 95 v2.4 Fix / W95-v2.4fix.iso / ACADWIN / ADS / CPP / ADSCPP / ADSCPP.H < prev    next >
Encoding:
C/C++ Source or Header  |  1995-02-08  |  3.1 KB  |  97 lines

  1. /* 
  2.     ADSCPP.H
  3.         
  4.     This file:
  5.  
  6.     Declares general ADS application object, ADS_APP.  This 
  7.     application object is to be used when ads_main() is employed 
  8.     instead of WinMain().
  9.  
  10.     (C) Copyright 1988-1994 by Autodesk, Inc.
  11.  
  12.     This program is copyrighted by Autodesk, Inc. and is  licensed
  13.     to you under the following conditions.  You may not distribute
  14.     or  publish the source code of this program in any form.   You
  15.     may  incorporate this code in object form in derivative  works
  16.     provided  such  derivative  works  are  (i.) are  designed and
  17.     intended  to  work  solely  with  Autodesk, Inc. products, and
  18.     (ii.)  contain  Autodesk's  copyright  notice  "(C)  Copyright
  19.     1988-1994 by Autodesk, Inc."
  20.  
  21.     AUTODESK  PROVIDES THIS PROGRAM "AS IS" AND WITH  ALL  FAULTS.
  22.     AUTODESK  SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF  MER-
  23.     CHANTABILITY OR FITNESS FOR A PARTICULAR USE.  AUTODESK,  INC.
  24.     DOES  NOT  WARRANT THAT THE OPERATION OF THE PROGRAM  WILL  BE
  25.     UNINTERRUPTED OR ERROR FREE.
  26.  
  27.  
  28. */
  29. #ifndef __ADSCPP_H_
  30. #define __ADSCPP_H_
  31.  
  32. #include "adsinc.h"
  33.  
  34. //-----------------------------------------------------------------------------
  35. #ifdef __cplusplus
  36. extern "C" void ads_main(int, char**);
  37. #endif
  38.  
  39. /******************************************************************************
  40. *                                                                             *
  41. *                       class: ADS_APP                                        *
  42. *                                                                             *
  43. ******************************************************************************/
  44. //-----------------------------------------------------------------------------
  45. class ADS_APP : ADS_OBJ
  46. {
  47. public:
  48.                     ADS_APP(int argc, char **argv);
  49.     virtual         ~ADS_APP(){}
  50.     int             InsertExternFunc(ADS_FUNC_INFO&);
  51.     virtual int     Run();
  52.     virtual BOOL    Valid() { return app_state = APP_OK ; }
  53.  
  54.     //
  55.     // CY - 10-31-94
  56.     // The declaration is done here strangely because of a VC bug
  57.     //
  58. typedef int ( ADS_APP::*ADS_RUN_RSP_FUN )( void );
  59.  
  60. typedef void ( ADS_APP::*ADS_APP_RUN_FUNC )( void );
  61.     ADS_APP_RUN_FUNC    run_funs[10];
  62.     int             num_run_funs;
  63.  
  64. protected:
  65.  
  66.     virtual int     LOADFun( void );
  67.     virtual int     SUBRFun( void );
  68.     virtual int     UNLDFun( void );
  69.     virtual int     ENDFun( void ){ return RSRSLT; }
  70.     virtual int     QUITFun( void ){ return RSRSLT; }
  71.     virtual int     SAVEFun( void ){ return RSRSLT; }
  72.     virtual int     HUPFun( void ){ return RSRSLT; }
  73.     virtual int     CFGFun( void ){ return RSRSLT; }
  74.  
  75.     int             LOAD_status;
  76.     int             UNLD_status;
  77.     int             SUBR_status;
  78.  
  79.     struct DISPATCHER
  80.     {
  81.         int command;
  82.         ADS_RUN_RSP_FUN rsp_fun;
  83.     };
  84.  
  85. private:
  86.     static DISPATCHER 
  87.                     dispatcher[];
  88.     ADS_FUNC_INFO   exfuns[MAX_ADS_FUNC];
  89.     int             num_funs;
  90.     ADS_APP_STATE   app_state;
  91.  
  92.     BASIC_CPP_STUFF( ADS_APP )
  93. };
  94.  
  95. #endif //__ADSCPP_H_
  96.  
  97.