本文整理汇总了C++中CJabberProto::IqAdd方法的典型用法代码示例。如果您正苦于以下问题:C++ CJabberProto::IqAdd方法的具体用法?C++ CJabberProto::IqAdd怎么用?C++ CJabberProto::IqAdd使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CJabberProto
的用法示例。
在下文中一共展示了CJabberProto::IqAdd方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: iq
static INT_PTR CALLBACK JabberChangePasswordDlgProc( HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam )
{
CJabberProto* ppro = (CJabberProto*)GetWindowLongPtr( hwndDlg, GWLP_USERDATA );
switch ( msg ) {
case WM_INITDIALOG:
ppro = (CJabberProto*)lParam;
SetWindowLongPtr( hwndDlg, GWLP_USERDATA, ( LONG_PTR )lParam );
WindowSetIcon( hwndDlg, ppro, "key" );
TranslateDialogDefault( hwndDlg );
if ( ppro->m_bJabberOnline && ppro->m_ThreadInfo!=NULL ) {
TCHAR text[1024];
mir_sntprintf( text, SIZEOF( text ), _T("%s %[email protected]") _T(TCHAR_STR_PARAM), TranslateT( "Set New Password for" ), ppro->m_ThreadInfo->username, ppro->m_ThreadInfo->server );
SetWindowText( hwndDlg, text );
}
return TRUE;
case WM_COMMAND:
switch ( LOWORD( wParam )) {
case IDOK:
if ( ppro->m_bJabberOnline && ppro->m_ThreadInfo!=NULL ) {
TCHAR newPasswd[512], text[512];
GetDlgItemText( hwndDlg, IDC_NEWPASSWD, newPasswd, SIZEOF( newPasswd ));
GetDlgItemText( hwndDlg, IDC_NEWPASSWD2, text, SIZEOF( text ));
if ( _tcscmp( newPasswd, text )) {
MessageBox( hwndDlg, TranslateT( "New password does not match." ), TranslateT( "Change Password" ), MB_OK|MB_ICONSTOP|MB_SETFOREGROUND );
break;
}
GetDlgItemText( hwndDlg, IDC_OLDPASSWD, text, SIZEOF( text ));
if ( _tcscmp( text, ppro->m_ThreadInfo->password )) {
MessageBox( hwndDlg, TranslateT( "Current password is incorrect." ), TranslateT( "Change Password" ), MB_OK|MB_ICONSTOP|MB_SETFOREGROUND );
break;
}
_tcsncpy( ppro->m_ThreadInfo->newPassword, newPasswd, SIZEOF( ppro->m_ThreadInfo->newPassword ));
int iqId = ppro->SerialNext();
ppro->IqAdd( iqId, IQ_PROC_NONE, &CJabberProto::OnIqResultSetPassword );
XmlNodeIq iq( _T("set"), iqId, _A2T(ppro->m_ThreadInfo->server));
HXML q = iq << XQUERY( _T(JABBER_FEAT_REGISTER));
q << XCHILD( _T("username"), ppro->m_ThreadInfo->username );
q << XCHILD( _T("password"), newPasswd );
ppro->m_ThreadInfo->send( iq );
}
DestroyWindow( hwndDlg );
break;
case IDCANCEL:
DestroyWindow( hwndDlg );
break;
}
break;
case WM_CLOSE:
DestroyWindow( hwndDlg );
break;
case WM_DESTROY:
ppro->m_hwndJabberChangePassword = NULL;
WindowFreeIcon( hwndDlg );
break;
}
return FALSE;
}