BOOL CGatewayMaxonSerialV2ToRS232::InitErrorHandling()
{
    CErrorProducer errorProducer;
    CStdString strClassName(_T("GatewayMaxonSerialV2ToRS232"));

    if(m_pErrorHandling)
    {
        //Init ErrorProducer
        errorProducer.Init(PROTOCOL_STACK_LAYER, strClassName);
        m_pErrorHandling->InitErrorProducer(&errorProducer);
        return TRUE;
    }

    return FALSE;
}
Exemple #2
0
BOOL CChildWnd::LoadState(LPCTSTR pszName, BOOL bDefaultMaximise)
{
	CRect rcParent, rcChild;
	GetParent()->GetClientRect( &rcParent );

	if ( ! m_bPanelMode && Settings.LoadWindow( pszName, this ) )
	{
		if ( rcParent.Width() > 64 && rcParent.Height() > 32 )
		{
			GetWindowRect( &rcChild );
			GetParent()->ScreenToClient( &rcChild );

			if ( rcChild.right > rcParent.right || rcChild.bottom > rcParent.bottom )
			{
				rcChild.right	= min( rcChild.right, rcParent.right );
				rcChild.bottom	= min( rcChild.bottom, rcParent.bottom );
				MoveWindow( &rcChild );
			}
		}

		OnSkinChange();

		return TRUE;
	}

	if ( m_bPanelMode || bDefaultMaximise )		// Was m_bGroupMode
	{
		if ( m_bTabMode )
		{
			CString strClassName( GetRuntimeClass()->m_lpszClassName );
			CString strName( pszName ? pszName : (LPCTSTR)strClassName );
			m_nGroupSize = (float)theApp.GetProfileInt( _T("Windows"), strName + _T(".Splitter"), 500 ) / 1000;
		}

		if ( rcParent.Width() > 64 && rcParent.Height() > 32 )
			MoveWindow( &rcParent );
	}

	OnSkinChange();

	return FALSE;
}