Example #1
0
HRESULT CApplication::GetUI(IUserInterface** ppIUserInterface) throw()
{
	if ( ! ppIUserInterface )
		return E_POINTER;

//	return CoCreateInstance( CLSID_PeerProjectApplication, NULL, CLSCTX_ALL, IID_IUserInterface, (void**)ppIUserInterface );

	CApplication* pApp = new CApplication;
	if ( ! pApp ) return E_OUTOFMEMORY;
	*ppIUserInterface = static_cast< IUserInterface* >( pApp->GetInterface( IID_IUserInterface ) );
	return *ppIUserInterface ? S_OK : E_NOINTERFACE;
}
Example #2
0
HRESULT CApplication::GetSettings(ISettings** ppISettings) throw()
{
	if ( ! ppISettings )
		return E_POINTER;

//	return CoCreateInstance( CLSID_PeerProjectApplication, NULL, CLSCTX_ALL, IID_ISettings, (void**)ppISettings );

	CApplication* pApp = new CApplication;
	if ( ! pApp ) return E_OUTOFMEMORY;
	*ppISettings = static_cast< ISettings* >( pApp->GetInterface( IID_ISettings ) );
	return *ppISettings ? S_OK : E_NOINTERFACE;
}