home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c082_122 / 3.ddi / OWLINC.ZIP / MODULE.H < prev    next >
Encoding:
C/C++ Source or Header  |  1992-06-10  |  2.7 KB  |  112 lines

  1. // ObjectWindows - (C) Copyright 1992 by Borland International
  2.  
  3. #ifndef __MODULE_H
  4. #define __MODULE_H
  5.  
  6. #ifndef __OBJECT_H
  7. #include <object.h>
  8. #endif
  9.  
  10. #ifndef __WINDOWS_H
  11. #undef NULL
  12. #include <windows.h>
  13. #endif
  14.  
  15. #ifndef __OWLDEFS_H
  16. #include <owldefs.h>
  17. #endif
  18.  
  19. #ifndef __OWL_H
  20. #include <owl.h>
  21. #endif
  22.  
  23. #ifndef __WINDOW_H
  24. #include <window.h>
  25. #endif
  26.  
  27. #ifndef __MDI_H
  28. #include <mdi.h>
  29. #endif
  30.  
  31. #ifndef __DIALOG_H
  32. #include <dialog.h>
  33. #endif
  34.  
  35. #pragma option -Vo-
  36. #if     defined(__BCOPT__) && !defined(_ALLOW_po)
  37. #pragma option -po-
  38. #endif
  39.  
  40. _CLASSDEF(TModule)
  41.  
  42. // Module Class
  43.  
  44. class _EXPORT TModule : public Object {
  45. public:
  46.  
  47.     // Lib and WinMain args
  48.     HINSTANCE        hInstance;
  49.     LPSTR        lpCmdLine;
  50.  
  51.     int Status;
  52.     LPSTR Name;
  53.  
  54. #if defined(WIN31)
  55.     TModule(LPSTR AName, HINSTANCE AnInstance, LPSTR ACmdLine);
  56. #endif
  57. #if defined(WIN30)
  58.     TModule(LPSTR AName, HINSTANCE_30 AnInstance, LPSTR ACmdLine);
  59. #endif
  60.     virtual ~TModule();
  61.  
  62.     BOOL LowMemory();
  63.     void RestoreMemory();
  64.     virtual PTWindowsObject ValidWindow(PTWindowsObject AWindowsObject);
  65.     virtual PTWindowsObject MakeWindow(PTWindowsObject AWindowsObject);
  66.     virtual int ExecDialog(PTWindowsObject ADialog);
  67.     HWND GetClientHandle(HWND AnHWindow);
  68.  
  69. #if defined(WIN31)
  70.     // windows 3.1 interface
  71.     virtual PTWindowsObject GetParentObject(HWND ParentHandle);
  72. #endif
  73. #if defined(WIN30)
  74.     // windows 3.0 interface
  75.     virtual PTWindowsObject GetParentObject(HWND_30 ParentHandle);
  76. #endif
  77. #if (defined(WIN30) || defined(WIN31)) && !(defined(WIN30) && defined(WIN31))
  78.     // this function is never called. it is used to pad the vtable so that
  79.     // exactly two GetParentObject(...) definitions are always present.
  80.     virtual PTWindowsObject GetParentObject(void *)
  81.             { return NULL; }
  82. #endif
  83.     virtual void Error(int ErrorCode);
  84.  
  85.     // define pure virtual functions derived from Object class
  86.     virtual classType        isA() const
  87.         { return moduleClass; }
  88.     virtual Pchar nameOf() const
  89.         { return "TModule"; }
  90.     virtual hashValueType hashValue() const
  91.         {  return hashValueType(hInstance); }
  92.     virtual int       isEqual(RCObject module)  const
  93.             { return (hInstance == ((RTModule)module).hInstance); }
  94.     virtual void      printOn(Rostream outputStream) const
  95.             { outputStream << nameOf() << "{ hInstance = "
  96.               << (void _FAR *)hInstance << " }\n"; }
  97. private:
  98.  
  99.     PTWindowsObject __GetParentObject(HWND ParentHandle);
  100.     void __TModule(LPSTR AName, HINSTANCE AnInstance, LPSTR ACmdLine);
  101.  
  102. };    // end of Module class
  103.  
  104. extern PTModule Module;
  105.  
  106. #pragma option -Vo.
  107. #if     defined(__BCOPT__) && !defined(_ALLOW_po)
  108. #pragma option -po.
  109. #endif
  110.  
  111. #endif // ifndef __MODULE_H
  112.