ReactOS 0.4.15-dev-5863-g1fe3ab7
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 ()
 
virtual LONG Lock ()
 
virtual LONG Unlock ()
 
virtual HRESULT AddCommonRGSReplacements (IRegistrarBase *)=0
 
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 662 of file atlbase.h.

Constructor & Destructor Documentation

◆ CAtlExeModuleT()

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

Definition at line 670 of file atlbase.h.

672 {
673 }
DWORD m_dwMainThreadID
Definition: atlbase.h:665
DWORD WINAPI GetCurrentThreadId(void)
Definition: thread.c:459

◆ ~CAtlExeModuleT()

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

Definition at line 675 of file atlbase.h.

676 {
677 }

Member Function Documentation

◆ InitializeCom()

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

Definition at line 767 of file atlbase.h.

768 {
769 return ::CoInitializeEx(NULL, COINIT_MULTITHREADED);
770 }
#define NULL
Definition: types.h:112
@ COINIT_MULTITHREADED
Definition: objbase.h:279

◆ Lock()

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

Reimplemented from ATL::CAtlModule.

Definition at line 714 of file atlbase.h.

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

◆ ParseCommandLine()

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

Definition at line 729 of file atlbase.h.

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

◆ PostMessageLoop()

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

Definition at line 751 of file atlbase.h.

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

◆ PreMessageLoop()

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

Definition at line 735 of file atlbase.h.

736 {
737 T* pThis = static_cast<T*>(this);
738 return pThis->RegisterClassObjects(CLSCTX_LOCAL_SERVER, REGCLS_MULTIPLEUSE);
739 }
@ REGCLS_MULTIPLEUSE
Definition: objbase.h:393

◆ RegisterClassObjects()

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

Definition at line 757 of file atlbase.h.

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

◆ RevokeClassObjects()

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

Definition at line 762 of file atlbase.h.

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

◆ Run()

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

Definition at line 698 of file atlbase.h.

699 {
700 HRESULT hr = S_OK;
701
702 T* pThis = static_cast<T*>(this);
703 hr = pThis->PreMessageLoop(nShowCmd);
704
705 if (hr == S_OK)
706 {
707 pThis->RunMessageLoop();
708 hr = pThis->PostMessageLoop();
709 }
710
711 return hr;
712 }
#define S_OK
Definition: intsafe.h:52
HRESULT hr
Definition: shlfolder.c:183

◆ RunMessageLoop()

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

Definition at line 741 of file atlbase.h.

742 {
743 MSG msg;
744 while (GetMessage(&msg, 0, 0, 0) > 0)
745 {
748 }
749 }
#define msg(x)
Definition: auth_time.c:54
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1829
BOOL WINAPI TranslateMessage(_In_ const MSG *)
#define GetMessage
Definition: winuser.h:5780
#define DispatchMessage
Definition: winuser.h:5755

◆ UninitializeCom()

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

Definition at line 772 of file atlbase.h.

773 {
775 }
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
Definition: compobj.c:2067

◆ Unlock()

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

Reimplemented from ATL::CAtlModule.

Definition at line 719 of file atlbase.h.

720 {
722 if (lRet == 0)
723 {
725 }
726 return lRet;
727 }
ULONG WINAPI CoReleaseServerProcess(void)
Definition: compobj.c:4193
long LONG
Definition: pedump.c:60
#define WM_QUIT
Definition: winuser.h:1613
#define PostThreadMessage
Definition: winuser.h:5823

◆ WinMain()

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

Definition at line 679 of file atlbase.h.

680 {
681 HRESULT hr = T::InitializeCom();
682 if (FAILED(hr))
683 return hr;
684
685 T* pThis = static_cast<T*>(this);
686
687 LPCTSTR lpCommandLine = GetCommandLine();
688 if (pThis->ParseCommandLine(lpCommandLine, &hr))
689 {
690 hr = pThis->Run(nShowCmd);
691 }
692
693 T::UninitializeCom();
694 return hr;
695 }
#define FAILED(hr)
Definition: intsafe.h:51
#define GetCommandLine
Definition: winbase.h:3670
const CHAR * LPCTSTR
Definition: xmlstorage.h:193

Member Data Documentation

◆ m_dwMainThreadID

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

Definition at line 665 of file atlbase.h.

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


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