一些BLOG的地址

MFC打包

http://hi.baidu.com/feng_hit/item/6eed6885bac20728110ef339


取反色算法:

((255 - 蓝色) × 256 × 256 
+ (255 - 绿色) × 256 + 255 - 红色)


/*************************************************
Function:       // OnEnChangeEditIndoor
Description:    // 检查数据是否是数子 或者小数点
Calls:          //
Called By:      // 框架
Table Accessed: //
Table Updated:  //
Input:          // 无
Output:         // 无
Return:         // 返回TRUE.
Others:         // 无
*************************************************/
void CTrafficMapDlg::OnEnChangeEditIndoor(UINT id)
{
// TODO:  If this is a RICHEDIT control, the control will not
// send this notification unless you override the __super::OnInitDialog()
// function and call CRichEditCtrl().SetEventMask()
// with the ENM_CHANGE flag ORed into the mask.


// TODO:  Add your control notification handler code here
CString strID;
char cLeft;
GetDlgItem(id)->GetWindowText(strID);


if(0 == strID.Compare(CString(_T('.'))))
{
//MessageBox(_T("ERROR : . not header!"));
strID.Insert(0,_T("0"));
GetDlgItem(id)->SetWindowText(strID);
goto MOVE_END ;
}


int length = strID.GetLength();
for(int i = 0 ; i < length ; i++)
{
cLeft = strID.GetAt(i);
if(i == 0 )
{
if(cLeft == '-')
continue;
}


if (cLeft == '\0')
{
continue; 
}


if((cLeft >= '0' && cLeft <= '9')||(cLeft == '.'))
{
int piont = strID.Find('.');
if(-1 != piont)
{
if(0 == piont ){
MessageBox(_T("ERROR : You are joke! "));
goto MOVE_END;
}
char number = strID.GetAt(piont - 1);
if(number >= '0' && number <= '9')
{
;
}else
{
//MessageBox(_T("ERROR : format !"));
strID.Insert(piont,_T("0"));
GetDlgItem(id)->SetWindowText(strID);
goto MOVE_END;
}


if(-1 != strID.Find('.',piont + 1))
{
//MessageBox(_T("2 . more ..."));
strID.Delete(strID.Find('.',piont + 1),1);
GetDlgItem(id)->SetWindowText(strID);
goto MOVE_END;
}
}else
continue;


}else
{
if(cLeft == '-' && i != 0)
{
strID.Delete(strID.Find('-',1),1);
GetDlgItem(id)->SetWindowText(strID);
goto MOVE_END ;
}


//CString tmp;
//tmp.Format(_T("ERROR: [%c]"),cLeft);
//MessageBox(tmp);
strID.Remove(cLeft);
GetDlgItem(id)->SetWindowText(strID);
}
}
if(id == IDC_EDIT_ALLERLANG_PRO 
|| id == IDC_EDIT_USER_PRO)
OnEnChangeEditCtrlForProportion(id);
MOVE_END:
keybd_event( VK_END , MapVirtualKey(VK_END,0) , 0 , 0); 
return ;
}

评论 9
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值