VC++/MFC 教程3(英文)

原创 2001年06月04日 11:25:00

Lesson 3: Visual C++ IDE and Workspaces

Windows programming is tricky stuff. Don't let anyone fool you. But microsoft has blessed us with their IDE called Developer's Studio. It will handle all the compiling and linking, provides help, fills in tons of code for you, and gives you that 'visual' designing environment to make cute little dialogs.

There a few things you must learn to use to get anywhere. First and most importantly, USE THE ONLINE HELP. There are so many windows functions, you will find yourself in the help 50% of the time or more for the first few months. If you have visual c 6.0 you need the MSDN for help. Get it. If you have 4.2 or 5.0 you can use the built in help.

Next, the single most important key combination is Ctrl-W. This brings up what is called the 'Class Wizard'.  This guy will insert a bunch of code in your project for you. It handles all the code for connecting functions up to the messages windows posts.

You will also find yourself in the resource view a bit. It is used to design the dialogs. You can drop buttons on them and what not. With a couple of clicks here and there you can layout your whole application.  Then using the class wizard, you can have your project 50% finished.  All is left is to fill in the functions the class wizard made to handle the button click messages and what not.

Now you need to know how to start a new program and we can begin with the real code. Go to the File menu and select New. Then go to the 'Projects' tab and select MFC AppWizard. Type in a name for you application and press ok. The only important option for now is the first one. This is the type of application you want to build. The simplest is a 'Dialog Based'. Try them all, but try dialog based first. Just select all the defaults afterwards by pressing 'next' and 'ok'. You'll end up with a few files, but lets ignore everything.

Go to the resource view and plop some buttons and stuff on the dialog. Just play around. When you feel like it, Build the project from the 'Build' menu and run it (I always just press Ctrl-F5, it builds the project and runs it). Everything should build and run. Wa-la. Application complete and running.

One last tip on the IDE. If you right click on a menu bar, a dialog will pop up. You can select 'Customize'. This is very useful. You can build one custom menu with all the buttons you need on it by simply dragging the buttons to and from the menu bar. You can even change the menu layout (like by putting the File, New as a button on the tool bar). One really needed control is under the Build category in the customize dialog. It is the drop list used to select the active configuration. Drag that sucker up to your main toolbar and change it's size still it looks good to you. I have only one toolbar on my screen and it has the following buttons on it: save, save all, compile, build, stop build, rebuild all, set active configuration, find, find in files, show view, show output window, set break point, remove break point, tile windows, find in help.


发现一个“新浪微盘”,空间大,下载方便,也没有广告。以后我会陆续把我的所有开发资料移到“新浪微盘”中,免费分享给大家。 (1) 有“新浪微博”的可以直接拷贝资料到你自己的新浪微盘(我的新浪微盘 );...
  • tsroad
  • tsroad
  • 2015年11月09日 16:19
  • 4031

VC6.0之MFC 单文档操作

  • pk124729136
  • pk124729136
  • 2014年06月24日 10:22
  • 2457

MFC的多国语言界面的实现 dialog multilanguage 基于对话框

转载请注明原文网址: 目前很多软件都是要出口到多个国家,因此,为软...
  • lanmanck
  • lanmanck
  • 2014年08月19日 13:31
  • 3397


  • 2009年05月23日 20:36
  • 556KB
  • 下载


从C++起步到MFC实战VC++软件工程师高端培训视频教程 本课程从C++起步、用户无需任何计算机基础,只需要懂的基本的电脑操作,既可学习本课程,本课程适合在校大学生,在职人员等,通过本课程...
  • xkqueen2
  • xkqueen2
  • 2015年02月04日 12:00
  • 1100


(1) 有“新浪微博”的可以直接拷贝资料到你自己的新浪微盘(我的新浪微盘 ); (2) 没有“新浪微博”的,也很方便,也是可以直接下载或者在线浏览,速度也很快。     "C+...
  • budingningmeng
  • budingningmeng
  • 2012年11月27日 21:39
  • 2913


发现一个“新浪微盘”,空间大,下载方便,也没有广告。以后我会陆续把我的所有开发资料移到“新浪微盘”中,免费分享给大家。 (1) 有“新浪微博”的可以直接拷贝资料到你自己的新浪微盘(我的新浪微盘 ...
  • xyw_Eliot
  • xyw_Eliot
  • 2013年06月19日 21:39
  • 4220


MFC(Microsoft Foundation Class,微软基础类库)1. C语言程序的执行步骤 (1)全局变量分配内存(2)进入main函数2. MFC程序的运行过程 (1)利用全局应用...
  • St_One_Lip
  • St_One_Lip
  • 2016年12月16日 23:23
  • 155


孙鑫VC++讲座笔记-(3)MFC程序框架的剖析 1,寻找WinMain人口: 在安装目录下找到MFC文件夹下的SRC文件夹,SRC下是MFC源代码。 路径:MFC|SRC|APPMODUL.C...
  • skywn
  • skywn
  • 2012年04月25日 23:46
  • 1150

VC++ MFC编程学习笔记(3)

VC++MFC基于CFormView类的单文档基本使用:   1程序运行窗口标题图标的改变: 在资源视图中的Icon文件夹中导入图表资源修改图标ID为:IDR_MAINFRAME 重新运行...
  • u013800219
  • u013800219
  • 2014年07月28日 18:06
  • 530
您举报文章:VC++/MFC 教程3(英文)