当前位置: 首页>>代码示例>>C++>>正文


C++ CEdit类代码示例

本文整理汇总了C++中CEdit的典型用法代码示例。如果您正苦于以下问题:C++ CEdit类的具体用法?C++ CEdit怎么用?C++ CEdit使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了CEdit类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: func_setFontInd

void CFontTexCreaterDlg::OnBnClickedExe()
{
	CComboBox* ccb = (CComboBox*)GetDlgItem(IDC_COMBO1) ;
	if( !ccb )
		return ;

	// font type
	int sel = ccb->GetCurSel() ;
	func_setFontInd( g_nFtIns , sel ) ;

	// texture size
	int texW = 1024 ;
	int texH = 1024 ;

	CEdit* pEdt = (CEdit*)GetDlgItem( IDC_EDT_TEXTURE_W ) ;
	if( pEdt )
	{
		wchar_t buf[256] ;
		pEdt->GetWindowText( buf , 256 ) ;
		texW = _wtoi( buf ) ;
	}

	pEdt = (CEdit*)GetDlgItem( IDC_EDT_TEXTURE_H ) ;
	if( pEdt )
	{
		wchar_t buf[256] ;
		pEdt->GetWindowText( buf , 256 ) ;
		texH = _wtoi( buf ) ;
	}

	char *canvas = new char[texW*texH] ;
	memset( canvas , 0 , texW*texH ) ;

	func_setCanvas( g_nFtIns ,canvas , texW , texH , 0 ) ;

	func_drawGlyphFromFile( g_nFtIns , "finalCode.txt" ) ;
	//func_drawAllGlyphs( g_nFtIns ) ;

	//
	{
		FreeImage_Initialise() ;

		FIBITMAP* bm = FreeImage_Allocate( texW , texH , 24 ) ;

		RGBQUAD clr ;

		for( int y = 0 ; y < texH ; y ++ )
		{
			for( int x = 0 ; x < texW ; x ++ )
			{
				char val = canvas[ y * texW + x ] ;

				clr.rgbBlue = val ;
				clr.rgbGreen = val ;
				clr.rgbRed = val ;
				clr.rgbReserved = 255 ;

				FreeImage_SetPixelColor( bm , x , texH - 1 - y , &clr ) ;
			}
		}
		//memcpy( bm->data , canvas , texW*texH ) ;

		FreeImage_Save( FIF_BMP , bm , "fontTex.bmp" ) ;

		FreeImage_Unload( bm ) ;

		FreeImage_DeInitialise() ;
	}

	//

	FILE* pf = fopen( "fontBuf" , "wb+" ) ;
	fwrite( canvas , texW * texH , 1 , pf ) ;
	fclose( pf ) ;

	//delete []canvas ;
}
开发者ID:abaojin,项目名称:texttools_prj,代码行数:77,代码来源:FontTexCreaterDlg.cpp

示例2: OnKillFocus

void CEditBar::OnKillFocus()
{
    CEdit* pEdit = (CEdit*)GetDlgItem(IDC_EDIT);
    pEdit->GetSel(m_nCurSelStart , m_nCurSelEnd);
}
开发者ID:Liscar,项目名称:jmc,代码行数:5,代码来源:EditBar.cpp

示例3: dc

void campaign_tree_view::OnLButtonDown(UINT nFlags, CPoint point) 
{
	int i;
	CString str;
	CEdit *box;
	CListBox *listbox;
	CClientDC dc(this);

	OnPrepareDC(&dc);
	dc.DPtoLP(&point);
	if (nFlags & MK_CONTROL) {
		listbox = (CListBox *) &Campaign_tree_formp->m_filelist;
		i = listbox->GetCurSel();

		Mission_dropping = -1;
		if (i != LB_ERR) {
			Mission_dropping = i;
			SetCapture();
		}

		Last_draw_size = CSize(0, 0);
		Dragging_rect.SetRect(0, 0, 1, 1);
		dc.DrawDragRect(Dragging_rect, Last_draw_size, NULL, CSize(0, 0));

	} else {
		if ( (Cur_campaign_link >= 0) && Links[Cur_campaign_link].mission_loop) {
			// HACK!!  UPDATE mission loop desc before changing selections
			// save mission loop desc
			char buffer[MISSION_DESC_LENGTH];
			box = (CEdit *) Campaign_tree_formp->GetDlgItem(IDC_MISSISON_LOOP_DESC);
			box->GetWindowText(buffer, MISSION_DESC_LENGTH);
			if (strlen(buffer)) {
				if (Links[Cur_campaign_link].mission_loop_txt) {
					free(Links[Cur_campaign_link].mission_loop_txt);
				}
				Links[Cur_campaign_link].mission_loop_txt = strdup(buffer);
			} else {
				Links[Cur_campaign_link].mission_loop_txt = NULL;
			}

			// HACK!!  UPDATE mission loop desc before changing selections
			// save mission loop desc			
			box = (CEdit *) Campaign_tree_formp->GetDlgItem(IDC_LOOP_BRIEF_ANIM);
			box->GetWindowText(buffer, MISSION_DESC_LENGTH);
			if (strlen(buffer)) {
				if (Links[Cur_campaign_link].mission_loop_brief_anim) {
					free(Links[Cur_campaign_link].mission_loop_brief_anim);
				}
				Links[Cur_campaign_link].mission_loop_brief_anim = strdup(buffer);
			} else {
				Links[Cur_campaign_link].mission_loop_brief_anim = NULL;
			}

			// HACK!!  UPDATE mission loop desc before changing selections
			// save mission loop desc			
			box = (CEdit *) Campaign_tree_formp->GetDlgItem(IDC_LOOP_BRIEF_SOUND);
			box->GetWindowText(buffer, MISSION_DESC_LENGTH);
			if (strlen(buffer)) {
				if (Links[Cur_campaign_link].mission_loop_brief_sound) {
					free(Links[Cur_campaign_link].mission_loop_brief_sound);
				}
				Links[Cur_campaign_link].mission_loop_brief_sound = strdup(buffer);
			} else {
				Links[Cur_campaign_link].mission_loop_brief_sound = NULL;
			}
		}
		Mission_dragging = Cur_campaign_mission = Cur_campaign_link = -1;
		for (i=0; i<Campaign.num_missions; i++)
			if (Elements[i].box.PtInRect(point)) {
				SetCapture();

				Mission_dragging = Cur_campaign_mission = i;
				Dragging_rect = Elements[i].box;
				Rect_offset = Dragging_rect.TopLeft() - point;
				Last_draw_size = CSize(4, 4);
				if (Campaign.missions[Cur_campaign_mission].num_goals < 0)  // haven't loaded goal names yet (or notes)
					read_mission_goal_list(Cur_campaign_mission);

				if (Campaign.missions[Cur_campaign_mission].notes) {
					str = convert_multiline_string(Campaign.missions[Cur_campaign_mission].notes);
					box = (CEdit *) Campaign_tree_formp->GetDlgItem(IDC_HELP_BOX);
					if (box)
						box->SetWindowText(str);
				}

				Campaign_tree_formp->mission_selected(Cur_campaign_mission);
				break;
			}
	}
	
	Invalidate();
	UpdateWindow();
	Campaign_tree_formp->load_tree();
	if (Mission_dragging != -1) {
		CRect rect = Dragging_rect;

		dc.LPtoDP(&rect);
		dc.DrawDragRect(rect, Last_draw_size, NULL, CSize(0, 0));
	}

//.........这里部分代码省略.........
开发者ID:lubomyr,项目名称:freespace2,代码行数:101,代码来源:campaigntreeview.cpp

示例4: MessageBox

void CAddBlogInfoDlg::OnOK() 
{
    // 入力内容チェック
    CEdit   *p = (CEdit *)GetDlgItem( IDC_EDIT_BLOGUSERNAME );
    p->GetWindowText( m_blogUserName );
    if ( m_blogUserName.GetLength() == 0 ) {
        MessageBox( "「ユーザ名、または ID」を設定してください    ",
                    "設定確認", MB_OK|MB_ICONWARNING );
        return;
    }

    p = (CEdit *)GetDlgItem( IDC_EDIT_BLOGPASSWORD );
    p->GetWindowText( m_blogPassword );
    if ( m_blogPassword.GetLength() == 0 ) {
        MessageBox( "「パスワード」を設定してください    ",
                    "設定確認", MB_OK|MB_ICONWARNING );
        return;
    }

    if ( m_blogKind == unset ) {
        MessageBox( "「blog の種類」を設定してください    ",
                    "設定確認", MB_OK|MB_ICONWARNING );
        return;
    }

    p = (CEdit *)GetDlgItem( IDC_EDIT_BLOGNAME );
    p->GetWindowText( m_blogName );
    if ( m_blogName.GetLength() == 0 ) {
        if ( (m_blogKind == movableType)  ||
             (m_blogKind == bloggerAPI)   ||
             (m_blogKind == metaWeblog)   ||
             (m_blogKind == mtAPI)        ||
             (m_blogKind == atomAPI)      ||
             (m_blogKind == newPostOnly)  ||   
             (m_blogKind == typepad)      ||
             (m_blogKind == typepadJapan) ||
             (m_blogKind == cocolog)      ||
             (m_blogKind == cocologFree)  ||
             (m_blogKind == blogzine)     ||
             (m_blogKind == newsHandler)  ||
             (m_blogKind == ameblo)       ||
             (m_blogKind == seesaa)       ||
             (m_blogKind == netLaputa)    ||
             (m_blogKind == blogG)        ||
             (m_blogKind == fc2blog)      ||
             (m_blogKind == gooBlog)      ||
             (m_blogKind == msnSpaces)    ||
             (m_blogKind == drecomX)      ||
             (m_blogKind == yaplogX)      ||
             (m_blogKind == jugemX)       ||
             (m_blogKind == webryX)       ||
             (m_blogKind == livedoor)     ||
             (m_blogKind == lovelog)      ||
             (m_blogKind == sonet)        ||
             (m_blogKind == vox)          ||
             (m_blogKind == hatena)       ||
             (m_blogKind == blogger)      ||
             (m_blogKind == exciteBlog)   ||
             (m_blogKind == echoo)        ||
             (m_blogKind == rakuten)         ) {
            // 追加情報取得
            OnButtonMoreInfo();
        }

        if ( m_blogName.GetLength() == 0 ) {
            MessageBox( "「blog 名」を設定してください    ",
                        "設定確認", MB_OK|MB_ICONWARNING );
            return;
        }
    }

    if ( (m_blogKind == movableType)  ||
         (m_blogKind == bloggerAPI)   ||
         (m_blogKind == metaWeblog)   ||
         (m_blogKind == mtAPI)        ||
         (m_blogKind == atomAPI)      ||
         (m_blogKind == newPostOnly)  ||   
         (m_blogKind == typepad)      ||
         (m_blogKind == typepadJapan) ||
         (m_blogKind == cocolog)      ||
         (m_blogKind == cocologFree)  ||
         (m_blogKind == blogzine)     ||
         (m_blogKind == newsHandler)  ||
         (m_blogKind == ameblo)       ||
         (m_blogKind == seesaa)       ||
         (m_blogKind == netLaputa)    ||
         (m_blogKind == blogG)        ||
         (m_blogKind == fc2blog)      ||
         (m_blogKind == gooBlog)      ||
         (m_blogKind == msnSpaces)    ||
         (m_blogKind == drecomX)      ||
         (m_blogKind == yaplogX)      ||
         (m_blogKind == jugemX)       ||
         (m_blogKind == webryX)       ||
         (m_blogKind == livedoor)     ||
         (m_blogKind == lovelog)      ||
         (m_blogKind == sonet)        ||
         (m_blogKind == vox)          ||
         (m_blogKind == hatena)       ||
         (m_blogKind == blogger)         ) {
//.........这里部分代码省略.........
开发者ID:tsupo,项目名称:blogolee,代码行数:101,代码来源:AddBlogInfoDlg.cpp

示例5: setText

void PreferencesDialog::setText(int id, char* value)
{
	CEdit* edit = (CEdit*)GetDlgItem(id);
	if (edit)
		edit->SetWindowText(value);
}
开发者ID:dnm,项目名称:cormanlisp,代码行数:6,代码来源:PreferencesDialog.cpp

示例6: GetCellEditRect

//------------------------------------------------------------------------
//! Overrides OnEditBegin() to provide a CEdit cell value editor
//!
//! @param owner The list control starting edit
//! @param nRow The index of the row for the cell to edit
//! @param nCol The index of the column for the cell to edit
//! @return Pointer to the cell editor to use (NULL if cell edit is not possible)
//------------------------------------------------------------------------
CWnd* CGridColumnTraitEdit::OnEditBegin(CGridListCtrlEx& owner, int nRow, int nCol)
{
	// Get position of the cell to edit
	CRect rectCell = GetCellEditRect(owner, nRow, nCol);

	// Get the text-style of the cell to edit
	DWORD dwStyle = m_EditStyle;
	HDITEM hditem = { 0 };
	hditem.mask = HDI_FORMAT;
	VERIFY(owner.GetHeaderCtrl()->GetItem(nCol, &hditem));
	if (hditem.fmt & HDF_CENTER)
		dwStyle |= ES_CENTER;
	else if (hditem.fmt & HDF_RIGHT)
		dwStyle |= ES_RIGHT;
	else
		dwStyle |= ES_LEFT;

	// Create edit control to edit the cell
	CEdit* pEdit = CreateEdit(owner, nRow, nCol, dwStyle, rectCell);
	VERIFY(pEdit != NULL);
	if (pEdit == NULL)
		return NULL;

	// Configure font
	pEdit->SetFont(owner.GetCellFont());

	// First column (Label) doesn't have a margin when imagelist is assigned
	if (nCol == 0 && owner.GetImageList(LVSIL_SMALL) != NULL)
		pEdit->SetMargins(0, 0);
	// First column (Label) doesn't have a margin when checkboxes are enabled
	else if (nCol == 0 && owner.GetExtendedStyle() & LVS_EX_CHECKBOXES)
		pEdit->SetMargins(1, 0);
	// Label column doesn't have margin when not first in column order
	else if (nCol == 0 && owner.GetFirstVisibleColumn() != nCol)
		pEdit->SetMargins(1, 0);
	else if (dwStyle & ES_CENTER)
		pEdit->SetMargins(0, 0);
	else if (dwStyle & ES_RIGHT)
		pEdit->SetMargins(0, 7);
	else
		pEdit->SetMargins(4, 0);

	if (m_EditLimitText != UINT_MAX)
		pEdit->SetLimitText(m_EditLimitText);

	CString cellText = owner.GetItemText(nRow, nCol);
	pEdit->SetWindowText(cellText);
	pEdit->SetSel(0, -1, 0);
	return pEdit;
}
开发者ID:pesci2k,项目名称:cgridlistctrlex,代码行数:58,代码来源:CGridColumnTraitEdit.cpp

示例7: if

void    CAddBlogInfoDlg::switchBlogName()
{
    CEdit   *cp = (CEdit *)GetDlgItem( IDC_EDIT_BLOGNAME );

    if ( m_mode )
        m_blogName = "";

    if ( m_useCbox ) {
        m_blogName = "BlogPet 飼育箱";
        cp->SetReadOnly( TRUE );
    }
    else if ( /* (m_blogKind == movableType) || */
                 (m_blogKind == bloggerAPI)  ||
                 (m_blogKind == metaWeblog)  ||
                 (m_blogKind == mtAPI)       ||
                 (m_blogKind == atomAPI)        )
        cp->SetReadOnly( FALSE );
    else if ( (m_blogKind == typepad)      ||
              (m_blogKind == typepadJapan) ||
              (m_blogKind == cocolog)      ||
              (m_blogKind == cocologFree)  ||
              (m_blogKind == blogzine)     ||
              (m_blogKind == newsHandler)  ||
              (m_blogKind == ameblo)       ||
              (m_blogKind == seesaa)       ||
              (m_blogKind == netLaputa)    ||
              (m_blogKind == blogG)        ||
              (m_blogKind == fc2blog)      ||
              (m_blogKind == gooBlog)      ||
              (m_blogKind == msnSpaces)    ||
              (m_blogKind == drecomX)      ||
              (m_blogKind == yaplogX)      ||
              (m_blogKind == jugemX)       ||
              (m_blogKind == webryX)       ||
              (m_blogKind == livedoor)     ||
              (m_blogKind == lovelog)      ||
              (m_blogKind == sonet)        ||
              (m_blogKind == vox)          ||
              (m_blogKind == hatena)       ||
              (m_blogKind == blogger)      ||
              (m_blogKind == tumblr)          ) {
        cp->SetReadOnly( TRUE );
    }
    else if ( m_blogKind == kinugasa ) {
        m_blogName = "キヌガサ";
        cp->SetReadOnly( TRUE );
    }
    else if ( m_blogKind == mixi ) {
        m_blogName = "mixi";
        cp->SetReadOnly( TRUE );
    }
    else if ( m_blogKind == fc2network ) {
        m_blogName = "FC2NETWORK";
        cp->SetReadOnly( TRUE );
    }
    else if ( m_blogKind == colors ) {
        m_blogName = "COLORS";
        cp->SetReadOnly( TRUE );
    }
    else if ( m_blogKind == openPne ) {
        m_blogName = "OpenPNE";
        cp->SetReadOnly( TRUE );
    }
    else
        cp->SetReadOnly( TRUE );

    cp->SetWindowText( m_blogName );
}
开发者ID:tsupo,项目名称:blogolee,代码行数:68,代码来源:AddBlogInfoDlg.cpp

示例8: AdjustEdit

void ExtFrame::AdjustEdit(CSpinButtonCtrl& spin, CEdit& edit, bool two)
{
    int rangeMin;
    int rangeMax;
    spin.GetRange32(rangeMin, rangeMax);
    if(rangeMin <= rangeMax)
    {
        int length = edit.GetWindowTextLength();
        char* temp = new char[length + 1];
        edit.GetWindowText(temp, length + 1);
        int value;
        bool changed = false;
        if(length == 0)
        {
            value = rangeMin;
            changed = true;
        }
        else
        {
            value = atoi(temp);
            if(value < rangeMin)
            {
                value = rangeMin;
                changed = true;
            }
            else if(value > rangeMax)
            {
                value = rangeMax;
                changed = true;
            }
        }
        char numValue[33];
        _itoa_s(value, numValue, 10);
        length = (int)strlen(numValue);

        if(length == 0)
        {
            edit.SetWindowText(two ? "00" : "0");
        }
        else if(two)
        {
            if(length == 1)
            {
                char num[33];
                *num = '0';
                strcpy_s(num + 1, sizeof(num) - 1, numValue);
                edit.SetWindowText(num);
            }
            else if(changed)
            {
                edit.SetWindowText(numValue);
            }
        }
        else
        {
            if(length == 2)
            {
                if(*numValue == '0')
                {
                    edit.SetWindowText(numValue + 1);
                }
                else if(changed)
                {
                    edit.SetWindowText(numValue);
                }
            }
            else if(changed)
            {
                edit.SetWindowText(numValue);
            }
        }
        delete[] temp;
    }
}
开发者ID:Decatf,项目名称:tradelink,代码行数:74,代码来源:ExtFrame.cpp

示例9: GetDlgItemInt

void CDlg_SetBatchNumbers::OnAdd() 
{
	CString str, strU;
	UINT nID;

	if (IsDlgButtonChecked (IDC_SETOFNUMBERS) == BST_CHECKED)
	{
		int from, to, step, wc;
		from = GetDlgItemInt (IDC_FROM);
		to = GetDlgItemInt (IDC_TO);
		step = GetDlgItemInt (IDC_STEP);
		wc = GetDlgItemInt (IDC_WB);

		if (to == 0)
		{
			nID = IDC_TO;
			goto _l0Err;
		}

		if (step == 0)
		{
			nID = IDC_STEP;
			goto _l0Err;
		}

		if (wc == 0)
		{
			nID = IDC_WB;
			goto _l0Err;
		}

		if (to <= from)
		{
			MessageBox (LS (L_TOMBGTFROM), LS (L_INPERR), MB_ICONEXCLAMATION);
			((CEdit*) GetDlgItem (IDC_TO))->SetSel (0, -1);
			GetDlgItem (IDC_TO)->SetFocus ();
			return;
		}

		if (false == CheckSetOfNumbersParameters (from, to, step, wc))
			return;

		str.Format ("%d-%d", from, to);
		strU.Format ("%s %d %s %d", LS (L_DLGFROM), from, LS (L_DLGTO), to);
		strU.Remove (':');

		if (step != 1) {
			CString str2; 
			str2.Format ("%c%d", BATCHLIST_STEP_SYMBOL, step);
			str += str2;
			str2.Format (" %s %d", LS (L_DLGSTEP), step);
			str2.Remove (':');
			strU += str2;
		}

		if (wc != 1) {
			CString str2;
			str2.Format ("%c%d", BATCHLIST_WILDCARD_SYMBOL, wc);
			str += str2;
			str2.Format (" %s %d", LS (L_DLGWILDBYTES), wc);
			str2.Remove (':');
			strU += str2;
		}
	}
	else
	{
		int n = GetDlgItemInt (IDC_NUMBER);
		str.Format ("%d", n);
		strU = str;
	}

	m_wndSets.AddString (strU);
	CString *pstr; pstr = new CString;
	*pstr = str;
	m_wndSets.SetItemData (m_wndSets.GetCount () - 1, (DWORD)pstr);
	return;

_l0Err:
	str.Format (LS (L_ENTERGREATER), 0);
	MessageBox (str, LS (L_INPERR), MB_ICONEXCLAMATION);
	CEdit *pE = (CEdit*) GetDlgItem (nID);
	pE->SetSel (0, -1);
	pE->SetFocus ();
}
开发者ID:HackLinux,项目名称:Free-Download-Manager-vs2010,代码行数:84,代码来源:Dlg_SetBatchNumbers.cpp

示例10: OutputFormatString

void CDlgUserConvFormat::OutputFormatString(const wchar_t *sText)
{
	CEdit	*pEdit = m_nOutputFormatType ? &m_editTag2File : &m_editFile2Tag;
	pEdit->ReplaceSel(sText, FALSE);
	pEdit->SetFocus();
}
开发者ID:leiqunni,项目名称:STEP_Unicode,代码行数:6,代码来源:DlgUserConvFormat.cpp

示例11: ScrollEnd

void ExtFrame::ScrollEnd(CEdit& edit)
{
    int length = edit.GetWindowTextLength();
    edit.PostMessage(EM_SETSEL, length, length);
}
开发者ID:Decatf,项目名称:tradelink,代码行数:5,代码来源:ExtFrame.cpp

示例12: ClearEditCtrl

static void ClearEditCtrl(CEdit& edit)
{
    edit.SetWindowTextA("");
    AppendTextToEditCtrl(edit, "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
    edit.SetWindowTextA("");
}
开发者ID:eagle-dai,项目名称:eagle-util,代码行数:6,代码来源:MyNanjingDlg.cpp

示例13: SetWizardButtons

BOOL 
CCompletionPage::OnSetActive()
{
	WTL::CString strText, strText2;
	SetWizardButtons(PSWIZB_FINISH);

	CStatic ctlStaticResult;
	ctlStaticResult.Attach(GetDlgItem(IDC_BIND_RESULT));

	CEdit ctlEditResult;
	ctlEditResult.Attach(GetDlgItem(IDC_EDIT_BIND_SETTING));

	// add bind type to list
	strText2.LoadString(
		(NMT_AGGREGATE == m_pWizData->m_nBindType) ? IDS_LOGDEV_TYPE_AGGREGATED_DISK :
	(NMT_RAID0 == m_pWizData->m_nBindType) ? IDS_LOGDEV_TYPE_DISK_RAID0 :
	(NMT_RAID1 == m_pWizData->m_nBindType) ? IDS_LOGDEV_TYPE_DISK_RAID1 :
	(NMT_RAID4 == m_pWizData->m_nBindType) ? IDS_LOGDEV_TYPE_DISK_RAID4 : IDS_LOGDEV_TYPE
		);
	strText.FormatMessage(IDS_BNZ_COMPLETE_RESULT_TYPE_FMT, strText2);
	ctlEditResult.AppendText(strText); ctlEditResult.AppendText(_T("\n"));


	// add disk titles to list
	strText.LoadString(IDS_BNZ_COMPLETE_RESULT_DISKS);

	int i;
	NBUnitDevicePtrList::iterator itr;
	CNBUnitDevice *UnitDiskObject, *UnitDiskObjectFailed;
	for(i = 0, itr = m_pWizData->listUnitDevicesBind.begin(); itr != m_pWizData->listUnitDevicesBind.end(); ++itr, i++)
	{
		UnitDiskObject = *itr;
		if(m_pWizData->m_BindResult == i)
			UnitDiskObjectFailed = UnitDiskObject;
		if(itr != m_pWizData->listUnitDevicesBind.begin())
			strText += _T(", "); 

		strText += UnitDiskObject->GetName();
	}
	ctlEditResult.AppendText(strText); ctlEditResult.AppendText(_T("\n"));

	if(m_pWizData->m_BindResult == m_pWizData->m_nDiskCount)
	{
		// success
		strText.LoadString(IDS_BNZ_COMPLETE_SUCCESS);
		ctlStaticResult.SetWindowText(strText);

		// size
		pGetDiskSizeString(strText2, m_pWizData->m_nBindType, m_pWizData->m_nDiskCount, m_pWizData->listUnitDevicesBind);
		strText.FormatMessage(IDS_BNZ_COMPLETE_RESULT_SIZE_FMT, strText2);
		ctlEditResult.AppendText(strText); ctlEditResult.AppendText(_T("\n"));
	}
	else
	{
		// fail
		strText.LoadString(IDS_BNZ_COMPLETE_FAIL);
		ctlStaticResult.SetWindowText(strText);

		if(m_pWizData->m_BindResult != 0xFFFFFFFF) // single disk error
		{
			strText.FormatMessage(IDS_BNZ_COMPLETE_RESULT_FAILED_ON_FMT,
				UnitDiskObjectFailed->GetName());
			ctlEditResult.AppendText(strText); ctlEditResult.AppendText(_T("\n"));
		}

		GetDescription(strText, m_pWizData->dwBindLastError);
		ctlEditResult.AppendText(strText); ctlEditResult.AppendText(_T("\n"));
	}

	return TRUE;
}
开发者ID:yzx65,项目名称:ndas4windows,代码行数:71,代码来源:nbbindwiz.cpp

示例14: switch

void CCardInfDlg::OnTimer(UINT_PTR nIDEvent)
{
	switch (nIDEvent)
	{
	case 1:
	{
		//卡序列号缓冲
		unsigned char myserial[4];
		unsigned char status;
		/*if (!FileExists(FileName))
		{//如果文件不存在
		ShowMessageb("无法在应用程序的文件夹找到IC卡读写卡器动态库");
		return; //返回
		}*/

		typedef unsigned char(__stdcall *ppiccrequest)(unsigned char* serial);
		HINSTANCE hDLL = LoadLibrary(_T("OUR_MIFARE.dll"));// 加载DLL

		ppiccrequest piccrequest;
		piccrequest = (ppiccrequest)GetProcAddress(hDLL, "piccrequest");

		//提取动态库
		//piccrequest = (unsigned char(__stdcall *piccrequest)(unsigned char *serial))GetProcAddress(hDll, "piccread");

		while (true)
		{
			status = piccrequest(myserial);
			//返回值处理
			//调用读卡函数,如果没有寻到卡返回1,拿卡太快返回2,没注册发卡机返回4,没有驱动程序返回3
			switch (status)
			{
			case '0':
			{
				// 获取输入框对象
				CEdit* edit = (CEdit*)GetDlgItem(IDC_phy_number);
				CString ID_str;
				ID_str.Format(_T("%s"), myserial);
				edit->SetWindowTextW(ID_str);
				break;
			}
			case '1':
				//MessageBox(_T("没有寻找到卡!"));
				break;
			case '2':
				//MessageBox(_T("拿卡太快!"));
				break;
			case '3':
				//MessageBox(_T("没有驱动程序!"));
				break;
			case '4':
				//MessageBox(_T("没注册发卡机!"));
				break;
			}
		}
	}
	case 2:
	{
		CString temp;
		temp.Format(_T("%d/%d"), indicator, 20512);
		GetDlgItem(IDC_Search_ID)->SetWindowTextW(temp);
		if (r > 1) KillTimer(2);
		break;
	}
	case 3: {
		CString temp;
		temp.Format(_T("%d/%d"), indicator_ID, 20698);
		GetDlgItem(IDC_getInf)->SetWindowTextW(temp);
		if (r_ID > 1) KillTimer(3);
		break;
	}
	default:
		break;
	}


	CDialogEx::OnTimer(nIDEvent);
}
开发者ID:CodeingBoy,项目名称:CardInf,代码行数:77,代码来源:CardInfDlg.cpp

示例15: OnClickedRadioEntireImage

void CProcessingOptions::OnClickedRadioEntireImage()
{
	CEdit * ctrlEditCoverage = reinterpret_cast<CEdit *> (GetDlgItem(IDC_PERCENT_COVERAGE));
	ctrlEditCoverage->EnableWindow(FALSE);
}
开发者ID:stanathong,项目名称:fiducial_mark_detector,代码行数:5,代码来源:ProcessingOptions.cpp


注:本文中的CEdit类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。