VC++/MFC 教程3(英文) (轉)
Lesson 3: Visual C++ and Workspaces
programming is tricky stuff. Don't let anyone fool you. But 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 re 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 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 ton 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.
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/10748419/viewspace-1007465/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- VC++/MFC 教程1(英文) (轉)C++
- VC++/MFC 教程2(英文) (轉)C++
- VC++/MFC 教程4&5(英文) (轉)C++
- VC++/MFC 教程6&7(英文) (轉)C++
- VC++ MFC UpdateData()用法C++
- VC++ MFC入門簡明教程,我當時就是看了它一天入門的 (轉)C++
- VC++、MFC、COM和ATL的區別C++
- VC++ MFC程式設計版本資訊控制C++C程式程式設計
- MFC開發常見問題的回答3 (轉)
- No MFC,Only API (轉)API
- mfc程式流程 (轉)C程式
- 初學MFC(3)——樹型控制元件之一 (轉)控制元件
- 讓VC++支援中文 (轉)C++
- 思科認證CCNA專業英文詞彙全集(3)(轉)
- 初學MFC(2) (轉)
- 初學MFC(1) (轉)
- VC++ 執行緒同步(轉)C++執行緒
- VC++ 串列埠通訊(轉)C++串列埠
- VC++中STL的使用 (轉)C++
- Visual C++/MFC入門教程C++
- Visual C++/MFC 指南(4):MFC 簡要指點 (轉)C++
- Python 英文的月份轉數字及數字轉英文Python
- VC++ 的串列埠通訊 (轉)C++串列埠
- 用VC++編寫CGI程式 (轉)C++
- NO MFC - 使用 .log 除錯程式 (轉)除錯
- linux入門教程(3)(轉)Linux
- 再談Delphi vs VC++(非常精彩) (轉)C++
- VC++ 6.0 結構定義大陷阱 (轉)C++
- VC++訊息對映的思考 (轉)C++
- 中英文混讀,文字轉換到MP3的語音軟體 (轉)
- MFC技術內幕簡結 (轉)
- 簡述MFC程式生與死 (轉)C程式
- 英文大小寫轉換
- [轉]符號的英文叫法符號
- Java Servlet和JSP教程(3)(轉)JavaServletJS
- VC++中實現程式互斥執行 (轉)C++
- VC++初學者常見問題解惑 (轉)C++
- VC++實現撥號上網程式 (轉)C++