ReactOS  0.4.12-dev-43-g63b00d8
ATL::CAtlExeModuleT< T > Class Template Reference

#include <atlbase.h>

Inheritance diagram for ATL::CAtlExeModuleT< T >:
Collaboration diagram for ATL::CAtlExeModuleT< T >:

Public Member Functions

 CAtlExeModuleT ()
 
 ~CAtlExeModuleT ()
 
int WinMain (int nShowCmd)
 
HRESULT Run (int nShowCmd=SW_HIDE)
 
LONG Lock ()
 
LONG Unlock ()
 
bool ParseCommandLine (LPCTSTR lpCmdLine, HRESULT *pnRetCode)
 
HRESULT PreMessageLoop (int nShowCmd)
 
void RunMessageLoop ()
 
HRESULT PostMessageLoop ()
 
HRESULT RegisterClassObjects (DWORD dwClsContext, DWORD dwFlags)
 
HRESULT RevokeClassObjects ()
 
- Public Member Functions inherited from ATL::CAtlModuleT< T >
HRESULT RegisterServer (BOOL bRegTypeLib=FALSE, const CLSID *pCLSID=NULL)
 
HRESULT UnregisterServer (BOOL bUnRegTypeLib, const CLSID *pCLSID=NULL)
 
virtual HRESULT AddCommonRGSReplacements (IRegistrarBase *pRegistrar)
 
- Public Member Functions inherited from ATL::CAtlModule
 CAtlModule ()
 
virtual LONG GetLockCount ()
 
HRESULT WINAPI UpdateRegistryFromResource (LPCTSTR lpszRes, BOOL bRegister, struct _ATL_REGMAP_ENTRY *pMapEntries=NULL)
 
HRESULT WINAPI UpdateRegistryFromResource (UINT nResID, BOOL bRegister, struct _ATL_REGMAP_ENTRY *pMapEntries=NULL)
 

Static Public Member Functions

static HRESULT InitializeCom ()
 
static void UninitializeCom ()
 
- Static Public Member Functions inherited from ATL::CAtlModuleT< T >
static LPCOLESTR GetAppId ()
 

Public Attributes

DWORD m_dwMainThreadID
 
- Public Attributes inherited from ATL::_ATL_MODULE70
UINT cbSize
 
LONG m_nLockCnt
 
_ATL_TERMFUNC_ELEMm_pTermFuncs
 
CComCriticalSection m_csStaticDataInitAndTypeInfo
 

Additional Inherited Members

- Static Public Attributes inherited from ATL::CAtlModule
static GUID m_libid
 

Detailed Description

template<class T>
class ATL::CAtlExeModuleT< T >

Definition at line 670 of file atlbase.h.

Constructor & Destructor Documentation

◆ CAtlExeModuleT()

template<class T >
ATL::CAtlExeModuleT< T >::CAtlExeModuleT ( )
inline

Definition at line 678 of file atlbase.h.

680  {
681  }
DWORD WINAPI GetCurrentThreadId(VOID)
Definition: thread.c:421
DWORD m_dwMainThreadID
Definition: atlbase.h:673

◆ ~CAtlExeModuleT()

template<class T >
ATL::CAtlExeModuleT< T >::~CAtlExeModuleT ( )
inline

Definition at line 683 of file atlbase.h.

684  {
685  }

Member Function Documentation

◆ InitializeCom()

template<class T >
static HRESULT ATL::CAtlExeModuleT< T >::InitializeCom ( )
inlinestatic

Definition at line 775 of file atlbase.h.

776  {
778  }
smooth NULL
Definition: ftsmooth.c:416
HRESULT WINAPI DECLSPEC_HOTPATCH CoInitializeEx(LPVOID lpReserved, DWORD dwCoInit)
Definition: compobj.c:1938

◆ Lock()

template<class T >
LONG ATL::CAtlExeModuleT< T >::Lock ( void  )
inlinevirtual

Reimplemented from ATL::CAtlModule.

Definition at line 722 of file atlbase.h.

723  {
724  return CoAddRefServerProcess();
725  }
ULONG WINAPI CoAddRefServerProcess(void)
Definition: compobj.c:4074

◆ ParseCommandLine()

template<class T >
bool ATL::CAtlExeModuleT< T >::ParseCommandLine ( LPCTSTR  lpCmdLine,
HRESULT pnRetCode 
)
inline

Definition at line 737 of file atlbase.h.

738  {
739  // unimplemented!
740  return true;
741  }

◆ PostMessageLoop()

template<class T >
HRESULT ATL::CAtlExeModuleT< T >::PostMessageLoop ( )
inline

Definition at line 759 of file atlbase.h.

760  {
761  T* pThis = static_cast<T*>(this);
762  return pThis->RevokeClassObjects();
763  }
#define T
Definition: mbstring.h:31

◆ PreMessageLoop()

template<class T >
HRESULT ATL::CAtlExeModuleT< T >::PreMessageLoop ( int  nShowCmd)
inline

Definition at line 743 of file atlbase.h.

744  {
745  T* pThis = static_cast<T*>(this);
746  return pThis->RegisterClassObjects(CLSCTX_LOCAL_SERVER, REGCLS_MULTIPLEUSE);
747  }
#define T
Definition: mbstring.h:31

◆ RegisterClassObjects()

template<class T >
HRESULT ATL::CAtlExeModuleT< T >::RegisterClassObjects ( DWORD  dwClsContext,
DWORD  dwFlags 
)
inline

Definition at line 765 of file atlbase.h.

766  {
768  }
HRESULT WINAPI AtlComModuleRegisterClassObjects(_ATL_COM_MODULE *module, DWORD context, DWORD flags)
Definition: atlbase.h:1814
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
CAtlComModule _AtlComModule
Definition: atlbase.cpp:28

◆ RevokeClassObjects()

template<class T >
HRESULT ATL::CAtlExeModuleT< T >::RevokeClassObjects ( )
inline

Definition at line 770 of file atlbase.h.

771  {
773  }
HRESULT WINAPI AtlComModuleRevokeClassObjects(_ATL_COM_MODULE *module)
Definition: atlbase.h:1843
CAtlComModule _AtlComModule
Definition: atlbase.cpp:28

◆ Run()

template<class T >
HRESULT ATL::CAtlExeModuleT< T >::Run ( int  nShowCmd = SW_HIDE)
inline

Definition at line 706 of file atlbase.h.

707  {
708  HRESULT hr = S_OK;
709 
710  T* pThis = static_cast<T*>(this);
711  hr = pThis->PreMessageLoop(nShowCmd);
712 
713  if (hr == S_OK)
714  {
715  pThis->RunMessageLoop();
716  hr = pThis->PostMessageLoop();
717  }
718 
719  return hr;
720  }
#define T
Definition: mbstring.h:31
LONG HRESULT
Definition: typedefs.h:77
#define S_OK
Definition: intsafe.h:59

◆ RunMessageLoop()

template<class T >
void ATL::CAtlExeModuleT< T >::RunMessageLoop ( )
inline

Definition at line 749 of file atlbase.h.

750  {
751  MSG msg;
752  while (GetMessage(&msg, 0, 0, 0) > 0)
753  {
754  TranslateMessage(&msg);
755  DispatchMessage(&msg);
756  }
757  }
#define DispatchMessage
Definition: winuser.h:5631
BOOL WINAPI TranslateMessage(_In_ const MSG *)
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1827
#define GetMessage
Definition: winuser.h:5656
#define msg(x)
Definition: auth_time.c:54

◆ UninitializeCom()

template<class T >
static void ATL::CAtlExeModuleT< T >::UninitializeCom ( )
inlinestatic

Definition at line 780 of file atlbase.h.

781  {
783  }
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
Definition: compobj.c:1994

◆ Unlock()

template<class T >
LONG ATL::CAtlExeModuleT< T >::Unlock ( void  )
inlinevirtual

Reimplemented from ATL::CAtlModule.

Definition at line 727 of file atlbase.h.

728  {
729  LONG lRet = CoReleaseServerProcess();
730  if (lRet == 0)
731  {
733  }
734  return lRet;
735  }
ULONG WINAPI CoReleaseServerProcess(void)
Definition: compobj.c:4105
#define WM_QUIT
Definition: winuser.h:1605
long LONG
Definition: pedump.c:60
DWORD m_dwMainThreadID
Definition: atlbase.h:673
#define PostThreadMessage
Definition: winuser.h:5699

◆ WinMain()

template<class T >
int ATL::CAtlExeModuleT< T >::WinMain ( int  nShowCmd)
inline

Definition at line 687 of file atlbase.h.

688  {
689  HRESULT hr = T::InitializeCom();
690  if (FAILED(hr))
691  return hr;
692 
693  T* pThis = static_cast<T*>(this);
694 
695  LPCTSTR lpCommandLine = GetCommandLine();
696  if (pThis->ParseCommandLine(lpCommandLine, &hr))
697  {
698  hr = pThis->Run(nShowCmd);
699  }
700 
701  T::UninitializeCom();
702  return hr;
703  }
const CHAR * LPCTSTR
Definition: xmlstorage.h:193
#define T
Definition: mbstring.h:31
#define GetCommandLine
Definition: winbase.h:3613
LONG HRESULT
Definition: typedefs.h:77

Member Data Documentation

◆ m_dwMainThreadID

template<class T >
DWORD ATL::CAtlExeModuleT< T >::m_dwMainThreadID

Definition at line 673 of file atlbase.h.


The documentation for this class was generated from the following file: