2025-02-27 16:58:16 +08:00
// FQXBox_Group.cpp : implementation file
//
# include "stdafx.h"
# include "corpsms.h"
# include "FQXBox_Group.h"
# ifdef _DEBUG
# define new DEBUG_NEW
# undef THIS_FILE
static char THIS_FILE [ ] = __FILE__ ;
# endif
/////////////////////////////////////////////////////////////////////////////
// CFQXBox_Group dialog
# include "MainFrm.h"
# include "ProcessSocket.h"
# include "..\public\ProxySocket\CBase64Coding.hpp"
CFQXBox_Group : : CFQXBox_Group ( CWnd * pParent /*=NULL*/ )
: CDialog ( CFQXBox_Group : : IDD , pParent )
{
//{{AFX_DATA_INIT(CFQXBox_Group)
//}}AFX_DATA_INIT
m_bInit = false ;
m_bRefresh = false ;
m_bShowToday = true ;
m_bShowProcess = false ;
m_bSendType = 0 ; //ֱ<> Ӵ<EFBFBD> <D3B4> ڷ<EFBFBD> <DAB7> <EFBFBD> ,1-<2D> <> <EFBFBD> 촰<EFBFBD> ڷ<EFBFBD> <DAB7> <EFBFBD>
m_bSending = false ;
}
void CFQXBox_Group : : DoDataExchange ( CDataExchange * pDX )
{
CDialog : : DoDataExchange ( pDX ) ;
//{{AFX_DATA_MAP(CFQXBox_Group)
DDX_Control ( pDX , IDC_QXBOX_GROUP_LIST , m_wndList ) ;
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP ( CFQXBox_Group , CDialog )
//{{AFX_MSG_MAP(CFQXBox_Group)
ON_WM_SIZE ( )
ON_NOTIFY ( NM_DBLCLK , IDC_QXBOX_GROUP_LIST , OnDblclkSmsdsList )
ON_NOTIFY ( NM_RCLICK , IDC_QXBOX_GROUP_LIST , OnRclickSmsdsList )
ON_NOTIFY ( LVN_KEYDOWN , IDC_QXBOX_GROUP_LIST , OnKeydownSmsdsList )
ON_WM_DESTROY ( )
//}}AFX_MSG_MAP
ON_COMMAND ( MENU_QXBOX_GROUP_ADD , On_DS_Add )
ON_COMMAND ( MENU_QXBOX_GROUP_MODIFY , On_DS_Modify )
ON_COMMAND ( MENU_QXBOX_GROUP_DEL , On_DS_Del )
ON_COMMAND ( MENU_QXBOX_GROUP_SEND , On_DS_Send )
ON_COMMAND ( MENU_QXBOX_GROUP_CHAT , On_DS_Chat )
ON_COMMAND ( MENU_QXBOX_GROUP_REFRESH , On_DS_Refresh )
ON_COMMAND ( MENU_QXBOX_GROUP_MOBILEADD , On_DS_MobileAdd )
ON_COMMAND ( MENU_QXBOX_GROUP_MOBILEDEL , On_DS_MobileDel )
ON_COMMAND ( MENU_QXBOX_GROUP_RESTART , On_DS_Restart )
ON_COMMAND ( MENU_QXBOX_GROUP_CANCEL , On_DS_Cancel )
ON_WM_TIMER ( )
END_MESSAGE_MAP ( )
/////////////////////////////////////////////////////////////////////////////
// CFQXBox_Group message handlers
BOOL CFQXBox_Group : : OnInitDialog ( )
{
CDialog : : OnInitDialog ( ) ;
//ȡ<> ù<EFBFBD> <C3B9> ò<EFBFBD> <C3B2> <EFBFBD>
//CMainFrame * pFrame = static_cast <CMainFrame *>((CMainFrame *)AfxGetMainWnd());
this - > GetParent ( ) - > GetParentFrame ( ) ;
m_pMainFrame = ( CMainFrame * ) this - > GetParent ( ) - > GetParentFrame ( ) ;
m_pSocket = & m_pMainFrame - > m_Socket ;
m_AdoRS . SetAdoConnection ( & m_pMainFrame - > m_adoConnection ) ;
//<2F> <> ʼ <EFBFBD> <CABC> List
m_Image . Create ( 16 , 16 , ILC_COLOR32 | ILC_MASK , 5 , 5 ) ;
m_Image . Add ( AfxGetApp ( ) - > LoadIcon ( IDI_L_QXGROUP_TZ ) ) ;
m_Image . Add ( AfxGetApp ( ) - > LoadIcon ( IDI_L_QXGROUP_QZ ) ) ;
m_Image . Add ( AfxGetApp ( ) - > LoadIcon ( IDI_L_LOCK ) ) ;
m_wndList . SubClassWindow2 ( ) ;
m_wndList . SetHeadings ( _T ( " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ,50; ״̬,90;<3B> <> <EFBFBD> <EFBFBD> ,70; Ⱥ<> <C8BA> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ,160;<3B> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ,70;<3B> <> ע,200;<3B> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ϣ,200;<3B> <> <EFBFBD> <EFBFBD> <EFBFBD> û<EFBFBD> ,90;<3B> <> <EFBFBD> <EFBFBD> ʱ<EFBFBD> <CAB1> ,120;" ) ) ;
m_wndList . SetGridLines ( true ) ;
m_wndList . SetImageList ( & m_Image , LVSIL_SMALL ) ;
//m_wndList.SetBkColor( RGB(237,191,175) );
//m_wndList.SetTextBkColor( RGB(237,191,175) );
//m_wndModify.SetMainFrame( pFrame );
m_wndModify . Create ( IDD_QXBOX_GROUP_MODIFY , this ) ;
m_wndModify . CenterWindow ( ) ;
m_bInit = true ;
return TRUE ; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CFQXBox_Group : : OnSize ( UINT nType , int cx , int cy )
{
CDialog : : OnSize ( nType , cx , cy ) ;
if ( m_bInit )
{
m_wndList . MoveWindow ( 0 , 0 , cx , cy ) ;
}
}
BOOL CFQXBox_Group : : ReHide ( )
{
ShowWindow ( SW_HIDE ) ;
return true ;
}
BOOL CFQXBox_Group : : ReShow ( BOOL bRefresh )
{
ShowWindow ( SW_SHOW ) ;
if ( bRefresh | | ! m_bRefresh )
{
RefreshInfo ( ) ;
}
return true ;
}
BOOL CFQXBox_Group : : RefreshInfo ( )
{
REQ_QXBox_Group_See * pSee = new REQ_QXBox_Group_See ;
memset ( pSee , 0 , sizeof ( REQ_QXBox_Group_See ) ) ;
pSee - > lCorpID = m_pMainFrame - > m_lCorpID ;
pSee - > lUserID = m_pMainFrame - > m_lUserID ;
m_pMainFrame - > SendFrame ( SMSFUNC_QXBOX_GROUP_SEE , ( BYTE * ) pSee , sizeof ( REQ_QXBox_Group_See ) ) ; //<2F> <> <EFBFBD> <EFBFBD> ȡ<EFBFBD> <C8A1> <EFBFBD> ϵ<EFBFBD> <CFB5> <EFBFBD> <EFBFBD> <EFBFBD>
return true ;
}
long CFQXBox_Group : : GetCurrentSelected ( )
{
POSITION pos = m_wndList . GetFirstSelectedItemPosition ( ) ;
if ( pos )
{
return m_wndList . GetNextSelectedItem ( pos ) ;
}
return - 1 ;
}
BOOL CFQXBox_Group : : ProcessSocket ( Socket_Head_Add * pHead , BYTE * pFrame )
{
m_bRefresh = true ; //<2F> <> ˢ<EFBFBD> ¹<EFBFBD>
CString str ;
if ( pHead - > lFuncType = = SMSFUNC_QXBOX_GROUP_SEE ) //<2F> <> <EFBFBD> <EFBFBD> ȡ<EFBFBD> û<EFBFBD> <C3BB> <EFBFBD> Ϣ
{
ANS_QXBox_Group_See * pSee = ( ANS_QXBox_Group_See * ) pFrame ;
ANS_QXBox_Group_SeeData * pSeeData = ( ANS_QXBox_Group_SeeData * ) ( pFrame + sizeof ( ANS_QXBox_Group_See ) ) ;
CString strTemp ;
if ( pSee - > lRtx_GroupID > 0 & & pSee - > lCount = = 1 ) //ֻ<> <D6BB> һ <EFBFBD> <D2BB> <EFBFBD> <EFBFBD> <EFBFBD> 룬<EFBFBD> <EBA3AC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
{
if ( pSeeData - > lStatus ! = 1 ) //״̬<D7B4> <CCAC> <EFBFBD> ԣ<EFBFBD> <D4A3> <EFBFBD> <EFBFBD> ɲ<EFBFBD> <C9B2> <EFBFBD>
return true ;
ANS_QXBox_Group_MobileData * pMobileData = ( ANS_QXBox_Group_MobileData * ) ( pFrame + sizeof ( ANS_QXBox_Group_See ) + sizeof ( ANS_QXBox_Group_SeeData ) ) ;
pSeeData - > lItem = pSee - > lItem ;
m_wndModify . SetParam ( this , * pSeeData , 1 , pMobileData , pSee - > lMobileCount , this - > m_pMainFrame - > m_Ans_Login2 . szQJCM ) ;
m_wndModify . ShowData ( ) ;
return true ;
}
m_wndList . ShowWindow ( SW_HIDE ) ;
m_wndList . DeleteAllItems ( ) ;
for ( int i = 0 ; i < pSee - > lCount ; i + + )
{
ShowInList ( - 1 , pSeeData ) ;
pSeeData + + ;
}
m_wndList . ShowWindow ( SW_SHOW ) ;
return true ;
}
if ( pHead - > lFuncType = = SMSFUNC_QXBOX_GROUP_ADD ) //<2F> <EFBFBD> <DEB8> û<EFBFBD>
{
ANS_QXBox_Group_Add * pAdd = ( ANS_QXBox_Group_Add * ) pFrame ;
if ( pAdd - > bOK )
{
ShowInList ( - 1 , & pAdd - > qxGroup ) ;
}
else
{
str . Format ( _T ( " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ⱥ<EFBFBD> <EFBFBD> ʧ<EFBFBD> ܣ<EFBFBD> %s" ) , pAdd - > szErrMsg ) ;
MessageBox ( str , _T ( " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> " ) , MB_ICONWARNING ) ;
}
return true ;
}
if ( pHead - > lFuncType = = SMSFUNC_QXBOX_GROUP_MODIFY ) //<2F> <EFBFBD> <DEB8> û<EFBFBD>
{
ANS_QXBox_Group_Modify * pModify = ( ANS_QXBox_Group_Modify * ) pFrame ;
if ( pModify - > bOK )
{
if ( pModify - > lItem = = - 100 ) //ɾ<> <C9BE> <EFBFBD> <EFBFBD> ¼
{
this - > RefreshInfo ( ) ;
}
else
{
ShowInList ( pModify - > lItem , & pModify - > qxGroup ) ;
}
}
else
{
str . Format ( _T ( " <EFBFBD> <EFBFBD> Ⱥ<EFBFBD> <EFBFBD> ʧ<EFBFBD> ܣ<EFBFBD> %s" ) , pModify - > szErrMsg ) ;
MessageBox ( str , _T ( " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> " ) , MB_ICONWARNING ) ;
}
return true ;
}
//ɾ<> <C9BE> <EFBFBD> û<EFBFBD>
if ( pHead - > lFuncType = = SMSFUNC_QXBOX_GROUP_DEL )
{
this - > RefreshInfo ( ) ; //<2F> <> <EFBFBD> <EFBFBD> ɾ<EFBFBD> <C9BE> ״̬
/*
ANS_PLFile_Del * pDel = ( ANS_PLFile_Del * ) pFrame ;
ANS_PLFile_DelData * pDelData = ( ANS_PLFile_DelData * ) ( pFrame + sizeof ( ANS_PLFile_Del ) ) ;
POSITION pos , pos2 ;
ANS_PLTaskMms_SeeData * pPLFileData ;
for ( int i = pDel - > lCount - 1 ; i > = 0 ; i - - )
{
if ( pDelData [ i ] . lPLFileID ) //ɾ<> <C9BE> <EFBFBD> ɹ<EFBFBD>
{
pos = ( POSITION ) m_wndList . GetItemData ( pDelData [ i ] . lItem ) ;
pos2 = pos ;
pPLFileData = m_PLFile . GetNext ( pos ) ;
if ( pPLFileData - > lPLFileID = = pDelData [ i ] . lPLFileID ) //ID<49> <44> ͬ<EFBFBD> IJſ <C4B2> ɾ<EFBFBD> <C9BE>
{
delete pPLFileData ; //<2F> <> ɾ<EFBFBD> <C9BE> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
m_PLFile . RemoveAt ( pos2 ) ; //<2F> <> <EFBFBD> б <EFBFBD> <D0B1> <EFBFBD> ɾ<EFBFBD> <C9BE>
m_wndList . DeleteItem ( pDelData [ i ] . lItem ) ; //<2F> <> ListCtrl<72> <6C> ɾ<EFBFBD> <C9BE>
}
}
}
return true ;
*/
}
if ( pHead - > lFuncType = = SMSFUNC_QXBOX_GROUP_MOBILE )
{
return this - > m_wndModify . ProcessSocket ( pHead , pFrame ) ;
}
if ( pHead - > lFuncType = = SMSFUNC_QXBOX_GROUP_SEND )
{
ANS_QXBox_Group_Send * pSend = ( ANS_QXBox_Group_Send * ) pFrame ;
if ( pSend - > bOK & & pSend - > ret . lRtx_GroupTaskID > 0 )
{
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ҫ<EFBFBD> ⷢ<EFBFBD> <E2B7A2> <EFBFBD> <EFBFBD> ־д<D6BE> <D0B4> <EFBFBD> <EFBFBD> <EFBFBD> ݿ<EFBFBD>
CString strTimer = _T ( " NULL " ) ;
CString strSubTime = _T ( " NULL " ) ;
if ( COleDateTime ( pSend - > ret . tTimer ) . GetStatus ( ) = = COleDateTime : : valid )
{
strTimer . Format ( _T ( " #%04d-%02d-%02d %02d:%02d:%02d# " ) , pSend - > ret . tTimer . wYear , pSend - > ret . tTimer . wMonth , pSend - > ret . tTimer . wDay , pSend - > ret . tTimer . wHour , pSend - > ret . tTimer . wMinute , pSend - > ret . tTimer . wSecond ) ;
}
if ( COleDateTime ( pSend - > ret . tSubTime ) . GetStatus ( ) = = COleDateTime : : valid )
{
strSubTime . Format ( _T ( " #%04d-%02d-%02d %02d:%02d:%02d# " ) , pSend - > ret . tSubTime . wYear , pSend - > ret . tSubTime . wMonth , pSend - > ret . tSubTime . wDay , pSend - > ret . tSubTime . wHour , pSend - > ret . tSubTime . wMinute , pSend - > ret . tSubTime . wSecond ) ;
}
CString strDataMsg ;
if ( pSend - > ret . lMsgDataType = = 0 )
strDataMsg = m_strEndSendMsg ; //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͵<EFBFBD> <CDB5> <EFBFBD> <EFBFBD> <EFBFBD>
if ( pSend - > ret . lMsgDataType = = 1 )
{
strDataMsg = pSend - > ret . szMsgImageName ;
CFile file ;
if ( file . Open ( pSend - > ret . szMsgImageName , CFile : : modeRead | CFile : : shareDenyNone ) )
{
2025-04-14 17:24:47 +08:00
DWORD lSize = ( DWORD ) file . GetLength ( ) ;
2025-02-27 16:58:16 +08:00
if ( lSize < 200 * 1024 )
{
BYTE * pData = new BYTE [ lSize ] ;
file . Read ( pData , lSize ) ;
CBase64Coding base64coding ;
base64coding . Encode ( pData , lSize , strDataMsg ) ;
delete pData ;
}
}
}
CString str ;
str . Format ( _T ( " insert into QXLog (Rtx_GroupTaskID,Mobile,Sender,Rtx_GroupID,GroupID,GroupName,Status,Timer,MsgType,MsgDataType,MobileAll,MobileSent,SubTime,MsgData) values (%d,'%s','%s',%d,'%s','%s',%d,%s,%d,%d,%d,%d,%s,'%s') " ) ,
pSend - > ret . lRtx_GroupTaskID ,
SqlStr ( pSend - > ret . szMobile ) ,
SqlStr ( pSend - > ret . szSender ) ,
pSend - > ret . lRtx_GroupID ,
pSend - > ret . szGroupID ,
SqlStr ( pSend - > ret . szGroupName ) ,
pSend - > ret . lStatus ,
strTimer ,
0 , //<2F> <> <EFBFBD> <EFBFBD>
pSend - > ret . lMsgDataType ,
pSend - > ret . lMobileAll ,
pSend - > ret . lMobileSent ,
strSubTime ,
SqlStr ( strDataMsg ) ) ;
m_AdoRS . Open ( str ) ;
if ( pSend - > ret . lMsgDataType = = 1 & & ! pSend - > ret . bEnd ) //<2F> <> <EFBFBD> <EFBFBD> ͼƬ<CDBC> <C6AC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> δ<EFBFBD> <CEB4> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ɣ <EFBFBD> <C9A3> <EFBFBD> Ҫ<EFBFBD> <D2AA> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
{
this - > SendNextImage ( pSend - > ret . lRtx_GroupTaskID ) ;
}
else
{
m_bSending = false ;
KillTimer ( 1 ) ; //ֹͣ<CDA3> <D6B9> ʱ<EFBFBD> <CAB1> <EFBFBD> <EFBFBD>
}
}
else
{
str . Format ( _T ( " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ϣʧ<EFBFBD> ܣ<EFBFBD> %s" ) , pSend - > szErrMsg ) ;
MessageBox ( str , _T ( " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> " ) , MB_ICONWARNING ) ;
}
return true ;
}
if ( pHead - > lFuncType = = SMSFUNC_QXBOX_GROUP_SENDIMAGE )
{
ANS_QXBox_Group_SendImage * pSend = ( ANS_QXBox_Group_SendImage * ) pFrame ;
if ( pSend - > lRtx_GroupTaskID > 0 )
{
if ( ! pSend - > bEnd ) //<2F> <> <EFBFBD> <EFBFBD> ͼƬ<CDBC> <C6AC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> δ<EFBFBD> <CEB4> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ɣ <EFBFBD> <C9A3> <EFBFBD> Ҫ<EFBFBD> <D2AA> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
{
this - > SendNextImage ( pSend - > lRtx_GroupTaskID ) ;
}
else
{
m_bSending = false ;
KillTimer ( 1 ) ; //ֹͣ<CDA3> <D6B9> ʱ<EFBFBD> <CAB1> <EFBFBD> <EFBFBD>
}
}
return true ;
}
return false ;
}
void CFQXBox_Group : : SetToday ( BOOL bToday )
{
if ( m_bShowToday ! = bToday )
{
m_bShowToday = bToday ;
m_bRefresh = false ;
}
}
void CFQXBox_Group : : OnDblclkSmsdsList ( NMHDR * pNMHDR , LRESULT * pResult )
{
* pResult = 0 ;
On_DS_Modify ( ) ;
}
void CFQXBox_Group : : OnRclickSmsdsList ( NMHDR * pNMHDR , LRESULT * pResult )
{
* pResult = 0 ;
ShowRMenu ( ) ;
}
void CFQXBox_Group : : OnKeydownSmsdsList ( NMHDR * pNMHDR , LRESULT * pResult )
{
LV_KEYDOWN * pLVKeyDow = ( LV_KEYDOWN * ) pNMHDR ;
* pResult = 0 ;
if ( pLVKeyDow - > wVKey = = VK_DELETE )
{
On_DS_Del ( ) ;
}
if ( pLVKeyDow - > wVKey = = VK_SPACE )
{
On_DS_Modify ( ) ;
}
if ( pLVKeyDow - > wVKey = = ' R ' | | pLVKeyDow - > wVKey = = ' r ' )
{
On_DS_Refresh ( ) ;
}
if ( pLVKeyDow - > wVKey = = ' A ' | | pLVKeyDow - > wVKey = = ' a ' )
{
m_wndList . SelectAllItems ( ) ;
}
}
void CFQXBox_Group : : OnOK ( )
{
//CDialog::OnOK();
}
void CFQXBox_Group : : OnCancel ( )
{
//CDialog::OnCancel();
}
void CFQXBox_Group : : ShowRMenu ( )
{
CMenu menu ;
menu . CreatePopupMenu ( ) ;
long lItem = this - > GetCurrentSelected ( ) ;
ANS_QXBox_Group_SeeData * pSeeData = NULL ;
BOOL bOper = false ;
if ( lItem > = 0 )
{
if ( m_wndList . GetItemData ( lItem ) > 0 )
{
pSeeData = m_qxGroup . GetAt ( ( POSITION ) m_wndList . GetItemData ( lItem ) ) ;
if ( pSeeData & & pSeeData - > lStatus = = 1 ) //<2F> ɲ<EFBFBD> <C9B2> <EFBFBD>
bOper = true ;
}
}
if ( m_pMainFrame - > GetUserPurview ( PURVIEW_GADDRESS_ADD , false ) )
{
menu . AppendMenu ( MF_STRING , MENU_QXBOX_GROUP_ADD , _T ( " <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ⱥ<EFBFBD> <C8BA> " ) ) ;
}
else
{
menu . AppendMenu ( MF_STRING | MF_DISABLED | MF_GRAYED , MENU_QXBOX_GROUP_ADD , _T ( " <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ⱥ<EFBFBD> <C8BA> " ) ) ;
}
menu . AppendMenu ( MF_SEPARATOR ) ;
if ( lItem > = 0 & & pSeeData & & bOper & & m_pMainFrame - > GetUserPurview ( PURVIEW_GADDRESS_MODIFY , false ) )
{
menu . AppendMenu ( MF_STRING , MENU_QXBOX_GROUP_MODIFY , _T ( " <20> <> <20> <> " ) ) ;
}
else
{
menu . AppendMenu ( MF_STRING | MF_DISABLED | MF_GRAYED , MENU_QXBOX_GROUP_MODIFY , _T ( " <20> <> <20> <> " ) ) ;
}
if ( lItem > = 0 & & pSeeData & & bOper & & m_pMainFrame - > GetUserPurview ( PURVIEW_GADDRESS_DEL , false ) )
{
menu . AppendMenu ( MF_STRING , MENU_QXBOX_GROUP_DEL , _T ( " ɾ <20> <> " ) ) ;
}
else
{
menu . AppendMenu ( MF_STRING | MF_DISABLED | MF_GRAYED , MENU_QXBOX_GROUP_DEL , _T ( " ɾ <20> <> " ) ) ;
}
menu . AppendMenu ( MF_SEPARATOR ) ;
if ( lItem > = 0 & & pSeeData & & pSeeData - > lStatus = = 2 )
{
menu . AppendMenu ( MF_STRING , MENU_QXBOX_GROUP_RESTART , _T ( " <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> " ) ) ;
}
if ( lItem > = 0 & & pSeeData & & pSeeData - > lStatus = = 2 ) //ע<> <D7A2> <EFBFBD> <EFBFBD> <EFBFBD> ĺ<DEB8> <C4BA> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ȡ<EFBFBD> <C8A1> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
{
menu . AppendMenu ( MF_STRING , MENU_QXBOX_GROUP_CANCEL , _T ( " ȡ<> <C8A1> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> " ) ) ;
}
if ( lItem > = 0 & & pSeeData & & pSeeData - > lType = = 0 ) //֪ͨȺ<D6AA> <C8BA> <EFBFBD> <EFBFBD> Ҫɾ<D2AA> <C9BE> <EFBFBD> ĺ<DEB8> <C4BA> <EFBFBD>
{
if ( lItem > = 0 & & pSeeData & & bOper & & m_pMainFrame - > GetUserPurview ( PURVIEW_GADDRESS_MODIFY , false ) )
{
menu . AppendMenu ( MF_STRING , MENU_QXBOX_GROUP_MOBILEADD , _T ( " <20> <> <EFBFBD> Ӻ<EFBFBD> <D3BA> <EFBFBD> " ) ) ;
}
else
{
menu . AppendMenu ( MF_STRING | MF_DISABLED | MF_GRAYED , MENU_QXBOX_GROUP_MODIFY , _T ( " <20> <> <EFBFBD> Ӻ<EFBFBD> <D3BA> <EFBFBD> " ) ) ;
}
if ( lItem > = 0 & & pSeeData & & bOper & & m_pMainFrame - > GetUserPurview ( PURVIEW_GADDRESS_DEL , false ) )
{
menu . AppendMenu ( MF_STRING , MENU_QXBOX_GROUP_MOBILEDEL , _T ( " ɾ<> <C9BE> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> " ) ) ;
}
else
{
menu . AppendMenu ( MF_STRING | MF_DISABLED | MF_GRAYED , MENU_QXBOX_GROUP_MOBILEDEL , _T ( " ɾ<> <C9BE> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> " ) ) ;
}
menu . AppendMenu ( MF_SEPARATOR ) ;
}
if ( lItem > = 0 & & pSeeData & & bOper & & pSeeData - > lMobileCount > 0 & & m_pMainFrame - > GetUserPurview ( PURVIEW_SENDP , false ) )
{
menu . AppendMenu ( MF_STRING , MENU_QXBOX_GROUP_SEND , _T ( " <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ϣ " ) ) ;
}
else
{
menu . AppendMenu ( MF_STRING | MF_DISABLED | MF_STRING , MENU_QXBOX_GROUP_SEND , _T ( " <20> <> <EFBFBD> Ͷ<EFBFBD> <CDB6> <EFBFBD> " ) ) ;
}
if ( lItem > = 0 & & pSeeData & & pSeeData - > lMobileCount > 0 & & m_pMainFrame - > GetUserPurview ( PURVIEW_SENDP , false ) )
{
menu . AppendMenu ( MF_STRING , MENU_QXBOX_GROUP_CHAT , _T ( " <20> շ<EFBFBD> <D5B7> <EFBFBD> ־ " ) ) ;
}
else
{
menu . AppendMenu ( MF_STRING | MF_DISABLED | MF_STRING , MENU_QXBOX_GROUP_CHAT , _T ( " <20> շ<EFBFBD> <D5B7> <EFBFBD> ־ " ) ) ;
}
//ˢ<> <CBA2>
menu . AppendMenu ( MF_STRING , MENU_QXBOX_GROUP_REFRESH , _T ( " ˢ <20> <> " ) ) ;
//<2F> <> ʾ <EFBFBD> ˵<EFBFBD>
POINT pt ;
: : GetCursorPos ( & pt ) ;
//this->ClientToScreen( &pt);
menu . TrackPopupMenu ( TPM_LEFTBUTTON | TPM_RIGHTBUTTON , pt . x , pt . y , this , NULL ) ;
menu . DestroyMenu ( ) ;
}
void CFQXBox_Group : : On_DS_Add ( )
{
ANS_QXBox_Group_SeeData data = { 0 } ;
m_wndModify . SetParam ( this , data , 0 , NULL , 0 , this - > m_pMainFrame - > m_Ans_Login2 . szQJCM ) ;
m_wndModify . ShowData ( ) ;
}
void CFQXBox_Group : : On_DS_MobileAdd ( )
{
long lItem = this - > GetCurrentSelected ( ) ;
ANS_QXBox_Group_SeeData * pSeeData = NULL ;
if ( lItem > = 0 )
{
if ( m_wndList . GetItemData ( lItem ) > 0 )
{
pSeeData = m_qxGroup . GetAt ( ( POSITION ) m_wndList . GetItemData ( lItem ) ) ;
}
}
if ( pSeeData )
{
if ( pSeeData - > lType = = 0 & & pSeeData - > lStatus ! = 1 ) //״̬<D7B4> <CCAC> <EFBFBD> ԣ<EFBFBD> <D4A3> <EFBFBD> <EFBFBD> ɲ<EFBFBD> <C9B2> <EFBFBD>
return ;
m_wndModify . SetParam ( this , * pSeeData , 2 , NULL , 0 , this - > m_pMainFrame - > m_Ans_Login2 . szQJCM ) ; //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
m_wndModify . ShowData ( ) ;
}
}
void CFQXBox_Group : : On_DS_MobileDel ( )
{
long lItem = this - > GetCurrentSelected ( ) ;
ANS_QXBox_Group_SeeData * pSeeData = NULL ;
if ( lItem > = 0 )
{
if ( m_wndList . GetItemData ( lItem ) > 0 )
{
pSeeData = m_qxGroup . GetAt ( ( POSITION ) m_wndList . GetItemData ( lItem ) ) ;
}
}
if ( pSeeData )
{
if ( pSeeData - > lType = = 0 & & pSeeData - > lStatus ! = 1 ) //״̬<D7B4> <CCAC> <EFBFBD> ԣ<EFBFBD> <D4A3> <EFBFBD> <EFBFBD> ɲ<EFBFBD> <C9B2> <EFBFBD>
return ;
m_wndModify . SetParam ( this , * pSeeData , 3 , NULL , 0 , this - > m_pMainFrame - > m_Ans_Login2 . szQJCM ) ; //ɾ<> <C9BE> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
m_wndModify . ShowData ( ) ;
}
}
void CFQXBox_Group : : On_DS_Modify ( )
{
long lItem = this - > GetCurrentSelected ( ) ;
ANS_QXBox_Group_SeeData * pSeeData = NULL ;
if ( lItem > = 0 )
{
if ( m_wndList . GetItemData ( lItem ) > 0 )
{
pSeeData = m_qxGroup . GetAt ( ( POSITION ) m_wndList . GetItemData ( lItem ) ) ;
}
}
if ( pSeeData )
{
if ( pSeeData - > lStatus ! = 1 ) //״̬<D7B4> <CCAC> <EFBFBD> ԣ<EFBFBD> <D4A3> <EFBFBD> <EFBFBD> ɲ<EFBFBD> <C9B2> <EFBFBD>
return ;
REQ_QXBox_Group_See * pSee = new REQ_QXBox_Group_See ;
memset ( pSee , 0 , sizeof ( REQ_QXBox_Group_See ) ) ;
pSee - > lCorpID = m_pMainFrame - > m_lCorpID ;
pSee - > lUserID = m_pMainFrame - > m_lUserID ;
pSee - > lRtx_GroupID = pSeeData - > lRtx_GroupID ;
pSee - > lItem = lItem ;
m_pMainFrame - > SendFrame ( SMSFUNC_QXBOX_GROUP_SEE , ( BYTE * ) pSee , sizeof ( REQ_QXBox_Group_See ) ) ; //<2F> <> <EFBFBD> <EFBFBD> ȡ<EFBFBD> <C8A1> <EFBFBD> ϵ<EFBFBD> <CFB5> <EFBFBD> <EFBFBD> <EFBFBD>
}
}
void CFQXBox_Group : : On_DS_Del ( )
{
long lRet = MessageBox ( _T ( " ȷʵҪɾ<EFBFBD> <EFBFBD> ѡ <EFBFBD> е ļ<EFBFBD> ¼<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> " ) , _T ( " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> " ) , MB_ICONQUESTION | MB_YESNO | MB_DEFBUTTON2 ) ;
if ( lRet ! = IDYES )
return ;
long lCount = m_wndList . GetSelectedCount ( ) ;
if ( lCount < = 0 )
return ;
long lSize = sizeof ( REQ_QXBox_Group_Del ) + sizeof ( ANS_QXBox_Group_DelData ) * lCount ;
BYTE * pDelSend = new BYTE [ lSize ] ; memset ( pDelSend , 0 , lSize ) ;
REQ_QXBox_Group_Del * pDel = ( REQ_QXBox_Group_Del * ) pDelSend ; //ͷ
ANS_QXBox_Group_DelData * pDelData = ( ANS_QXBox_Group_DelData * ) ( pDelSend + sizeof ( REQ_QXBox_Group_Del ) ) ;
pDel - > lCorpID = m_pMainFrame - > m_lCorpID ;
pDel - > lUserID = m_pMainFrame - > m_lUserID ;
pDel - > lCount = 0 ;
POSITION pos = m_wndList . GetFirstSelectedItemPosition ( ) ;
while ( pos )
{
long lItem = m_wndList . GetNextSelectedItem ( pos ) ;
POSITION pos = ( POSITION ) m_wndList . GetItemData ( lItem ) ;
if ( pos )
{
ANS_QXBox_Group_SeeData * pSeeData = m_qxGroup . GetAt ( pos ) ;
if ( pSeeData & & ( pSeeData - > lStatus = = 1 | | pSeeData - > lStatus = = 2 ) )
{
pDelData - > lItem = lItem ;
pDelData - > lRtx_GroupID = pSeeData - > lRtx_GroupID ;
pDel - > lCount + + ;
pDelData + + ;
}
}
}
m_pMainFrame - > SendFrame ( SMSFUNC_QXBOX_GROUP_DEL , pDelSend , lSize ) ;
}
BOOL CFQXBox_Group : : On_DS_Chat_Show ( REQ_QXBox_Group_SendData SendData , CString strMsg )
{
CSingleLock cl ( & m_Chat_Lock , true ) ;
BOOL bShow = false ;
//<2F> <> <EFBFBD> жϴ<D0B6> Ⱥ<EFBFBD> Ƿ<EFBFBD> <C7B7> ڴ<EFBFBD> <DAB4> <EFBFBD> ֮<EFBFBD> С <EFBFBD>
long lCount = m_wndChat . GetCount ( ) ;
for ( int i = 0 ; i < lCount ; i + + )
{
DLG_QXBox_Group_Chat * pDlg = m_wndChat . GetAt ( i ) ;
if ( pDlg & & pDlg - > m_GroupPro . lRtx_GroupID = = SendData . lRtx_GroupID ) //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͬ
{
BOOL bSame = true ;
if ( _tcslen ( pDlg - > m_GroupPro . szMobile ) > 0 )
{
if ( CString ( SendData . szMobile ) ! = CString ( pDlg - > m_GroupPro . szMobile ) )
{
bSame = false ;
}
}
if ( bSame )
{
pDlg - > ShowChatLog2 ( SendData , strMsg , true ) ;
pDlg - > SetForegroundWindow ( ) ;
pDlg - > FlashWindow ( false ) ;
bShow = true ;
}
}
}
return bShow ;
}
BOOL CFQXBox_Group : : On_DS_Chat_Add ( ANS_QXBox_Group_SeeData SeeData )
{
CSingleLock cl ( & m_Chat_Lock , true ) ;
//<2F> <> <EFBFBD> жϴ<D0B6> Ⱥ<EFBFBD> Ƿ<EFBFBD> <C7B7> ڴ<EFBFBD> <DAB4> <EFBFBD> ֮<EFBFBD> С <EFBFBD>
long lCount = m_wndChat . GetCount ( ) ;
for ( int i = 0 ; i < lCount ; i + + )
{
DLG_QXBox_Group_Chat * pDlg = m_wndChat . GetAt ( i ) ;
if ( pDlg & & pDlg - > m_GroupPro . lRtx_GroupID = = SeeData . lRtx_GroupID ) //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͬ
{
BOOL bSame = true ;
if ( CString ( SeeData . szMobile ) ! = CString ( pDlg - > m_GroupPro . szMobile ) )
{
bSame = false ;
}
if ( bSame )
{
pDlg - > SetForegroundWindow ( ) ;
pDlg - > FlashWindow ( false ) ;
return true ;
}
}
}
REQ_QXBox_Group_SendData send = { 0 } ;
send . lCorpID = SeeData . lCorpID ;
send . lUserID = SeeData . lUserID ;
send . lRtx_GroupID = SeeData . lRtx_GroupID ;
_tcscpy ( send . szSender , SeeData . szCreateUser ) ;
_tcscpy ( send . szMobile , SeeData . szMobile ) ;
_tcscpy ( send . szGroupID , SeeData . szGroupID ) ;
_tcscpy ( send . szGroupName , SeeData . szName ) ;
send . lStatus = 0 ;
send . lMsgType = 0 ; //<2F> <> <EFBFBD> <EFBFBD>
send . lMsgDataType = 0 ; //<2F> ı <EFBFBD>
send . lMobileAll = SeeData . lMobileCount ;
GetLocalTime ( & send . tSubTime ) ;
long lMaxChatLog = 50 ;
REQ_QXBox_Group_SendData * pSendData = new REQ_QXBox_Group_SendData [ lMaxChatLog ] ;
memset ( pSendData , 0 , sizeof ( REQ_QXBox_Group_SendData ) * lMaxChatLog ) ;
CString * pSendMsg = new CString [ lMaxChatLog ] ;
CString str ;
if ( _tcslen ( SeeData . szMobile ) > 0 )
str . Format ( _T ( " select top %d * from QXLog where Rtx_GroupID=%d and Mobile='%s' order by Subtime desc " ) , lMaxChatLog , SeeData . lRtx_GroupID , SeeData . szMobile ) ;
else
str . Format ( _T ( " select top %d * from QXLog where Rtx_GroupID=%d order by Subtime desc " ) , lMaxChatLog , SeeData . lRtx_GroupID ) ;
m_AdoRS . Open ( str ) ;
CString strID ;
int iIndex = 0 ;
while ( ! m_AdoRS . IsEOF ( ) )
{
long lQXLogID = 0 ;
m_AdoRS . GetCollect ( _T ( " QXLogID " ) , lQXLogID ) ;
m_AdoRS . GetCollect ( _T ( " MsgData " ) , pSendMsg [ iIndex ] ) ;
m_AdoRS . GetCollect ( _T ( " Rtx_GroupTaskID " ) , pSendData [ iIndex ] . lRtx_GroupTaskID ) ;
m_AdoRS . GetCollect ( _T ( " Rtx_GroupID " ) , pSendData [ iIndex ] . lRtx_GroupID ) ;
m_AdoRS . GetCollect ( _T ( " GroupID " ) , pSendData [ iIndex ] . szGroupID ) ;
m_AdoRS . GetCollect ( _T ( " Mobile " ) , pSendData [ iIndex ] . szMobile ) ;
m_AdoRS . GetCollect ( _T ( " Sender " ) , pSendData [ iIndex ] . szSender ) ;
m_AdoRS . GetCollect ( _T ( " GroupName " ) , pSendData [ iIndex ] . szGroupName ) ;
m_AdoRS . GetCollect ( _T ( " Status " ) , pSendData [ iIndex ] . lStatus ) ;
m_AdoRS . GetCollect ( _T ( " CorpID " ) , pSendData [ iIndex ] . lCorpID ) ;
m_AdoRS . GetCollect ( _T ( " UserID " ) , pSendData [ iIndex ] . lUserID ) ;
m_AdoRS . GetCollect ( _T ( " Timer " ) , pSendData [ iIndex ] . tTimer ) ;
m_AdoRS . GetCollect ( _T ( " MsgType " ) , pSendData [ iIndex ] . lMsgType ) ;
m_AdoRS . GetCollect ( _T ( " MsgImageName " ) , pSendData [ iIndex ] . szMsgImageName ) ;
//m_AdoRS.GetCollect(_T("MsgImageLen") , pSendData[iIndex].lImageLen );
m_AdoRS . GetCollect ( _T ( " MsgDataType " ) , pSendData [ iIndex ] . lMsgDataType ) ;
m_AdoRS . GetCollect ( _T ( " MobileAll " ) , pSendData [ iIndex ] . lMobileAll ) ;
m_AdoRS . GetCollect ( _T ( " MobileSent " ) , pSendData [ iIndex ] . lMobileSent ) ;
m_AdoRS . GetCollect ( _T ( " SubTime " ) , pSendData [ iIndex ] . tSubTime ) ;
long lReader = 1 ;
m_AdoRS . GetCollect ( _T ( " Reader " ) , lReader ) ; //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> Ѷ<EFBFBD> <D1B6> <EFBFBD> δ<EFBFBD> <CEB4>
if ( lReader = = 0 ) //δ<> <CEB4> <EFBFBD> ģ<EFBFBD> <C4A3> <EFBFBD> Ϊ<EFBFBD> Ѷ<EFBFBD>
{
if ( strID . GetLength ( ) > 0 )
str . Format ( _T ( " ,%d " ) , lQXLogID ) ;
else
str . Format ( _T ( " %d " ) , lQXLogID ) ;
strID = strID + str ;
}
iIndex + + ;
m_AdoRS . MoveNext ( ) ;
if ( iIndex > = lMaxChatLog )
break ;
}
if ( strID . GetLength ( ) > 0 )
{
str . Format ( _T ( " update QXLog set Reader=1 where QXLogID in (%s) " ) , strID ) ;
m_AdoRS . Open ( str ) ;
}
DLG_QXBox_Group_Chat * pDlg = new DLG_QXBox_Group_Chat ( this ) ;
pDlg - > SetParam ( send , pSendData , pSendMsg , iIndex ) ;
pDlg - > Create ( IDD_QXBOX_GROUP_CHAT , GetDesktopWindow ( ) ) ;
m_wndChat . Add ( pDlg ) ; //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
pDlg - > ShowWindow ( SW_SHOW ) ;
pDlg - > SetForegroundWindow ( ) ;
pDlg - > FlashWindow ( 0 ) ;
return true ;
}
void CFQXBox_Group : : On_DS_Chat ( )
{
long lItem = this - > GetCurrentSelected ( ) ;
ANS_QXBox_Group_SeeData * pSeeData = NULL ;
if ( lItem > = 0 )
{
if ( m_wndList . GetItemData ( lItem ) > 0 )
{
pSeeData = m_qxGroup . GetAt ( ( POSITION ) m_wndList . GetItemData ( lItem ) ) ;
}
}
if ( pSeeData )
{
/*
if ( pSeeData - > lStatus ! = 1 ) //״̬<D7B4> <CCAC> <EFBFBD> ԣ<EFBFBD> <D4A3> <EFBFBD> <EFBFBD> ɲ<EFBFBD> <C9B2> <EFBFBD>
return ;
*/
}
else
{
return ;
}
_tcscpy ( pSeeData - > szCreateUser , m_pMainFrame - > m_pCurUser - > szUser ) ;
On_DS_Chat_Add ( * pSeeData ) ;
}
BOOL CFQXBox_Group : : SendMsgData ( REQ_QXBox_Group_SendData send , CString strMsgIn , CString strMsgImageName , long lSendType )
{
if ( send . lMsgDataType = = 0 ) //<2F> ı <EFBFBD>
{
send . lMsgDataLen = ( strMsgIn . GetLength ( ) + 1 ) * sizeof ( TCHAR ) ;
send . bEnd = true ;
}
if ( send . lMsgDataType = = 1 ) //ͼƬ
{
try
{
if ( m_ImageFile . m_hFile ! = INVALID_HANDLE_VALUE )
m_ImageFile . Close ( ) ; //<2F> <> <EFBFBD> <EFBFBD> ʲô<CAB2> <C3B4> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ȹر<C8B9>
}
catch ( . . . )
{
}
if ( ! m_ImageFile . Open ( strMsgImageName , CFile : : modeRead | CFile : : shareDenyNone ) )
{
CString str ;
str . Format ( _T ( " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͼƬ<EFBFBD> ļ<EFBFBD> ʧ<EFBFBD> <EFBFBD> :%s" ) , strMsgImageName ) ;
MessageBox ( str , _T ( " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> " ) , MB_ICONWARNING ) ;
return false ;
}
2025-04-14 17:24:47 +08:00
long lLen = ( long ) m_ImageFile . GetLength ( ) ;
2025-02-27 16:58:16 +08:00
long lSendLen = 100 * 1024 ; //ÿ<> η<EFBFBD> <CEB7> <EFBFBD> 100k
if ( lLen < = lSendLen )
{
lSendLen = ( long ) lLen ;
send . bEnd = true ;
}
send . lMsgDataLen = lSendLen ;
send . lImageLen = lLen ;
}
if ( m_bSending )
{
MessageBox ( _T ( " ϵͳæ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Qͨ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʧ<EFBFBD> ܣ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ժ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ԣ<EFBFBD> " ) , _T ( " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> " ) , MB_ICONWARNING ) ;
return false ;
}
m_bSending = true ;
SetTimer ( 1 , 30000 , NULL ) ; //30<33> <30> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʱ<EFBFBD> <CAB1> <EFBFBD> <EFBFBD> <EFBFBD> ͡<EFBFBD>
long lSize = sizeof ( REQ_QXBox_Group_Send ) + send . lMsgDataLen ;
BYTE * pData = new BYTE [ lSize ] ;
memset ( pData , 0 , lSize ) ;
REQ_QXBox_Group_Send * pSend = ( REQ_QXBox_Group_Send * ) pData ;
BYTE * pMsgData = pData + sizeof ( REQ_QXBox_Group_Send ) ;
pSend - > lCorpID = m_pMainFrame - > m_lCorpID ;
pSend - > lUserID = m_pMainFrame - > m_lUserID ;
pSend - > send = send ;
_tcscpy ( pSend - > send . szSender , this - > m_pMainFrame - > m_pCurUser - > szUser ) ;
if ( pSend - > send . lMsgDataType = = 0 ) //<2F> ı <EFBFBD>
{
_tcscpy ( ( TCHAR * ) pMsgData , strMsgIn ) ;
m_strEndSendMsg = strMsgIn ;
}
if ( pSend - > send . lMsgDataType = = 1 ) //ͼƬ
{
try
{
m_ImageFile . Read ( pMsgData , send . lMsgDataLen ) ;
if ( send . bEnd )
{
if ( m_ImageFile . m_hFile ! = INVALID_HANDLE_VALUE )
m_ImageFile . Close ( ) ;
}
}
catch ( . . . )
{
}
m_strEndSendMsg = send . szMsgImageName ;
}
m_bSendType = lSendType ; //ֱ<> Ӵ<EFBFBD> <D3B4> ڷ<EFBFBD> <DAB7> <EFBFBD>
m_pMainFrame - > SendFrame ( SMSFUNC_QXBOX_GROUP_SEND , pData , lSize ) ;
if ( send . lMsgDataType = = 1 & & ! send . bEnd & & m_bSendType = = 0 ) //ͼƬ<CDBC> <C6AC> <EFBFBD> ϣ<EFBFBD> <CFA3> <EFBFBD> <EFBFBD> <EFBFBD> δ<EFBFBD> ϴ<EFBFBD> <CFB4> <EFBFBD> <EFBFBD> <EFBFBD>
{
m_bShowProcess = true ;
m_DlgProcess . SetProcessTitle ( _T ( " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ϴ<EFBFBD> ͼƬ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ..." ) ) ;
m_DlgProcess . SetProcess ( send . lImageLen , 0 ) ;
if ( m_DlgProcess . DoModal ( ) ! = IDOK ) //<2F> <> ʾ <EFBFBD> <CABE> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
{
//ȡ<> <C8A1> <EFBFBD> ϲ <EFBFBD> <CFB2> ɹ<EFBFBD>
//return ;
}
m_bShowProcess = false ;
}
return true ;
}
void CFQXBox_Group : : On_DS_Send ( )
{
long lItem = this - > GetCurrentSelected ( ) ;
ANS_QXBox_Group_SeeData * pSeeData = NULL ;
if ( lItem > = 0 )
{
if ( m_wndList . GetItemData ( lItem ) > 0 )
{
pSeeData = m_qxGroup . GetAt ( ( POSITION ) m_wndList . GetItemData ( lItem ) ) ;
}
}
if ( pSeeData )
{
if ( pSeeData - > lStatus ! = 1 ) //״̬<D7B4> <CCAC> <EFBFBD> ԣ<EFBFBD> <D4A3> <EFBFBD> <EFBFBD> ɲ<EFBFBD> <C9B2> <EFBFBD>
return ;
DLG_QXBox_Group_Send dlg ( this ) ;
REQ_QXBox_Group_SendData send = { 0 } ;
send . lCorpID = pSeeData - > lCorpID ;
send . lUserID = pSeeData - > lUserID ;
send . lRtx_GroupID = pSeeData - > lRtx_GroupID ;
_tcscpy ( send . szSender , m_pMainFrame - > m_pCurUser - > szUser ) ;
_tcscpy ( send . szGroupID , pSeeData - > szGroupID ) ;
_tcscpy ( send . szGroupName , pSeeData - > szName ) ;
send . lStatus = 0 ;
send . lMsgType = 0 ; //<2F> <> <EFBFBD> <EFBFBD>
send . lMsgDataType = 0 ; //<2F> ı <EFBFBD>
send . lMobileAll = pSeeData - > lMobileCount ;
GetLocalTime ( & send . tSubTime ) ;
m_strEndSendMsg = _T ( " " ) ;
dlg . SetParam ( send , _T ( " " ) , 0 ) ;
if ( dlg . DoModal ( ) = = IDOK )
{
send = dlg . GetParam ( ) ;
SendMsgData ( send , dlg . m_strMsgIn , send . szMsgImageName , 0 ) ; //<2F> <> <EFBFBD> <EFBFBD> ֱ<EFBFBD> ӷ<EFBFBD> <D3B7> <EFBFBD>
}
}
}
void CFQXBox_Group : : On_DS_Refresh ( )
{
RefreshInfo ( ) ;
}
void CFQXBox_Group : : On_DS_Restart ( )
{
long lItem = this - > GetCurrentSelected ( ) ;
ANS_QXBox_Group_SeeData * pSeeData = NULL ;
if ( lItem > = 0 )
{
if ( m_wndList . GetItemData ( lItem ) > 0 )
{
pSeeData = m_qxGroup . GetAt ( ( POSITION ) m_wndList . GetItemData ( lItem ) ) ;
}
}
if ( pSeeData )
{
if ( pSeeData - > lStatus ! = 2 ) //״̬<D7B4> <CCAC> <EFBFBD> ԣ<EFBFBD> <D4A3> <EFBFBD> <EFBFBD> ɲ<EFBFBD> <C9B2> <EFBFBD>
return ;
long lSize = sizeof ( REQ_QXBox_Group_Modify ) ;
BYTE * pData = new BYTE [ lSize ] ;
memset ( pData , 0 , lSize ) ;
REQ_QXBox_Group_Modify * pModify = ( REQ_QXBox_Group_Modify * ) pData ;
ANS_QXBox_Group_MobileData * pMobile = ( ANS_QXBox_Group_MobileData * ) ( pData + sizeof ( REQ_QXBox_Group_Modify ) ) ;
pModify - > lCorpID = m_pMainFrame - > m_lCorpID ;
pModify - > lUserID = m_pMainFrame - > m_lUserID ;
pModify - > lItem = lItem ;
pModify - > qxGroup = * pSeeData ;
pModify - > bModifyMobile = false ;
pModify - > lMobileCount = 0 ;
pModify - > lModifyStatus = 1 ; //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
m_pMainFrame - > SendFrame ( SMSFUNC_QXBOX_GROUP_MODIFY , ( BYTE * ) pData , lSize ) ;
}
}
void CFQXBox_Group : : On_DS_Cancel ( )
{
long lItem = this - > GetCurrentSelected ( ) ;
ANS_QXBox_Group_SeeData * pSeeData = NULL ;
if ( lItem > = 0 )
{
if ( m_wndList . GetItemData ( lItem ) > 0 )
{
pSeeData = m_qxGroup . GetAt ( ( POSITION ) m_wndList . GetItemData ( lItem ) ) ;
}
}
if ( pSeeData )
{
if ( pSeeData - > lStatus ! = 2 ) //״̬<D7B4> <CCAC> <EFBFBD> ԣ<EFBFBD> <D4A3> <EFBFBD> <EFBFBD> ɲ<EFBFBD> <C9B2> <EFBFBD>
return ;
long lSize = sizeof ( REQ_QXBox_Group_Modify ) ;
BYTE * pData = new BYTE [ lSize ] ;
memset ( pData , 0 , lSize ) ;
REQ_QXBox_Group_Modify * pModify = ( REQ_QXBox_Group_Modify * ) pData ;
ANS_QXBox_Group_MobileData * pMobile = ( ANS_QXBox_Group_MobileData * ) ( pData + sizeof ( REQ_QXBox_Group_Modify ) ) ;
pModify - > lCorpID = m_pMainFrame - > m_lCorpID ;
pModify - > lUserID = m_pMainFrame - > m_lUserID ;
pModify - > lItem = lItem ;
pModify - > qxGroup = * pSeeData ;
pModify - > bModifyMobile = false ;
pModify - > lMobileCount = 0 ;
pModify - > lModifyStatus = 2 ; //ȡ<> <C8A1> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
m_pMainFrame - > SendFrame ( SMSFUNC_QXBOX_GROUP_MODIFY , ( BYTE * ) pData , lSize ) ;
}
}
void CFQXBox_Group : : Close_Data ( )
{
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> е <EFBFBD> <D0B5> <EFBFBD> <EFBFBD> <EFBFBD>
while ( ! m_qxGroup . IsEmpty ( ) )
{
ANS_QXBox_Group_SeeData * pData = m_qxGroup . GetHead ( ) ;
m_qxGroup . RemoveHead ( ) ;
delete pData ;
}
}
void CFQXBox_Group : : OnDestroy ( )
{
Close_Data ( ) ;
CDialog : : OnDestroy ( ) ;
CSingleLock cl ( & m_Chat_Lock , true ) ;
long lCount = m_wndChat . GetCount ( ) ;
for ( int i = 0 ; i < lCount ; i + + )
{
DLG_QXBox_Group_Chat * pDlg = m_wndChat . GetAt ( i ) ;
if ( pDlg )
{
//pDlg->SendMessage(WM_CLOSE);
//delete pDlg;
pDlg - > DestroyWindow ( ) ;
}
}
m_wndChat . RemoveAll ( ) ;
cl . Unlock ( ) ;
}
int CFQXBox_Group : : ShowInList ( int lItem , ANS_QXBox_Group_SeeData * pSeeData )
{
CString strTemp ;
long lCount = lItem ;
long lIcon = 0 ; //Ĭ<> <C4AC> ֪ͨȺ
if ( pSeeData - > lType = = 1 ) //Q<> <51> Ⱥ
lIcon = 1 ;
if ( pSeeData - > lStatus = = 0 | | pSeeData - > lStatus = = 2 ) //<2F> <> <EFBFBD> ڲ<EFBFBD> <DAB2> <EFBFBD>
lIcon = 2 ;
if ( lCount < 0 )
{
//m_wndList.SetHeadings(_T("<22> <> <EFBFBD> <EFBFBD> ,50; ״̬,90;<3B> <> <EFBFBD> <EFBFBD> ,70; Ⱥ<> <C8BA> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ,160;<3B> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ,70;<3B> <> ע,200;<3B> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ϣ,200;<3B> <> <EFBFBD> <EFBFBD> <EFBFBD> û<EFBFBD> ,90;<3B> <> <EFBFBD> <EFBFBD> ʱ<EFBFBD> <CAB1> ,120;"));
lCount = m_wndList . GetItemCount ( ) ;
strTemp . Format ( _T ( " %d " ) , lCount + 1 ) ;
m_wndList . InsertItem ( lCount , strTemp , lIcon ) ;
}
else
{
m_wndList . SetItem ( lCount , 0 , LVIF_IMAGE , NULL , lIcon , NULL , NULL , NULL ) ;
}
if ( lCount < 0 | | lCount > m_wndList . GetItemCount ( ) )
return - 1 ;
switch ( pSeeData - > lStatus )
{
case 0 :
strTemp = _T ( " <EFBFBD> <EFBFBD> <EFBFBD> ڲ<EFBFBD> <EFBFBD> <EFBFBD> " ) ;
break ;
case 1 :
strTemp = _T ( " " ) ;
break ;
case 2 :
strTemp = _T ( " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʧ<EFBFBD> <EFBFBD> " ) ;
break ;
default :
strTemp = _T ( " δ֪״̬ " ) ;
break ;
}
long lTemp = 1 ;
m_wndList . SetItemText ( lCount , lTemp + + , strTemp ) ;
switch ( pSeeData - > lType )
{
case 0 :
strTemp = _T ( " Ⱥ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> " ) ;
break ;
case 1 :
strTemp = _T ( " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> " ) ;
break ;
default :
strTemp = _T ( " δ֪Ⱥ " ) ;
break ;
}
m_wndList . SetItemText ( lCount , lTemp + + , strTemp ) ;
m_wndList . SetItemText ( lCount , lTemp + + , pSeeData - > szName ) ;
strTemp . Format ( _T ( " %8d " ) , pSeeData - > lMobileCount ) ;
m_wndList . SetItemText ( lCount , lTemp + + , strTemp ) ;
m_wndList . SetItemText ( lCount , lTemp + + , pSeeData - > szBZ ) ;
m_wndList . SetItemText ( lCount , lTemp + + , pSeeData - > szOperMsg ) ;
m_wndList . SetItemText ( lCount , lTemp + + , pSeeData - > szCreateUser ) ;
strTemp . Format ( _T ( " %04d.%02d.%02d " ) , pSeeData - > tCreateTime . wYear , pSeeData - > tCreateTime . wMonth , pSeeData - > tCreateTime . wDay ) ;
m_wndList . SetItemText ( lCount , lTemp + + , strTemp ) ;
//<2F> <> <EFBFBD> ²<EFBFBD> <C2B2> <EFBFBD> Ϊ<EFBFBD> <CEAA> <EFBFBD> <EFBFBD> <EFBFBD> ݸ<EFBFBD> <DDB8> µ<EFBFBD> <C2B5> ڴ<EFBFBD>
if ( lItem < 0 )
{
ANS_QXBox_Group_SeeData * pNewData = new ANS_QXBox_Group_SeeData ;
* pNewData = * pSeeData ;
POSITION pos = m_qxGroup . AddTail ( pNewData ) ;
2025-04-11 17:19:25 +08:00
m_wndList . SetItemData ( lCount , ( DWORD_PTR ) pos ) ;
2025-02-27 16:58:16 +08:00
}
else
{
ANS_QXBox_Group_SeeData * pSeeData2 = NULL ;
if ( m_wndList . GetItemData ( lItem ) > 0 )
{
pSeeData2 = m_qxGroup . GetAt ( ( POSITION ) m_wndList . GetItemData ( lItem ) ) ;
}
if ( pSeeData2 & & pSeeData2 - > lRtx_GroupID = = pSeeData - > lRtx_GroupID )
{
* pSeeData2 = * pSeeData ;
}
}
return 0 ;
}
int CFQXBox_Group : : GroupEndDialog ( DLG_QXBox_Group_Modify * pDlg , long lModifyType , ANS_QXBox_Group_SeeData data )
{
long lImageLen = 0 ;
long lImageLen2 = 0 ;
CFile fImageFile ;
if ( pDlg - > m_strHeadData . GetLength ( ) > 0 )
{
if ( pDlg - > m_strHeadData = = CString ( _T ( " [Image] " ) ) )
{
lImageLen = - 100 ; //<2F> <> ʾ <EFBFBD> <CABE> <EFBFBD> ı <EFBFBD> ԭ<EFBFBD> <D4AD> <EFBFBD> <EFBFBD>
}
else
{
if ( ! fImageFile . Open ( pDlg - > m_strHeadData , CFile : : modeRead ) )
{
CString str ;
str . Format ( _T ( " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͼƬ<EFBFBD> ļ<EFBFBD> ʧ<EFBFBD> <EFBFBD> :%s" ) , pDlg - > m_strHeadData ) ;
MessageBox ( str , _T ( " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> " ) , MB_ICONWARNING ) ;
return - 1 ;
}
2025-04-14 17:24:47 +08:00
lImageLen2 = ( DWORD ) fImageFile . GetLength ( ) ;
2025-02-27 16:58:16 +08:00
lImageLen = lImageLen2 ;
}
}
if ( lModifyType = = 0 )
{
long lMobileCount = 0 ;
if ( data . lType = = 1 ) //Q<> <51> Ⱥʱ<C8BA> <CAB1> <EFBFBD> ܽ<EFBFBD> <DCBD> в<EFBFBD> <D0B2> <EFBFBD>
{
lMobileCount = pDlg - > m_wndList . GetItemCount ( ) ;
}
long lSize = sizeof ( REQ_QXBox_Group_Add ) + sizeof ( ANS_QXBox_Group_MobileData ) * lMobileCount + lImageLen2 ;
BYTE * pData = new BYTE [ lSize ] ;
memset ( pData , 0 , lSize ) ;
REQ_QXBox_Group_Add * pAdd = ( REQ_QXBox_Group_Add * ) pData ;
ANS_QXBox_Group_MobileData * pMobile = ( ANS_QXBox_Group_MobileData * ) ( pData + sizeof ( REQ_QXBox_Group_Add ) ) ;
BYTE * pImageData = ( BYTE * ) ( pData + sizeof ( REQ_QXBox_Group_Add ) + sizeof ( ANS_QXBox_Group_MobileData ) * lMobileCount ) ;
memset ( pAdd , 0 , sizeof ( REQ_QXBox_Group_Add ) ) ;
pAdd - > lCorpID = m_pMainFrame - > m_lCorpID ;
pAdd - > lUserID = m_pMainFrame - > m_lUserID ;
pAdd - > lMobileCount = lMobileCount ;
pAdd - > qxGroup = data ;
pAdd - > qxGroup . lHeadData = lImageLen ; //ͼ<> <EFBFBD>
for ( int i = 0 ; i < lMobileCount ; i + + )
{
pDlg - > m_wndList . GetItemText ( i , 0 , pMobile - > szName , sizeof ( pMobile - > szName ) ) ;
pDlg - > m_wndList . GetItemText ( i , 1 , pMobile - > szMobile , sizeof ( pMobile - > szMobile ) ) ;
pMobile + + ;
}
if ( lImageLen2 > 0 )
{
fImageFile . Read ( pImageData , lImageLen2 ) ;
fImageFile . Close ( ) ;
}
m_pMainFrame - > SendFrame ( SMSFUNC_QXBOX_GROUP_ADD , ( BYTE * ) pData , lSize ) ;
}
if ( lModifyType = = 1 )
{
BOOL bModifyMobile = false ;
long lMobileCount = 0 ;
if ( data . lType = = 1 ) //Q<> <51> Ⱥʱ<C8BA> <CAB1> <EFBFBD> ܽ<EFBFBD> <DCBD> в<EFBFBD> <D0B2> <EFBFBD>
{
if ( pDlg - > m_bModify )
{
bModifyMobile = true ;
lMobileCount = pDlg - > m_wndList . GetItemCount ( ) ;
}
}
long lSize = sizeof ( REQ_QXBox_Group_Modify ) + sizeof ( ANS_QXBox_Group_MobileData ) * lMobileCount + lImageLen2 ;
BYTE * pData = new BYTE [ lSize ] ;
memset ( pData , 0 , lSize ) ;
REQ_QXBox_Group_Modify * pModify = ( REQ_QXBox_Group_Modify * ) pData ;
ANS_QXBox_Group_MobileData * pMobile = ( ANS_QXBox_Group_MobileData * ) ( pData + sizeof ( REQ_QXBox_Group_Modify ) ) ;
BYTE * pImageData = ( BYTE * ) ( pData + sizeof ( REQ_QXBox_Group_Add ) + sizeof ( ANS_QXBox_Group_MobileData ) * lMobileCount ) ;
pModify - > lCorpID = m_pMainFrame - > m_lCorpID ;
pModify - > lUserID = m_pMainFrame - > m_lUserID ;
pModify - > lItem = data . lItem ;
pModify - > qxGroup = data ;
pModify - > qxGroup . lHeadData = lImageLen ; //ͼ<> <EFBFBD>
pModify - > bModifyMobile = bModifyMobile ;
pModify - > lMobileCount = lMobileCount ;
for ( int i = 0 ; i < lMobileCount ; i + + )
{
pDlg - > m_wndList . GetItemText ( i , 0 , pMobile - > szName , sizeof ( pMobile - > szName ) ) ;
pDlg - > m_wndList . GetItemText ( i , 1 , pMobile - > szMobile , sizeof ( pMobile - > szMobile ) ) ;
pMobile + + ;
}
if ( lImageLen2 > 0 )
{
fImageFile . Read ( pImageData , lImageLen2 ) ;
fImageFile . Close ( ) ;
}
m_pMainFrame - > SendFrame ( SMSFUNC_QXBOX_GROUP_MODIFY , ( BYTE * ) pData , lSize ) ;
}
if ( lModifyType = = 2 | | lModifyType = = 3 )
{
this - > RefreshInfo ( ) ;
}
return 0 ;
}
int CFQXBox_Group : : SendNextImage ( long lRtx_GroupTaskID )
{
try
{
if ( m_ImageFile . m_hFile ! = INVALID_HANDLE_VALUE ) //<2F> ļ<EFBFBD> <C4BC> <EFBFBD> <EFBFBD> <EFBFBD>
{
BOOL bEnd = false ;
2025-04-14 17:24:47 +08:00
DWORD lLen = ( DWORD ) m_ImageFile . GetLength ( ) ;
DWORD lPos = ( DWORD ) m_ImageFile . GetPosition ( ) ;
2025-02-27 16:58:16 +08:00
if ( lPos < lLen )
{
long lPosAll = lLen / 1024 ;
long lPosBegin = lPos / 1024 ;
if ( lPosAll = = lPosBegin )
lPosAll + + ;
if ( lPosAll < = 0 ) lPosAll = 1 ;
if ( m_bSendType = = 0 & & m_bShowProcess )
this - > m_DlgProcess . SetProcess ( lPosAll , lPosBegin ) ;
long lSendLen = 200 * 1024 ; //ÿ<> η<EFBFBD> <CEB7> <EFBFBD> 100k
2025-04-14 17:24:47 +08:00
if ( ( long ) ( lLen - lPos ) < = lSendLen )
2025-02-27 16:58:16 +08:00
{
lSendLen = ( long ) ( lLen - lPos ) ;
bEnd = true ;
if ( m_bSendType = = 0 & & m_bShowProcess )
this - > m_DlgProcess . SetProcess ( lPosAll , lPosAll ) ;
}
long lSize = sizeof ( REQ_QXBox_Group_SendImage ) + lSendLen ;
BYTE * pData = new BYTE [ lSize ] ;
memset ( pData , 0 , lSize ) ;
REQ_QXBox_Group_SendImage * pSend = ( REQ_QXBox_Group_SendImage * ) pData ;
BYTE * pMsgData = pData + sizeof ( REQ_QXBox_Group_SendImage ) ;
pSend - > lRtx_GroupTaskID = lRtx_GroupTaskID ;
pSend - > lAllLen = lLen ;
pSend - > lLen = lSendLen ;
pSend - > bEnd = bEnd ;
m_ImageFile . Read ( pMsgData , lSendLen ) ;
m_pMainFrame - > SendFrame ( SMSFUNC_QXBOX_GROUP_SENDIMAGE , pData , lSize ) ;
return 1 ;
}
}
}
catch ( . . . )
{
}
if ( m_bShowProcess )
{
m_DlgProcess . SetProcess ( 5 , 5 ) ; //Ĭ<> Ͻ<EFBFBD> <CFBD> <EFBFBD>
m_bShowProcess = false ;
}
try
{
if ( m_ImageFile . m_hFile ! = INVALID_HANDLE_VALUE )
m_ImageFile . Close ( ) ;
} catch ( . . . )
{
}
return 0 ;
}
void CFQXBox_Group : : ChatPop_Del ( DLG_QXBox_Group_Chat * pPop )
{
try
{
CSingleLock cl ( & m_Chat_Lock , true ) ;
//<2F> <> <EFBFBD> жϴ˺<CFB4> <CBBA> <EFBFBD> <EFBFBD> Ƿ<EFBFBD> <C7B7> <EFBFBD> <EFBFBD> <EFBFBD>
long lCount = m_wndChat . GetCount ( ) ;
for ( int i = 0 ; i < lCount ; i + + )
{
DLG_QXBox_Group_Chat * pDlg = m_wndChat . GetAt ( i ) ;
if ( pDlg & & pDlg = = pPop ) //ָ<> <D6B8> <EFBFBD> <EFBFBD> ͬ
{
m_wndChat . RemoveAt ( i ) ;
/*
try
{
delete pDlg ;
}
catch ( . . . )
{
}
*/
return ;
}
}
}
catch ( . . . )
{
}
}
void CFQXBox_Group : : OnTimer ( UINT_PTR nIDEvent )
{
if ( nIDEvent = = 1 )
{
KillTimer ( nIDEvent ) ;
m_bSending = false ;
}
CDialog : : OnTimer ( nIDEvent ) ;
}