ReactOS  0.4.13-dev-242-g611e6d7
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 661 of file atlbase.h.

Constructor & Destructor Documentation

◆ CAtlExeModuleT()

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

Definition at line 669 of file atlbase.h.

671  {
672  }
DWORD WINAPI GetCurrentThreadId(VOID)
Definition: thread.c:420
DWORD m_dwMainThreadID
Definition: atlbase.h:664

◆ ~CAtlExeModuleT()

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

Definition at line 674 of file atlbase.h.

675  {
676  }

Member Function Documentation

◆ InitializeCom()

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

Definition at line 766 of file atlbase.h.

767  {
769  }
smooth NULL
Definition: ftsmooth.c:416
HRESULT WINAPI DECLSPEC_HOTPATCH CoInitializeEx(LPVOID lpReserved, DWORD dwCoInit)
Definition: compobj.c:1935

◆ Lock()

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

Reimplemented from ATL::CAtlModule.

Definition at line 713 of file atlbase.h.

714  {
715  return CoAddRefServerProcess();
716  }
ULONG WINAPI CoAddRefServerProcess(void)
Definition: compobj.c:4071

◆ ParseCommandLine()

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

Definition at line 728 of file atlbase.h.

729  {
730  // unimplemented!
731  return true;
732  }

◆ PostMessageLoop()

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

Definition at line 750 of file atlbase.h.

751  {
752  T* pThis = static_cast<T*>(this);
753  return pThis->RevokeClassObjects();
754  }
#define T
Definition: mbstring.h:31

◆ PreMessageLoop()

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

Definition at line 734 of file atlbase.h.

735  {
736  T* pThis = static_cast<T*>(this);
737  return pThis->RegisterClassObjects(CLSCTX_LOCAL_SERVER, REGCLS_MULTIPLEUSE);
738  }
#define T
Definition: mbstring.h:31

◆ RegisterClassObjects()

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

Definition at line 756 of file atlbase.h.

757  {
758  return AtlComModuleRegisterClassObjects(&_AtlComModule, dwClsContext, dwFlags);
759  }
HRESULT WINAPI AtlComModuleRegisterClassObjects(_ATL_COM_MODULE *module, DWORD context, DWORD flags)
Definition: atlbase.h:1806
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175

◆ RevokeClassObjects()

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

Definition at line 761 of file atlbase.h.

762  {
763  return AtlComModuleRevokeClassObjects(&_AtlComModule);
764  }
HRESULT WINAPI AtlComModuleRevokeClassObjects(_ATL_COM_MODULE *module)
Definition: atlbase.h:1835

◆ Run()

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

Definition at line 697 of file atlbase.h.

698  {
699  HRESULT hr = S_OK;
700 
701  T* pThis = static_cast<T*>(this);
702  hr = pThis->PreMessageLoop(nShowCmd);
703 
704  if (hr == S_OK)
705  {
706  pThis->RunMessageLoop();
707  hr = pThis->PostMessageLoop();
708  }
709 
710  return hr;
711  }
HRESULT hr
Definition: shlfolder.c:183
#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 740 of file atlbase.h.

741  {
742  MSG msg;
743  while (GetMessage(&msg, 0, 0, 0) > 0)
744  {
747  }
748  }
#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 771 of file atlbase.h.

772  {
774  }
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
Definition: compobj.c:1991

◆ Unlock()

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

Reimplemented from ATL::CAtlModule.

Definition at line 718 of file atlbase.h.

719  {
720  LONG lRet = CoReleaseServerProcess();
721  if (lRet == 0)
722  {
724  }
725  return lRet;
726  }
ULONG WINAPI CoReleaseServerProcess(void)
Definition: compobj.c:4102
#define WM_QUIT
Definition: winuser.h:1605
long LONG
Definition: pedump.c:60
DWORD m_dwMainThreadID
Definition: atlbase.h:664
#define PostThreadMessage
Definition: winuser.h:5699

◆ WinMain()

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

Definition at line 678 of file atlbase.h.

679  {
680  HRESULT hr = T::InitializeCom();
681  if (FAILED(hr))
682  return hr;
683 
684  T* pThis = static_cast<T*>(this);
685 
686  LPCTSTR lpCommandLine = GetCommandLine();
687  if (pThis->ParseCommandLine(lpCommandLine, &hr))
688  {
689  hr = pThis->Run(nShowCmd);
690  }
691 
692  T::UninitializeCom();
693  return hr;
694  }
const CHAR * LPCTSTR
Definition: xmlstorage.h:193
HRESULT hr
Definition: shlfolder.c:183
#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 664 of file atlbase.h.

Referenced by ATL::CAtlExeModuleT< T >::Unlock().


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