void Application::Initialize()
        {
            BOOST_ASSERT( m_IsInitialized == false );
            
            Super::Initialize();

            // Initialize loaded plug-ins
            PluginList::iterator pluginIter = m_Plugins.begin();
            while ( pluginIter != m_Plugins.end() )
            {
                PluginPtr plugin = (*pluginIter);
                plugin->Initialize();

                ++pluginIter;
            }

            // Initialize registered subsystems
            SubsystemList::iterator subsystemIter = m_Subsystems.begin();
            while ( subsystemIter != m_Subsystems.end() )
            {
                SubsystemPtr subsystem = (*subsystemIter);
                subsystem->Initialize();

                ++subsystemIter;
            }

            m_IsInitialized = true;

            OnInitialized( EventArgs( *this ) );
        }
LOGICAL COpenGL::InitGL(HDC hDC)
{
	m_hDC = hDC;
	if (SetWindowPixelFormat() == LOGICAL_FALSE)
		return LOGICAL_FALSE;
	
	if (CreateViewGLContext() == LOGICAL_FALSE)
		return LOGICAL_FALSE;

	MakeGLContextCurrent();
	OnSetDefaultOptions();
	OnInitialized();
	MakeGLContextNotCurrent();

	return LOGICAL_TRUE;
}
Exemple #3
0
//////////////////
// Handle notification from browser window: parse args and pass to specific
// virtual handler function.
//
int CFolderDialog::OnMessage(UINT msg, LPARAM lp)
{
	switch (msg) {
	case BFFM_INITIALIZED:
		OnInitialized();
		return 0;
	case BFFM_IUNKNOWN:
		OnIUnknown((IUnknown*)lp);
		return 0;
	case BFFM_SELCHANGED:
		OnSelChanged((LPCITEMIDLIST)lp);
		return 0;
	case BFFM_VALIDATEFAILED:
		return OnValidateFailed((LPCTSTR)lp);
	default:
		TRACE(_T("***Warning: unknown message %d in CFolderDialog::OnMessage\n"));
	}
	return 0;
}
void cdxCDynamicWnd::DoInitWindow(CWnd & rWnd, const CSize & szInitial)
{
	ASSERT(::IsWindow(rWnd.m_hWnd) && szInitial.cx && szInitial.cy);	// ensure the window exists ...

	m_iDisabled		=	0;
	m_pWnd		=	&rWnd;
	m_szInitial	=	szInitial;
	m_szMin		=	szInitial;

	/*
	 * this window will flicker somewhat deadly if you do not have the
	 * WS_CLIPCHILDREN style set for you window.
	 * You may like to use the following line anywhere
	 * to apply it:
	 
		  CWnd::ModifyStyle(0,WS_CLIPCHILDREN);

    */

#ifdef _DEBUG
	if(!(rWnd.GetStyle() & WS_CLIPCHILDREN) && !(m_nFlags & flSWPCopyBits))
	{
		TRACE(_T("***\n"
					"*** cdxCDynamicWnd class note: If your window flickers too much, add the WS_CLIPCHILDREN style to it\n"
					"***                            or try to set the flSWPCopyBits flags !!!\n"
					"***\n"));
	}
#endif

	//
	// now, if a DYNAMIC MAP is been defined,
	// we start working with it
	//

	const __dynEntry	*pEntry,*pLast	=	NULL;
	UINT					nInitCnt	=	GetCtrlCount();

	if(pLast = __getDynMap(pLast))
	{
		HWND		hwnd;
		SBYTES	bytes;

		for(pEntry = pLast; pEntry->type != __end; ++pEntry)
		{
			if((pEntry->id != DYNAMIC_MAP_DEFAULT_ID)
				&& !( hwnd = ::GetDlgItem(m_pWnd->m_hWnd,pEntry->id) ))
			{
				TRACE(_T("*** NOTE[cdxCDynamicWnd::DoInitWindow()]: Dynamic map initialization: There's no control with the id 0x%lx !\n"),pEntry->id);
				continue;
			}

			switch(pEntry->type)
			{
				case	__bytes:

					bytes[X1]	=	pEntry->b1;
					bytes[Y1]	=	pEntry->b2;
					bytes[X2]	=	pEntry->b3;
					bytes[Y2]	=	pEntry->b4;
					break;

				case	__modes:
					
					_translate((Mode)pEntry->b1,bytes[X1],bytes[X2]);
					_translate((Mode)pEntry->b2,bytes[Y1],bytes[Y2]);
					break;

				default:

					ASSERT(false);		// never come here !!!!!
					break;
			}

			if(pEntry->id == DYNAMIC_MAP_DEFAULT_ID)
				AllControls(bytes,false,false);
			else
				AddSzControl(hwnd,bytes,M_szNull,false);
		}
	}

	//
	// handle creation flags
	//

	if(m_nFlags & flSizeIcon)
	{
		m_pSizeIcon	=	WNEW cdxCSizeIconCtrl;
		VERIFY( m_pSizeIcon->Create(m_pWnd) );

		AddSzControl(m_pSizeIcon->m_hWnd,BotRight,M_szNull,false);
		m_pSizeIcon->ShowWindow(SW_SHOW);
	}

	m_bIsAntiFlickering	=	false;
	m_nMyTimerID			=	DEFAULT_TIMER_ID;
	m_dwClassStyle			=	::GetClassLong(*m_pWnd,GCL_STYLE) & (CS_VREDRAW|CS_HREDRAW);

	OnInitialized();

	if(nInitCnt < GetCtrlCount())
		Layout();
}