model_server/IDE/configshell/cfshell.cxx
//////////////////////////////////////////////////////////
//
// Out of process Server support
//
//
// Start factories
//
Out of process Server support
Start factories
Out of process Server support Start factories
BOOL CFactory::StartFactories()
{
	CFactoryData* pStart = &g_FactoryDataArray[0] ;
	const CFactoryData* pEnd =
		&g_FactoryDataArray[g_cFactoryDataEntries - 1] ;
	for(CFactoryData* pData = pStart ; pData <= pEnd ; pData++)
	{
		pData->m_pIClassFactory = NULL ;
		pData->m_dwRegister = NULL ;
		IClassFactory* pIFactory = new CFactory(pData) ;
		DWORD dwRegister ;
		HRESULT hr = ::CoRegisterClassObject(
		                  *pData->m_pCLSID,
		                  static_cast<IUnknown*>(pIFactory),
		                  CLSCTX_LOCAL_SERVER,
		                  REGCLS_MULTIPLEUSE,
		                  &dwRegister) ;
		if (FAILED(hr))
		{
			pIFactory->Release() ;
			return FALSE ;
		}
		pData->m_pIClassFactory = pIFactory ;
		pData->m_dwRegister = dwRegister ;
	}
	return TRUE ;
}
BOOL CFactory :: StartFactories ( ) { CFactoryData * pStart = & g_FactoryDataArray [ 0 ] ; const CFactoryData * pEnd = & g_FactoryDataArray [ g_cFactoryDataEntries - 1 ] ; for ( CFactoryData * pData = pStart ; pData <= pEnd ; pData ++ ) { pData -> m_pIClassFactory = NULL ; pData -> m_dwRegister = NULL ; IClassFactory * pIFactory = new CFactory ( pData ) ; DWORD dwRegister ; HRESULT hr = :: CoRegisterClassObject ( * pData -> m_pCLSID , static_cast < IUnknown * > ( pIFactory ) , CLSCTX_LOCAL_SERVER , REGCLS_MULTIPLEUSE , & dwRegister ) ; if ( FAILED ( hr ) ) { pIFactory -> Release ( ) ; return FALSE ; } pData -> m_pIClassFactory = pIFactory ; pData -> m_dwRegister = dwRegister ; } return TRUE ; }
Out of process Server support
Start factories
Out of process Server support Start factories
// Initialize the class factory pointer and cookie. // Create the class factory for this component. // Register the class factory. // REGCLS_MULTI_SEPARATE, //@Multi // Set the data.