进入Project->Settings->General 下,在下拉框中选“Use MFC
in a Static Library”(使用MFC做为静态链接库);然后添加头文件#include ,并且要放在其它头文件前。否则,会有#error :
WINDOWS.H already included...
1. vs 中新建win32 dll 项目 testdll添加实现文件
test.cpp#include "stdafx.h" #include using namespace std;int Add(int plus1, int
plus2){ int add_result = plus1 ...
分类:
编程语言 时间:
2014-05-19 10:25:52
阅读次数:
309
创建一个基于对话框的工程,工程名为CreateMenu为该对话框增加一个文件菜单项和测试菜单项,如下图所示测试菜单项至少要有一个子菜单项在对话框属性中关联该菜单在resource.h中增加一个ID_TESTMENU宏#define
ID_TESTMENU 5000在对话框中添加一个Button按钮,...
分类:
其他好文 时间:
2014-05-19 10:08:02
阅读次数:
289
#define IDM_NEW 0x1002#define IDM_EXIT
0x1003#define IDM_HELP 0x1004#define IDM_ABOUT 0x1005hMenu =
CreateMenu();hFileMenu = CreateMenu();hHelpMenu = ...
分类:
其他好文 时间:
2014-05-19 09:58:20
阅读次数:
251
新建一个单文档程序在查看菜单项中增加两个子菜单,分别为隐藏工具栏(ID_HIDE),新建菜单(ID_NEWMENU)在Resource.h中增加一个ID_NEWMENU宏#define
ID_NEWMENU WM_USER+101操作工具栏和状态栏使用GetDescendantWindow函数获取工...
分类:
其他好文 时间:
2014-05-19 09:54:28
阅读次数:
366
1. 加载 BMP[cpp] view
plaincopyprint?CStatic*pWnd=(CStatic*)GetDlgItem(IDC_PIC);//得到PictureControl句柄
pWnd->ModifyStyle(0,SS_BITMAP);//修改它的属性为位图 pWnd->Se...
分类:
其他好文 时间:
2014-05-19 09:27:13
阅读次数:
355
>__ 100010 #pragma once11 #endif // _MSC_VER
> 100012 13 #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from
Windows headers14 15 16 ...
>_ 2 class CMyApp:public CWinApp 3 { 4
public: 5 virtual BOOL InitInstance(); 6 }; 7 class CMainWindow:public CFrameWnd
8 { 9 public:10 CMainW...
分类:
其他好文 时间:
2014-05-18 20:22:10
阅读次数:
354
>_ 100010 #pragma once11 #endif // _MSC_VER >
100012 13 #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows
headers14 15 16 /...
>____ 100010 #pragma once11 #endif // _MSC_VER
> 100012 13 #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from
Windows headers14 15 1...