Gray C++ Libraries  0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
cAppImpl.h
Go to the documentation of this file.
1 //
4 //
5 
6 #ifndef _INC_cAppImpl_H
7 #define _INC_cAppImpl_H
8 #ifndef NO_PRAGMA_ONCE
9 #pragma once
10 #endif
11 
12 #include "cAppState.h"
13 #include "cObject.h"
14 #include "cOSModule.h"
15 
16 #ifndef _MFC_VER
17 namespace Gray
18 {
20  : public cSingletonStatic < cAppImpl > // use static theApp
21  {
27 
28  public:
29  static const char* k_HelpText;
30 
35 
36  public:
37  cAppImpl(const FILECHAR_t* pszAppName = nullptr);
38  virtual ~cAppImpl();
39 
40  static inline HINSTANCE get_HInstance()
41  {
42  // Similar to MFC?
43  return cAppState::get_HModule();
44  }
45 
46  virtual cString get_HelpText() const;
47  virtual bool ShowHelp();
48  virtual bool CheckHelpArgs();
49 
50  virtual BOOL InitInstance();
51  virtual bool OnTickApp();
52  virtual int Run();
53  virtual int ExitInstance();
54 
55  APP_EXITCODE_t Main(HMODULE hInstance = HMODULE_NULL);
56  };
57 }
58 #endif
59 #endif
#define GRAYCORE_LINK
Definition: GrayCore.h:47
#define HMODULE_NULL
Definition: cOSModule.h:31
Definition: cAppImpl.h:21
const FILECHAR_t * m_pszAppName
Specifies the name of my application. (display friendly)
Definition: cAppImpl.h:31
static const char * k_HelpText
Definition: cAppImpl.h:29
static HINSTANCE get_HInstance()
Definition: cAppImpl.h:40
cAppState & m_State
Quick reference to cAppState singleton.
Definition: cAppImpl.h:33
TIMESYSD_t m_nMinTickTime
Minimum amount of time to spend in the OnTickApp() (mSec). cThreadId::SleepCurrent() if there is extr...
Definition: cAppImpl.h:32
bool m_bCloseSignal
Polite request to close the application. checked in Run() and OnTickApp()
Definition: cAppImpl.h:34
Definition: cAppState.h:82
static HMODULE __stdcall get_HModule()
Definition: cAppState.cpp:782
Definition: cSingleton.h:30
< The main namespace for all Core functions.
Definition: GrayCore.cpp:14
INT32 TIMESYSD_t
Time delta. signed milli-Seconds Span. cTimeSys::k_DMAX, cTimeSys::k_INF = MAILSLOT_WAIT_FOREVER.
Definition: cTimeSys.h:28
char FILECHAR_t
a UTF8 char in a file name. like TCHAR
Definition: FileName.h:22