在这个选项上什么时候选哪个?如果选择use MFC in a Shared DLL 的话,你编译后的程序中不包含MFC库,所以文件会比较小,但是如果你的程序直接移到一个没有安装过MFC的机器上时,可能会导致找不到MFC的DLL。如果选择Use MFC in a Static Library ,那你编...
分类:
其他好文 时间:
2014-09-02 19:22:45
阅读次数:
163
函数原型:virtualBOOLPreTranslateMessage(MSG*pMsg)1、在MFC中,PreTranslateMessage是虚函数,是用来截获消息的。我们可以通过重载它来处理键盘和鼠标消息。在sdk中,这有所不同,我们必须在回调函数 LRESULTCALLBACKWndProc...
分类:
其他好文 时间:
2014-09-02 13:48:34
阅读次数:
146
//头文件包含#include"stdafx.h"#include<WinSock2.h>#include<Iphlpapi.h>#include<iostream>usingnamespacestd;#pragmacomment(lib,"iphlpapi.lib")//函数声明voidoutput(PIP_ADAPTER_INFOpIpAdapterInfo);//程序入口int_tmain(intargc,_TCHAR*argv[]){ //..
分类:
其他好文 时间:
2014-09-02 12:36:55
阅读次数:
226
添加OnLButtonDown()函数可以VS里面的导向添加,这样比较方便然后在里面加入: // TODO: 在此添加消息处理程序代码和/或调用默认值 PostMessage(WM_NCLBUTTONDOWN, HTCAPTION, MAKELPARAM(point.x, point.y)); C....
分类:
移动开发 时间:
2014-09-02 12:18:44
阅读次数:
286
在头文件中添加一个CImage m_image;然后在CPP中的OnInitDialog()函数中加载图片: img.Load(_T("res/xxxx.png")); //wuziqi.png是我要加载的图片名称,包含路径然后在OnPaint()函数中添加:CRect rect;GetCli...
分类:
其他好文 时间:
2014-09-02 12:11:04
阅读次数:
244
1 #ifndef _SPLASH_SCRN_ 2 #define _SPLASH_SCRN_ 3 4 5 //这是一个启动画面类,这里注释便不多写了,网上有 6 #pragma once 7 // CWzdSplash 8 class CWzdSplash : public CWnd...
分类:
其他好文 时间:
2014-09-02 12:10:44
阅读次数:
231
作者:朱金灿来源:http://blog.csdn.net/clever101/ 使用AfxGetMainWnd函数获取MFC程序中的主框架类指针是一个常用作法。但是你会发现这一做法有时也会失灵。不信,你测试一下下面的代码:[cpp]view plaincopyunsigned__stdcallSe...
分类:
其他好文 时间:
2014-09-02 12:10:04
阅读次数:
244
//让对话框透明化 SetWindowLong(GetSafeHwnd(), GWL_EXSTYLE, GetWindowLong(GetSafeHwnd(), GWL_EXSTYLE) ^ 0x80000); SetLayeredWindowAttributes(0, 150, LWA_ALPHA...
分类:
其他好文 时间:
2014-09-02 12:06:24
阅读次数:
154
在APP中增加PreTranslateMessage()函数。添加if (CSplashWnd::PreTranslateAppMessage(pMsg)) //你想要的函数。 return TRUE;例子:BOOL CSplashWnd::PreTranslateAppMessage(MSG* p...
分类:
其他好文 时间:
2014-09-02 12:05:34
阅读次数:
188
1.使用string必须添加头文件#include"string"using namespace std;2.使用CString必须添加头文件(在非MFC工程中)#include"afx.h"注意:当出现#error : Building MFC application with /MD[d] (C...
分类:
其他好文 时间:
2014-09-02 10:19:14
阅读次数:
204