コード例 #1
0
ファイル: enterdeposit.cpp プロジェクト: huilang22/Projects
void CEnterDeposit::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CEnterDeposit)
	DDX_Control(pDX, IDC_BED_OPEN_ITEM_COMBO, m_cbOpenItem);
	DDX_Control(pDX, IDC_BED_DEPOSIT_TYPE_COMBO, m_cDepositType);
	DDX_CBString(pDX, IDC_BED_DEPOSIT_TYPE_COMBO, m_sDepositType);
	DDX_Radio(pDX, IDC_PAY_METHOD_CHECK, m_nPayMethod);
	//}}AFX_DATA_MAP

	if (!m_aeManualCcauthCode.UpdateData(pDX->m_bSaveAndValidate))
    {
		AfxThrowUserException();
    }

	// DDV data validation on all user-editable fields
	if (pDX->m_bSaveAndValidate)
	{
		if ((!m_cDepositType.UpdateData(pDX->m_bSaveAndValidate)) || 
			(!m_aecDepositAmount.UpdateData(pDX->m_bSaveAndValidate)))
		{
			AfxThrowUserException();
		}
	}
}
コード例 #2
0
ファイル: cb_BrowseFolder.cpp プロジェクト: curtbinder/RAGen
BOOL cb_BrowseFolder(HWND hWnd, LPTSTR szFolder, LPCTSTR szTitle, TCHAR szPath[])
{
	BOOL bRet = FALSE;
	BROWSEINFO bi_BrowseInfo = {0};
	LPITEMIDLIST pid_Folder = NULL;

	TRY
	{
		// fill the browseinfo struct
		bi_BrowseInfo.hwndOwner = hWnd;
		bi_BrowseInfo.pidlRoot = NULL;
		bi_BrowseInfo.pszDisplayName = szFolder;
		bi_BrowseInfo.lpszTitle = szTitle;
		bi_BrowseInfo.ulFlags = 0;
		bi_BrowseInfo.lpfn = NULL;
		bi_BrowseInfo.lParam = NULL;
		bi_BrowseInfo.iImage = NULL;

		TRACE("Browsing for folder\n");
		pid_Folder = SHBrowseForFolder(&bi_BrowseInfo);
		if ( ! pid_Folder )
		{
			// Cancel was pressed, so exit
			TRACE("Cancel pressed.\n");
			AfxThrowUserException();
		}

		// gotta get the folder
		ZeroMemory(szPath, MAX_PATH*sizeof(TCHAR));
		if ( ! SHGetPathFromIDList(pid_Folder, szPath) )
		{
			// failed to get path
			TRACE("Failed to get full path\n");
			AfxMessageBox(_T("Unable to get selected path.  Please choose another folder.\n"));
			AfxThrowUserException();
		}

		// now we need to fill the location box with the chosen path
		TRACE("Selected '%s' folder.\n", szPath);
		bRet = TRUE;
	}
	CATCH_ALL(e)
	{
		bRet = FALSE;
	}
	END_CATCH_ALL

	return bRet;
}
コード例 #3
0
ファイル: arboredit.cpp プロジェクト: huilang22/Projects
void CArborEdit::DDV_Date( void )
{
	if( EditStyleIs( EDIT_DATE	) )
	{
		CString ControlText;
		// Extract the text from the exit control and then 
		GetWindowText(ControlText);

		if( !ControlText.IsEmpty())               // the text is not empty
		{
			//we have to re-format Date on case if Date = "x/x/xx"
			//otherwise  ValidateDate()	function return FALSE
			COleDateTime oleDate;			
			//TCHAR year[5];
			
			if( !ParseDate( ControlText, oleDate ))
			{	 //Tuning this up in CAMqa77746
				CGuiMsg::GuiMessage( GUIMSG_DATE_INVALID , MB_ICONEXCLAMATION );
				SetSel( 0, -1 );
				SetFocus();
				AfxThrowUserException();
			}
			
			if ( oleDate.GetStatus() == COleDateTime::invalid )  // invalid date
			{	 
				CGuiMsg::GuiMessage( GUIMSG_DATE_INVALID , MB_ICONEXCLAMATION );
				SetSel( 0, -1 );
				SetFocus( );
				AfxThrowUserException();
			}


	       char strdate[GAL_DATE_LEN];
	       Arb_date CDate;

		  CDate.year = oleDate.GetYear();
		  CDate.month = oleDate.GetMonth();
		  CDate.day = oleDate.GetDay();
		  strcpy(strdate,Arbdate_to_string(&CDate,ArbI18N::GetSysDateFmt()));
		  CString Text = CString(strdate);
		  SetWindowText(Text);
		  SetModify( TRUE ); 
			
		  //SetWindowText(ControlText);
		  SetModify( TRUE ); 
		}
	}
}
コード例 #4
0
ファイル: notesdlg.cpp プロジェクト: huilang22/Projects
void CNotesDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CNotesDlg)
	DDX_Control(pDX, IDC_NOTE_EQUIP_BOX, m_cbEquipNum);
	DDX_Control(pDX, IDC_NOTE_CODE_BOX, m_cbNoteCode);
	DDX_ASCII_Text(pDX, IDC_NOTE_USER_TXT, m_sChgWho);
	DDV_ASCII_MaxChars(pDX, m_sChgWho, CMF_NOTES_chg_who_SZ-1);
	DDX_ASCII_Text(pDX, IDC_NOTE_DATE_FROM_TXT, m_sDateFrom);
	DDV_ASCII_MaxChars(pDX, m_sDateFrom, ABP_DATE_LEN -1); /*DENqa09146 */
	DDX_ASCII_Text(pDX, IDC_NOTE_DATE_TO_TXT, m_sDateTo);
	DDV_ASCII_MaxChars(pDX, m_sDateTo, ABP_DATE_LEN -1); /*DENqa09146 */
	//}}AFX_DATA_MAP

    if (pDX->m_bSaveAndValidate)
    {
        if (!m_aeDateFrom.UpdateData(pDX->m_bSaveAndValidate) ||
			!m_aeDateTo.UpdateData(pDX->m_bSaveAndValidate))
        {
            AfxThrowUserException();
        }
    }
   if (!pDX->m_bSaveAndValidate && m_sStatusBar.GetLength())
   {
      AfxGetMainWnd()->SendMessage(WMU_SET_STATUSBAR, (WPARAM)&m_sStatusBar, 0L);
   }
}
コード例 #5
0
void CRegisterByPhoneDialog::DoDataExchange(CDataExchange* pDX)
{
	CBaseDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CRegisterByPhoneDialog)
		// NOTE: the ClassWizard will add DDX and DDV calls here
	//}}AFX_DATA_MAP

	if (pDX->m_bSaveAndValidate)
	{
#ifndef NO_FREE_BONUS
		CString csRegistrationCode;
		BOOL fCodeValid = TRUE;
		CEdit* pCode = (CEdit*)GetDlgItem(IDC_REGISTRATION_CODE);

		TRY
		{
			pCode->GetWindowText(csRegistrationCode);
			fCodeValid = GetApp()->BonusEnableUser(csRegistrationCode, this);
		}
		END_TRY

		if (!fCodeValid)
		{
			pCode->SetFocus();
			pCode->SetSel(0, -1);
			AfxThrowUserException();
		}
#endif
	}
コード例 #6
0
ファイル: dlgdata.cpp プロジェクト: jbeaurain/omaha_vs2010
void CDataExchange::Fail()
{
	if (!m_bSaveAndValidate)
	{
		TRACE(traceAppMsg, 0, "Warning: CDataExchange::Fail called when not validating.\n");
		// throw the exception anyway
	}
	else if (m_idLastControl != NULL)
	{
		// restore focus and selection to offending field
	  HWND hWndLastControl;
	  m_pDlgWnd->GetDlgItem(m_idLastControl, &hWndLastControl);
	  if (hWndLastControl != NULL)
	  {
		   ::SetFocus(hWndLastControl);
		   if (m_bEditLastControl) // select edit item
			   ::SendMessage(hWndLastControl, EM_SETSEL, 0, -1);
	  }
	}
	else
	{
		TRACE(traceAppMsg, 0, "Error: fail validation with no control to restore focus to.\n");
		// do nothing more
	}

	AfxThrowUserException();
}
コード例 #7
0
ファイル: arboredit.cpp プロジェクト: huilang22/Projects
void  CArborEdit::DDV_Numeric()
{
  if( GetModify() )
  {
		int iMinVal = 0;
		int iMaxVal = 0;

		// if they didn't set a range, but entered a number, validate with max values
		// that can be stored in the database.....
		if( m_bIntRangeSet )
		{
			 iMinVal = m_iMinValue;
			 iMaxVal = m_iMaxValue;
		}
		else
		{
			 if( m_bNegativeValue ) 
				 iMinVal = INT_MIN;
			 else
				 iMinVal = 0;
			 iMaxVal = INT_MAX;
		}

		if( !ValidateNum( iMinVal, iMaxVal )  ) 
		{
		  CGuiMsg::GuiMessage(GUIMSG_NUMBER_INT_RANGE_INVALID,
					                iMinVal, iMaxVal );
			SetSel( 0, -1 );
			SetFocus();
			AfxThrowUserException();
		}
	}
}
コード例 #8
0
ファイル: arboredit.cpp プロジェクト: huilang22/Projects
void  CArborEdit::DDV_Float()
{
	 // check to see if the control was modified at all....if so continue
   if( GetModify() )
   {
		 double dMinVal = 0.0;
		 double dMaxVal = 0.0;

		 // if they didn't set a range, but entered a number, validate with max values
		 // that can be stored in the database.....
		 if( m_bDoubleRangeSet )
		 {
			 dMinVal = m_dMinValue;
			 dMaxVal = m_dMaxValue;
		 }
		 else
		 {
			 if( m_bNegativeValue ) 
				 dMinVal = INT_MIN/100.0;
			 else
				 dMinVal = 0.0;
			 dMaxVal = INT_MAX/100.0;
		 }

		if( !ValidateDouble( dMinVal, dMaxVal ) ) 
		{
		  CGuiMsg::GuiMessage(GUIMSG_NUMBER_DOUBLE_RANGE_INVALID,
			 		                dMinVal, dMaxVal );
			SetSel( 0, -1 );
			SetFocus();
			AfxThrowUserException();
		}		   	 
	}
}
コード例 #9
0
ファイル: interimbilladd.cpp プロジェクト: huilang22/Projects
void CInterimBillAdd::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CInterimBillAdd)
	DDX_Control(pDX, IDC_IBADD_STATEMENT_DATE_LBL, m_lbStatementDate);
	DDX_Control(pDX, IDC_IBADD_PAYMENT_DUE_DATE_LBL, m_lbPaymentDueDate);
	DDX_Control(pDX, IDC_IBADD_INCLUDE_USAGE_TOG, m_btnIncludeUsage);
	DDX_Control(pDX, IDC_IBADD_INCLUDE_RC_TOG, m_btnIncludeRc);
	DDX_Control(pDX, IDC_IBADD_INCLUDE_NRC_TOG, m_btnIncludeNrc);
	DDX_Control(pDX, IDC_IBADD_INCLUDE_BMF_TOG, m_btnIncludeBmf);
	DDX_Control(pDX, IDC_IBADD_INCLUDE_ADJ_TOG, m_btnIncludeAdj);
    //67443,starts
    DDX_UTF8_Text(pDX, IDC_IBADD_BILL_ORDER_NUMBER_TXT, m_sBillOrderNumber) ;
	DDV_UTF8_MaxChars(pDX, m_sBillOrderNumber, CMF_INTERIM_BILLS_bill_order_number_SZ -1 ) ;
    //end

	//DDX_Text(pDX, IDC_IBADD_INTERIM_BILL_DATE_TXT, m_sInterimBillDate);CAMqa74909
	DDX_ASCII_Text(pDX, IDC_IBADD_INTERIM_BILL_DATE_TXT, m_sInterimBillDate);
	DDV_ASCII_MaxChars(pDX, m_sInterimBillDate, ABP_DATE_LEN-1);
	//DDX_Text(pDX, IDC_IBADD_PAYMENT_DUE_DATE_TXT, m_sPaymentDueDate);CAMqa74909
	DDX_ASCII_Text(pDX, IDC_IBADD_PAYMENT_DUE_DATE_TXT, m_sPaymentDueDate);
	DDV_ASCII_MaxChars(pDX, m_sPaymentDueDate, ABP_DATE_LEN-1);
	//DDX_Text(pDX, IDC_IBADD_STATEMENT_DATE_TXT, m_sStatementDate);CAMqa74909
	DDX_ASCII_Text(pDX, IDC_IBADD_STATEMENT_DATE_TXT, m_sStatementDate);
	DDV_ASCII_MaxChars(pDX, m_sStatementDate, ABP_DATE_LEN-1);
	//}}AFX_DATA_MAP
	if (pDX->m_bSaveAndValidate)
	{
		if( !m_aeStatementDate.UpdateData(pDX->m_bSaveAndValidate) ||
          !m_aeInterimBillDate.UpdateData(pDX->m_bSaveAndValidate)||
          !m_aePaymentDueDate.UpdateData(pDX->m_bSaveAndValidate))
				    AfxThrowUserException();
	}
}
コード例 #10
0
ファイル: WndBrowseHost.cpp プロジェクト: ivan386/Shareaza
void CBrowseHostWnd::Serialize(CArchive& ar, int nVersion /* BROWSER_SER_VERSION */)
{
	if ( ar.IsStoring() )
	{
		ar << nVersion;

		ar << m_bOnFiles;
	}
	else
	{
		ar >> nVersion;
		if ( nVersion < 1 || nVersion > BROWSER_SER_VERSION ) AfxThrowUserException();

		ar >> m_bOnFiles;
	}

	CBaseMatchWnd::Serialize( ar );

	m_pBrowser->Serialize( ar, nVersion );
	m_wndProfile.Serialize( ar, nVersion  );
	m_wndFrame.Serialize( ar, nVersion );

	if ( ar.IsLoading() )
	{
		m_wndProfile.Update( m_pBrowser );

		PostMessage( WM_TIMER, 1 );
		SendMessage( WM_TIMER, 2 );
		SetAlert( FALSE );
	}
}
コード例 #11
0
void CArborEditCurrency::DoDataExchange(CDataExchange* pDX) 
{

  // Put the numeric value in the text field
	SetWindowText(ArbI18N::translateFromUTF8( GetFormattedString()));  //CAMqa75092

	if( pDX->m_bSaveAndValidate	)
	{
    // check to see if any value has been entered into the control....
		if( !IsNumericZero() )
    {
      // then do validation
      DDV_Float();	
    }
	
	  if( IsNumericZero() && m_bIsRequiredField )
	  {
		  CString sMsg;
		  
		  //sMsg.Format( "This is a required field" );
		  sMsg.Format( GetIntlString(IDS_REQD_FIELD_MSG) );
		  AfxMessageBox( sMsg, MB_ICONEXCLAMATION );
		  SetFocus();
		  AfxThrowUserException();   
	  }
  }

	CEdit::DoDataExchange(pDX);
}
コード例 #12
0
ファイル: extiddetail.cpp プロジェクト: huilang22/Projects
void CExtIdDetail::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CExtIdDetail)
	DDX_Control(pDX, IDOK, m_IdOk);
	DDX_Control(pDX, IDC_EXTID_CURRENT_TGL, m_cExtidCurrentTog);
	DDX_Control(pDX, IDC_SOURCE_COMBO, m_cbSource);
	DDX_Control(pDX, IDC_EXTERNAL_ID_EDIT, m_eExternalId);
	//DDX_Text(pDX, IDC_EXTERNAL_ID_EDIT, m_sExternalId);
	//DDV_MaxChars(pDX, m_sExternalId, 56);
	//}}AFX_DATA_MAP
	DDX_ASCII_Text(pDX, IDC_EXTERNAL_ID_EDIT,   m_sExternalId); 
						//CUSTOMER_ID_ACCT_MAP_external_id_SZ - 1);
    DDV_ASCII_MaxChars(pDX, m_sExternalId,  CUSTOMER_ID_ACCT_MAP_external_id_SZ - 1);
						//CUSTOMER_ID_ACCT_MAP_external_id_SZ - 1);

    if (pDX->m_bSaveAndValidate)
    {
        if (!m_eStartDate.UpdateData(pDX->m_bSaveAndValidate) ||
			!m_eEndDate.UpdateData(pDX->m_bSaveAndValidate))
        {
            AfxThrowUserException();
        }
    }

}
コード例 #13
0
ファイル: ipdridoc.cpp プロジェクト: jetlive/skiaming
CDriverDoc::CDriverDoc()
{
	if (!m_map.CreateDispatch(_T("mfc.inproc.varmap")))
	{
		AfxMessageBox(IDP_UNABLE_TO_CREATE_INPROC);
		AfxThrowUserException();
	}
}
コード例 #14
0
ファイル: WHERERU.CPP プロジェクト: jimmccurdy/ArchiveGit
void CWhereAreYouDialog::DoDataExchange(CDataExchange* pDX)
{
	CBaseDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CWhereAreYouDialog)
	//}}AFX_DATA_MAP

	if (pDX->m_bSaveAndValidate)
	{
		// Delete any exiting parameters.
		delete m_pInternationalData;
		m_pInternationalData = NULL;

		// Get the current country.
		WORD wCountryId = m_CountryList.GetCountryId();
		if (wCountryId != 0)
		{
			// Save the selection.
			GetApp()->UserIniFile().WriteInteger(MSREGUSRINI_Section_CustomerInfo, MSREGUSRINI_CustomerInfo_CallingFrom, wCountryId);
			
			// Get the registration parameters for the country.
			TRY
			{
				m_pInternationalData = new CInternationalData;
			}
			END_TRY
			if (m_pInternationalData != NULL)
			{
				if (!GetApp()->GetInternationalData(wCountryId, m_pInternationalData))
				{
					delete m_pInternationalData;
					m_pInternationalData = NULL;
				}

				// Make sure we can at least register by modem and mail.
				if (m_pInternationalData != NULL)
				{
					if (!m_pInternationalData->m_Registration.m_Modem.Exists()
					 || !m_pInternationalData->m_Registration.m_Mail.Exists())
					{
						CString csCountry;
						CString csFormat;
						CString csMessage;
						TRY
						{
							GetApp()->GetCountryName(wCountryId, csCountry);
							csFormat = "Registration from %s is not currently available";
							csMessage.Format(csFormat, (LPCSTR)csCountry);
							AfxMessageBox(csMessage);
						}
						END_TRY

						delete m_pInternationalData;
						m_pInternationalData = NULL;

						AfxThrowUserException();
					}
				}
			}
コード例 #15
0
CGumpEditorDoc::CGumpEditorDoc()
: m_bInitUOData(false), m_iAlpha(0), m_iFlags(0), m_iFadeAlpha(0), m_iFadeTime(0)
{
	// TODO: add one-time construction code here
	m_pGumpLoader = NULL;
	m_pHueLoader = NULL;
	
	if (!Init()) AfxThrowUserException();
}
コード例 #16
0
ファイル: prepaymentadd.cpp プロジェクト: huilang22/Projects
void CPrepaymentAdd::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CPrepaymentAdd)
	DDX_Control(pDX, IDC_PREPAYAM_TAX_PKG_INST_ID_COMBO, m_TaxPkgInstIdCombo);
	DDX_Control(pDX, IDC_PREPAYAM_UNDESIGNATED_AMOUNT_TXT, m_aeUndesignatedAmount);
	DDX_Control(pDX, IDC_PREPAYAM_TAX_RATE_TXT, m_aeTaxRate);
	DDX_Control(pDX, IDC_PREPAYAM_DESIGNATED_TAX_AMOUNT_TXT, m_aeDesignatedTaxAmount);
	DDX_Control(pDX, IDC_PREPAYAM_TAX_TYPE_CODE_TXT, m_aeTaxTypeCode);
	DDX_Control(pDX, IDC_PREPAYAM_OPEN_ITEM_ID_COMBO, m_OpenItemIdCombo);
	DDX_Control(pDX, IDC_PREPAYAM_ALLOCATED_TAX_TXT, m_aeAllocatedTax);
	DDX_Control(pDX, IDC_PREPAYAM_ALLOCATED_UNDESIGNATED_TXT, m_aeAllocatedUndesignated);
	DDX_Control(pDX, IDC_PREPAYAM_IMPLIED_DECIMAL_TXT, m_aeImpliedDecimal);

	//}}AFX_DATA_MAP

  // DDV data validation on all user-editable fields
  if (!m_aeTaxPoint.UpdateData(pDX->m_bSaveAndValidate))	
  {
    m_aeTaxPoint.SetFocus();
    AfxThrowUserException();
  }
  if (!m_aeTransDt.UpdateData(pDX->m_bSaveAndValidate))	
  {
    m_aeTransDt.SetFocus();
    AfxThrowUserException();
  }
  if (!m_aeMicrBankId.UpdateData(pDX->m_bSaveAndValidate))	
  {
    m_aeMicrBankId.SetFocus();
    AfxThrowUserException();
  }
  if (!m_aeMicrDdaNum.UpdateData(pDX->m_bSaveAndValidate))	
  {
    m_aeMicrDdaNum.SetFocus();
    AfxThrowUserException();
  }
  if (!m_aeMicrCheckNum.UpdateData(pDX->m_bSaveAndValidate))	
  {
    m_aeMicrCheckNum.SetFocus();
    AfxThrowUserException();
  }

}
コード例 #17
0
// UDC confirmation Dialog.
//
void CDirstatDoc::AskForConfirmation(const USERDEFINEDCLEANUP *udc, CItem *item) throw (CUserException *)
{
	if (!udc->askForConfirmation)
		return;

	CString msg;
	msg.FormatMessage(udc->recurseIntoSubdirectories ? IDS_RUDC_CONFIRMATIONss : IDS_UDC_CONFIRMATIONss, 
				udc->title, item->GetPath()
	);

	if (IDYES != AfxMessageBox(msg, MB_YESNO))
		AfxThrowUserException();
}
コード例 #18
0
ファイル: modiduedate.cpp プロジェクト: huilang22/Projects
void CModiDueDate::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CModiDueDate)
	DDX_Text(pDX, IDC_DUE_DATE_EDIT, m_sDueDate);
	//}}AFX_DATA_MAP

	if (pDX->m_bSaveAndValidate)
	{
		if(!m_aeDueDate.UpdateData(pDX->m_bSaveAndValidate)) 
			AfxThrowUserException();
	}
}
コード例 #19
0
ファイル: contractterm.cpp プロジェクト: huilang22/Projects
void CContractTerm::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CContractTerm)
	DDX_Control(pDX, IDC_CAV_WAIVE_UNMET_OBLIGATION_NRC, m_cWaiveUnmetObligationNrc);
	DDX_Control(pDX, IDC_TERM_WAIVE, m_bTerminateWaive);
	DDX_Control(pDX, IDC_CT_TERMINATE_CHARGE, m_cTerminateCharge);
	//}}AFX_DATA_MAP
	if (pDX->m_bSaveAndValidate)
	{
		if((!m_aeTerminateDate.UpdateData(pDX->m_bSaveAndValidate))) 
			AfxThrowUserException();
	}

}
コード例 #20
0
ファイル: dumpcont.cpp プロジェクト: jbeaurain/omaha_vs2010
void CDumpContext::OutputString(LPCTSTR lpsz)
{
	// use C-runtime/OutputDebugString when m_pFile is NULL
	if (m_pFile == NULL)
	{
		TRACE(traceDumpContext, 0, _T("%s"), lpsz);
		return;
	}

	ASSERT( lpsz != NULL );
	if( lpsz == NULL )
		AfxThrowUserException();
	// otherwise, write the string to the file
	m_pFile->Write(lpsz, lstrlen(lpsz)*sizeof(TCHAR));
}
コード例 #21
0
void CICBDiscountModify::DoDataExchange(CDataExchange* pDX)
{
	
	CDialog::DoDataExchange(pDX);
	DDX_Control(pDX,IDC_RADIO_DISCOUNT_AMOUNT,m_eUpdateDiscountAmount);
	DDX_Control(pDX,IDC_RADIO_DISCOUNT_PERCENTAGE,m_eUpdateDiscountPercent);
/* Beg Add CAMqa89830 */	
	if (pDX->m_bSaveAndValidate)	
	{
		if((!m_eActiveDate	.UpdateData(pDX->m_bSaveAndValidate)) ||
			(!m_eInactiveDate	.UpdateData(pDX->m_bSaveAndValidate))) // DENqa04549
			AfxThrowUserException();
	}
/* End Add CAMqa89830 */
}
コード例 #22
0
void CHistoryBar::UpdateList()
{
	int	items;
	CUndoManager	*UndoMgr = theApp.GetMain()->GetUndoManager();
	if (UndoMgr != NULL) {	// if active document exists
		items = UndoMgr->GetSize() + 1;	// add one extra item for initial state
		if (m_ProgressDlg != NULL) {	// if we're undoing or redoing
			m_ProgressPos++;
			m_ProgressDlg->SetPos(m_ProgressPos);	// update progress
			if (m_ProgressDlg->Canceled())	// if progress was canceled
				AfxThrowUserException();
		}
	} else	// no documents
		items = 0;
	m_List.SetItemCountEx(items, 0);
}
コード例 #23
0
ファイル: COMPACT.CPP プロジェクト: hkaiser/TRiAS
/////////////////////////////////////////////////////////////////////////////
// CCompactDataBase dialog
CCompactDataBase::CCompactDataBase(CWnd* pParent, const char *pOldName)
	: CDialog(CCompactDataBase::IDD, pParent)
{
	//{{AFX_DATA_INIT(CCompactDataBase)
	//}}AFX_DATA_INIT
#ifdef MDB_VERSION20
	m_iVersion = dbVersion20;		// voreingestellte Version 2.0
#else
	m_iVersion = dbVersion30;		// voreingestellte Version 3.0
#endif
	ASSERT (pOldName != NULL && AfxIsValidString (pOldName));
	if (!*pOldName)
		AfxThrowUserException ();

	m_strOldDatabase = pOldName;
}
コード例 #24
0
void CManagedSearch::Serialize(CArchive& ar)
{
	CQuickLock oLock( SearchManager.m_pSection );

	int nVersion = 1000;	// 4	// ToDo: INTERNAL_VERSION
	// Version History:
	// 3 - Shareaza 2.5
	// 4 = 1000 - Added m_bAllowDC (ryo-oh-ki) (PeerProject 1.0)

	if ( ar.IsStoring() )
	{
		ar << nVersion;

		m_pSearch->Serialize( ar );
		ar << m_nPriority;
		ar << m_bActive;
		ar << m_bReceive;
		ar << m_bAllowG2;
		ar << m_bAllowG1;
		ar << m_bAllowED2K;
		ar << m_bAllowDC;
	}
	else // Loading
	{
		ar >> nVersion;
		if ( nVersion < 4 ) AfxThrowUserException();

		m_pSearch->Serialize( ar );

		ar >> m_nPriority;
		ar >> m_bActive;
		ar >> m_bReceive;

		// Auto-start search ability turned off
		m_bActive = m_bReceive = FALSE;

		ar >> m_bAllowG2;
		ar >> m_bAllowG1;
		ar >> m_bAllowED2K;
		//if ( nVersion >= 4 )
			ar >> m_bAllowDC;
	}
}
コード例 #25
0
ファイル: WndSearch.cpp プロジェクト: qing3962/peerproject
void CSearchWnd::Serialize(CArchive& ar)
{
    CQuickLock pLock( m_pMatches->m_pSection );

    int nVersion = 1;

    if ( ar.IsStoring() )
    {
        ar << nVersion;

        ar.WriteCount( size() );

        for ( iterator pManaged = begin() ; pManaged != end() ; ++pManaged )
        {
            (*pManaged)->Serialize( ar );
        }
    }
    else  // Loading
    {
        ar >> nVersion;
        if ( nVersion != 1 ) AfxThrowUserException();

        for ( DWORD_PTR nCount = ar.ReadCount() ; nCount > 0 ; nCount-- )
        {
            CSearchPtr pManaged( new CManagedSearch() );
            pManaged->Serialize( ar );
            m_oSearches.push_back( pManaged );
        }
    }

    CBaseMatchWnd::Serialize( ar );

    if ( ar.IsLoading() )
    {
        if ( ! empty() )
            m_wndPanel.ShowSearch( m_oSearches.back() );

        PostMessage( WM_TIMER, 1 );
        SendMessage( WM_TIMER, 2 );
        SetAlert( FALSE );
    }
}
コード例 #26
0
void CBalanceMap::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CBalanceMap)
	DDX_Radio(pDX, IDC_BM_PREPAID_ONLY, m_iBalanceType);
		//DENqa17025
	DDX_Control(pDX, IDC_BM_ACTIVE_DATE_EDIT, m_aeFilterActiveDate);
	//}}AFX_DATA_MAP
	if (pDX->m_bSaveAndValidate)
	{
		if (!m_aeFilterActiveDate.UpdateData(pDX->m_bSaveAndValidate) ||
			!m_aeFilterActiveDate.UpdateData(pDX->m_bSaveAndValidate))
		{
			AfxThrowUserException();
		}
	 }
	if (!pDX->m_bSaveAndValidate && m_sStatus.GetLength())   
	{    
		AfxGetMainWnd()->SendMessage(WMU_SET_STATUSBAR, (WPARAM)&m_sStatus, 0L);   
	}
}
コード例 #27
0
void CIVConnection::InitSession()
{
	CString str = (LPCSTR) IDS_INTERNET_AGENT;
	
	DWORD dwError = 0;
	bool bStopped = false;
	m_csSession.Lock();
	

	DWORD dwAccessType = INTERNET_OPEN_TYPE_PRECONFIG;
	CString strProxy;

	switch (m_opts.m_nUseProxy)
	{
	case 0:
		dwAccessType = INTERNET_OPEN_TYPE_DIRECT;
		break;
	case 1:
		dwAccessType = INTERNET_OPEN_TYPE_PROXY;
		strProxy.Format (_T("http=%s:%d"), (LPCTSTR) m_opts.m_strProxy, m_opts.m_nPort );
		break;
	}

	if (! (bStopped = m_bStopped) )
	{
		m_hSession = ::InternetOpen (str, dwAccessType, strProxy, NULL, 0);
		if (! m_hSession)
			dwError = GetLastError();
	}

	m_csSession.Unlock();

	if (bStopped)
		AfxThrowUserException();
		
	if (dwError)
		AfxThrowInternetException (0, dwError);
}
コード例 #28
0
ファイル: viewedit.cpp プロジェクト: rickerliang/OpenNT
void CEditView::SerializeRaw(CArchive& ar)
	// Read/Write object as stand-alone file.
{
	ASSERT_VALID(this);
	if (ar.IsStoring())
	{
		WriteToArchive(ar);
	}
	else
	{
		CFile* pFile = ar.GetFile();
		ASSERT(pFile->GetPosition() == 0);
		DWORD nFileSize = pFile->GetLength();
		if (nFileSize/sizeof(TCHAR) > nMaxSize)
		{
			AfxMessageBox(AFX_IDP_FILE_TOO_LARGE);
			AfxThrowUserException();
		}
		// ReadFromArchive takes the number of characters as argument
		ReadFromArchive(ar, (UINT)nFileSize/sizeof(TCHAR));
	}
	ASSERT_VALID(this);
}
コード例 #29
0
ファイル: ipdrivw.cpp プロジェクト: jetlive/skiaming
VARIANT CDriverView::GetFromVariant()
{
	CString strValue;
	m_ctrlValue.GetWindowText(strValue);

	// we can just throw it in as a string, then coerce to chosen type
	VARIANT va;
	VariantInit(&va);
	va.vt = VT_BSTR;
	va.bstrVal = strValue.AllocSysString();
#pragma warning(disable : 4244)
	VARTYPE vt = max(0, m_ctrlType.GetCurSel());
#pragma warning(default : 4244)
	VARIANT vaTemp;
	VariantInit(&vaTemp);
	if (FAILED(VariantChangeType(&vaTemp, &va, 0, vt)))
	{
		AfxMessageBox(IDP_INCOMPATIBLE_TYPE_VALUE);
		AfxThrowUserException();
	}
	VariantClear(&va);
	return vaTemp;
}
コード例 #30
0
void  CArborEditCurrency::DDV_Float()
{
	 // check to see if the control was modified at all....if so continue
   if( GetModify() )
   {
		 double dMinVal = 0.0;
		 double dMaxVal = 0.0;

		 // if they didn't set a range, but entered a number, validate with max values
		 // that can be stored in the database.....
		 if( m_bDoubleRangeSet )
		 {
			 dMinVal = m_dMinValue;
			 dMaxVal = m_dMaxValue;
		 }
		 else
		 {
			 if( m_bNegativeValue ) 
				 dMinVal = INT_MIN/100.0;
			 else
				 dMinVal = 0.0;
			 dMaxVal = INT_MAX/100.0;
		 }

		if( !ValidateDouble( dMinVal, dMaxVal ) ) 
		{
			CString sMsg;
		//	sMsg.Format( "Number is not valid!\nPlease enter a number between %f - %f.", dMinVal, dMaxVal );
			sMsg.Format( GetIntlString(IDS_NUMBER_NOT_VALID_MSG),"%f - %f.", dMinVal, dMaxVal );
			AfxMessageBox( sMsg, MB_ICONEXCLAMATION );
			SetSel( 0, -1 );
			SetFocus();
			AfxThrowUserException();
		}		   	 
	}
}