MFC
奔跑的火车
这个作者很懒,什么都没留下…
展开
-
获取当前路径
CString CConfig::GetAppPath() { TCHAR acPath[260] = {0}; GetModuleFileName(NULL, acPath, 260); CString strPath = acPath; int lIndex = strPath.ReverseFind('\\'); if (-1 !=原创 2012-02-28 18:59:15 · 432 阅读 · 0 评论 -
限制编辑框的输入字符,只能输入数字、大小写字母、下划线和退格键
BOOL CAddServerInfoDlg::PreTranslateMessage(MSG* pMsg) { if (NULL == pMsg) { return FALSE; } if((pMsg->hwnd == GetDlgItem(IDC_NAME)->m_hWnd) && (WM_CHAR == pMsg->message))原创 2012-02-28 19:05:01 · 4939 阅读 · 1 评论 -
加载图片时,表示图片路径的字符串转换成宽字符
CString strImagePath = CfgInst.GetAppPath() + IMAGE_PATH; _bstr_t bstr(strImagePath); wchar_t *wstr = (wchar_t*)bstr; m_pDeviceBoardImage = new Image(wstr);原创 2012-02-28 19:14:00 · 668 阅读 · 0 评论 -
双缓存绘图(1)
void CLoginDlg::OnPaint() { CPaintDC dc(this); // device context for painting CRect rectClt; GetClientRect(&rectClt); //图像显示区域 CRect rectImage(rectClt); rectImage.right = r原创 2012-02-28 19:22:15 · 703 阅读 · 0 评论 -
双缓存绘图(2)
//构造函数中:加载图片 CString strImagePath = CfgInst.GetAppPath() + IMAGE_PATH; _bstr_t bstr(strImagePath); wchar_t *wstr = (wchar_t*)bstr; m_pDeviceBoardImage = new Image(wstr);void CDeviceBoard::OnPain原创 2012-02-28 19:36:16 · 786 阅读 · 0 评论