DoubleLi

qq: 517712484 wx: ldbgliet

  博客园 :: 首页 :: 新随笔 :: 联系 :: 订阅 :: 管理 ::
上一页 1 ··· 396 397 398 399 400 401 402 403 404 ··· 474 下一页

2013年9月30日

摘要: k_eckel:http://www.mscenter.edu.cn/blog/k_eckel文档视图结构(Document/View Architecture)是MFC的精髓,也是Observer模式的具体实现框架之一,Document/View Architecture通过将数据和其表示分开,提供了很好的数据层次和表现层次的解耦。然而,虽然我们使用MFC AppWizard就可以很轻松地获得一个支持Document/View Architecture的MFC程序框架,Document/View Architecture本身的复杂性加上VC产生的一系列代码足够让我们眼花缭乱,一时陷入云里雾里 阅读全文
posted @ 2013-09-30 09:01 DoubleLi 阅读(528) 评论(0) 推荐(0)

摘要: 参考文章:http://tech.sina.com.cn/s/2006-07-25/09051053460.shtml响应WM_NCHITTEST消息函数实现如下://////////////////// Non-client hit-test handler to move window by its client area.// If the user clicks anywhere on the client area, pretend it's the// caption. Windows does the rest!UINT CMyDialog::OnNcHitTest(CP 阅读全文
posted @ 2013-09-30 08:58 DoubleLi 阅读(407) 评论(0) 推荐(0)

摘要: MFC对话框屏蔽Enter和ESC键参考:http://www.docin.com/p-122354833.html方法一重载PreTranslateMessage函数 BOOL CXXDlg::PreTranslateMessage(MSG* pMsg){ //对话框屏蔽Enter和ESC键 if (WM_KEYDOWN == pMsg->message) { if ( (VK_RETURN == pMsg->wParam) || (VK_ESCAPE == pMsg->wParam)) { return TRUE; } } return CBCGP... 阅读全文
posted @ 2013-09-30 08:57 DoubleLi 阅读(532) 评论(0) 推荐(0)

摘要: 实现CSliderCtrl的子类CXXCtrl响应左键按下消息ON_WM_LBUTTONDOWN()void CXXCtrl::OnLButtonDown(UINT nFlags, CPoint point){ // 按键在滑动块区域内,不做操作 CRect tRect; GetThumbRect(&tRect); if (tRect.PtInRect(point)) { CSliderCtrl::OnLButtonDown(nFlags, point); return; } // 实现滑动块精确定位 CRect rcSlider; GetChannelRec... 阅读全文
posted @ 2013-09-30 08:54 DoubleLi 阅读(564) 评论(0) 推荐(0)

摘要: 在MFC使用过程中,遇到DLL资源与主EXE资源冲突问题。出现这样的Bug,一时无从下手。报错位置在核心代码中dlgcore.cpp。[cpp]view plaincopy BOOLAFXAPI_AfxCheckDialogTemplate(LPCTSTRlpszResource,BOOLbInvisibleChild){ASSERT(lpszResource!=NULL);HINSTANCEhInst=AfxFindResourceHandle(lpszResource,RT_DIALOG);HRSRChResource=::FindResource(hInst,lpszResource,R 阅读全文
posted @ 2013-09-30 08:53 DoubleLi 阅读(1921) 评论(0) 推荐(0)

摘要: 说明:文章内容部分参考网络上的解决思路。在没有安装Microsoft Visual Studio的系统上,Debug版本无法正常运行。这是由于缺少vs运行时库引起的。以vs2005为例。开发机用vs2005编译出Debug版本程序,发送到一台没有安装过vs的机器上运行,运行不成功。解决方法如下。C:\ProgramFiles\Microsoft Visual Studio 8\VC\redist\Debug_NonRedist\x86\Microsoft.VC80.DebugCRT下找到了下列文件:msvcm80d.dllmsvcp80d.dllmsvcr80d.dllMicrosoft.VC 阅读全文
posted @ 2013-09-30 08:42 DoubleLi 阅读(3216) 评论(0) 推荐(0)

摘要: 参考资料:http://apps.hi.baidu.com/share/detail/39003388http://blog.csdn.net/yc0188/article/details/4741871http://bbs.chinaunix.net/thread-2094334-1-1.html//头文件#include #include #include using namespace std;//函数声明int request(char* hostname, char* api, char* parameters);//方法调用int _tmain(int argc, TCHAR* a 阅读全文
posted @ 2013-09-30 08:41 DoubleLi 阅读(7042) 评论(0) 推荐(0)

摘要: 一、 概述C++多线程开发中,容易出现死锁导致程序挂起的现象。关于死锁的信息,见百度百科http://baike.baidu.com/view/121723.htm。解决步骤分为三步:1、检测死锁线程。2、打印线程信息。3、修改死锁程序。二、 程序示例VS2005创建支持MFC的win32控制台程序。代码见示例代码DeadLockTest.cpp。[cpp]view plaincopy //DeadLockTest.cpp:Definestheentrypointfortheconsoleapplication.//#include"stdafx.h"#include&qu 阅读全文
posted @ 2013-09-30 08:40 DoubleLi 阅读(1229) 评论(0) 推荐(0)

2013年9月29日

摘要: Cppcheck is an analysis tool for C/C++code. Unlike C/C++ compilers and many other analysis tools, it doesn’t detect syntax errors. Cppcheck only detects the types of bugs that the compilers normally fail to detect. The goal is no false positives.Cppcheck is rarely wrong about reported errors. But th 阅读全文
posted @ 2013-09-29 21:04 DoubleLi 阅读(3173) 评论(0) 推荐(0)

摘要: 类似QQ与360软件,消息提示有两种。上下浮动、渐入渐出。1、上下浮动提示框实现机制,定时器响应上下浮动消息。主要API:MoveWindow。源码如下UpDownTipDlg.h、UpDownTipDlg.cpp。UpDownTipDlg.h[cpp]view plaincopy /**@brief上下浮动提示框*@date2012-8-9*/#pragmaonce//CUpDownTipDlgdialogclassCUpDownTipDlg:publicCDialog{DECLARE_DYNAMIC(CUpDownTipDlg)public:CUpDownTipDlg(CWnd*pPare 阅读全文
posted @ 2013-09-29 21:03 DoubleLi 阅读(1734) 评论(0) 推荐(0)

上一页 1 ··· 396 397 398 399 400 401 402 403 404 ··· 474 下一页