LRESULT CIfExpressEditorDlg::OnCheckEidtInput(WPARAM,LPARAM lp) { CPeraAutoCheckEdit *pEdit = (CPeraAutoCheckEdit *)lp; CString strText; pEdit->GetWindowText(strText); CString strErrMsg; if (pEdit== &m_EditLeftArry) { // 需检查数组下标 if (CheckMapArry(m_pNodeLeft,TRUE,strErrMsg)) return S_OK; } else if (pEdit==&m_EditRightArry) { // 需检查数组下标 if (CheckMapArry(m_pNodeRight,FALSE,strErrMsg)) return S_OK; } else if (pEdit==&m_EditRight) { if (m_ComboRightType.GetCurSel() == TP_PARAM) return S_FALSE; if (m_iCheckType==DT_DOUBLE) { if (CStringChecker::CheckDouble(strText)) return S_OK; strErrMsg = "常量不是浮点型数据!"; } else if (m_iCheckType==DT_INT) { if (CStringChecker::CheckInt(strText)) return S_OK; strErrMsg = "常量不是整型数据!"; } else if (m_iCheckType==DT_BOOLEAN) { BOOL bTmp; if (GetBoolValueFromString(strText,bTmp)) return S_OK; strErrMsg = "错误的Bool类型表达式!"; } else return S_OK; // 其他类型不做检查 } CStringW wstrErrMsg = CStrA2CStrW(strErrMsg); pEdit->ShowBalloonTip(L"提示",(LPCWSTR)wstrErrMsg,TTI_INFO); return S_FALSE; }
DWORD CDesktopDlg::SetClipBoardContext(IN const CLIPBOARD_C tagClipBoard) { switch (tagClipBoard.id) { case 0: //头信息 { m_pBuffer = new char[tagClipBoard.dwSize + 1]; //申请空间 memset(m_pBuffer, 0, tagClipBoard.dwSize + 1); } break; case 1: //正常大小数据块 { //复制数据 for(int i= tagClipBoard.Begin, j = 0 ; j < AUDIO_BUF_SIZE; i++, j++) { m_pBuffer[i] = tagClipBoard.Data[j]; } } break; case 2: //最后一次复制数据 { for(int i= tagClipBoard.Begin, j=0; i < tagClipBoard.dwSize; i++,j++) { m_pBuffer[i] = tagClipBoard.Data[j]; } } break; default: { MessageBox(_T("未知的剪贴板数据ID"),_T("提示"),MB_OK); delete[] m_pBuffer; LocalFree(m_pBuffer); return 1; } } if (tagClipBoard.bRead) { CStringA strContent = ""; strContent.Format("%s", m_pBuffer); m_strCilpBoard.Empty(); m_strCilpBoard = CStrA2CStrW(strContent); GetDlgItem(IDC_EDIT_CLIPBOARD)->SetWindowText(m_strCilpBoard); delete[] m_pBuffer; } return 0; }