www.pudn.com > VCAMS.rar > Msg.cpp


// Msg.cpp : Implementation of CAMStoneTimeApp and DLL registration. 
 
#include "stdafx.h" 
#include "AMStoneTime.h" 
#include "Msg.h" 
#include "AMMain.h" 
#include "GetMsgDialog.h" 
///////////////////////////////////////////////////////////////////////////// 
// 
 
STDMETHODIMP CMsg::InterfaceSupportsErrorInfo(REFIID riid) 
{ 
	static const IID* arr[] =  
	{ 
		&IID_IMsg, 
	}; 
 
	for (int i=0;iget_Method(&bszMethod); 
	strMethod = bszMethod; 
	if (strMethod == "NLN") 
	{ 
		// path : NLN 用户上线 
		CAMMain*	AMMainDlg = NULL; 
		AMMainDlg	= (CAMMain *)AfxGetApp()->GetMainWnd(); 
 
		if (!AMMainDlg) 
			return E_POINTER; 
		AMMainDlg->m_lUserNum	=	AMMainDlg->m_lUserNum + 1; 
		 
		CComBSTR	bszLoginName, bszUserName; 
		CString		strLoginName, strUserName; 
		pSMsg->GetParamStr( 2, &bszLoginName ); 
		pSMsg->GetParamStr( 3, &bszUserName ); 
		strLoginName = bszLoginName; 
		strUserName	 = bszUserName; 
		HTREEITEM hRoot = NULL; 
		hRoot = AMMainDlg->m_ctlTreeList.InsertItem(strUserName, 0, 0, NULL); 
		AMMainDlg->m_arUserName.Add( strUserName ); 
		AMMainDlg->m_arLoginName.Add( strLoginName ); 
//		hRoot = AMMainDlg->m_ctlTreeList.InsertItem(strLoginName, 0, 0, hRoot);	 
	} 
/*	else if(strMethod == "FLN") 
	{ 
		CAMMain*	AMMainDlg = NULL; 
		long		lPos; 
		long		lUserNum; 
		HTREEITEM	hRoot = NULL; 
		AMMainDlg	= (CAMMain *)AfxGetApp()->GetMainWnd();		 
		if (!AMMainDlg) 
			return E_POINTER;	 
		 
		CComBSTR	bszLoginName, bszUserName; 
		CString		strLoginName, strUserName; 
		 
		pSMsg->GetParamStr( 0, &bszLoginName ); 
		strLoginName	= bszLoginName; 
 
		lUserNum		=	AMMainDlg->m_arLoginName.GetSize(); 
		for(lPos = 0; lPos < lUserNum ;lPos++ ) 
		{ 
			if( AMMainDlg->m_arLoginName.GetAt( lPos ) == strLoginName) 
			{ 
				AMMainDlg->m_arLoginName.RemoveAt( lPos ); 
				break; 
			} 
		} 
 
		strUserName		=	AMMainDlg->m_arUserName.GetAt( lPos ); 
		AMMainDlg->m_arUserName.RemoveAt( lPos ); 
		hRoot		=	AMMainDlg->m_ctlTreeList.GetRootItem(); 
		CString		strTestl; 
 
		for(; strUserName != AMMainDlg->m_ctlTreeList.GetItemText( hRoot ); ) 
		{ 
			UINT	nCode(0); 
 
			hRoot = AMMainDlg->m_ctlTreeList.GetNextItem( hRoot, nCode ); 
		} 
		AMMainDlg->m_ctlTreeList.DeleteItem( hRoot ); 
	}*/ 
	return E_NOTIMPL;	 
} 
 
//============================ 
//处理登录成功信息 
//============================ 
STDMETHODIMP CMsg::OnAMSignIn(AMSIGNINSTATE State, BSTR bszLoginName, LONG nErrCode) 
{		 
	return E_NOTIMPL; 
} 
 
//=========================== 
//用户收到消息 
//=========================== 
STDMETHODIMP CMsg::OnAMMsgReceive(IAMMessage * pMsg) 
{ 
	AMMSGCONTENTTYPE	AMContentType; 
	CString				strName; 
	CGetMsgDialog		GetMessageDlg; 
	CComBSTR			bszMsg; 
 
	pMsg->get_MsgContentType( &AMContentType ); 
	pMsg->GetMsgContent(AMContentType, &bszMsg); 
	GetMessageDlg.m_strRichEdit = bszMsg; 
	GetMessageDlg.DoModal();	 
 
 
	return E_NOTIMPL; 
} 
 
STDMETHODIMP CMsg::OnAMReceive(IAMSysMsg * pSMsg) 
{ 
	return E_NOTIMPL; 
} 
STDMETHODIMP CMsg::OnAMInitData(IDispatch * pDsp, LONG * pbReturn) 
{ 
		if (pbReturn == NULL) 
			return E_POINTER; 
			 
		return E_NOTIMPL; 
} 
STDMETHODIMP CMsg::OnAMDestroy(LONG * pbReturn) 
{ 
	if (pbReturn == NULL) 
		return E_POINTER; 
			 
	return E_NOTIMPL; 
} 
STDMETHODIMP CMsg::OnAMError(LONG nErrCode, LONG nTrID) 
{ 
	return E_NOTIMPL; 
} 
STDMETHODIMP CMsg::OnAMConnectError(LONG nErrCode) 
{ 
	return E_NOTIMPL; 
} 
STDMETHODIMP CMsg::OnAMLoadView(AMVIEWTYPE nViewType, LONG nCount) 
{ 
	return E_NOTIMPL; 
} 
STDMETHODIMP CMsg::OnAMViewLoadChild(IAMView * pView, BSTR bszParam) 
{ 
	return E_NOTIMPL; 
} 
STDMETHODIMP CMsg::OnAMViewItemLoadChild(IAMViewItem * pViewItem, AMVIEWTYPE nViewType, LONG nViewID, BSTR bszParam) 
{ 
	return E_NOTIMPL; 
} 
STDMETHODIMP CMsg::OnAMMeetNtyReceive(IAMSysMsg * pSMsg) 
{ 
	return E_NOTIMPL; 
} 
STDMETHODIMP CMsg::OnAMMeetReceive(IAMSysMsg * pSMsg) 
{ 
	return E_NOTIMPL; 
} 
STDMETHODIMP CMsg::OnAMMeetMsgReceive(IAMMessage * pMsg) 
{ 
	return E_NOTIMPL; 
} 
STDMETHODIMP CMsg::OnAMMeetConnectClosed(BSTR bszMeetID) 
{ 
	return E_NOTIMPL; 
} 
STDMETHODIMP CMsg::Challenges() 
{ 
	return E_NOTIMPL; 
} 
STDMETHODIMP CMsg::OnAMMeetError(LONG nErrCode, BSTR bszMeetID, LONG nTrID) 
{ 
	return E_NOTIMPL; 
}