Introduction to Microsoft Visual C++/MFC

news/2025/11/4 17:57:04/文章来源:https://www.cnblogs.com/xiaobin-hlj80/p/19191031

Introduction to Microsoft Visual C++/MFC

https://www.functionx.com/visualc/Lesson01.htm

OS: Windows 10 1809(LTSC) 

 

The Microsoft Visual C++ Environment

 

 

Introduction

 
 

Microsoft Visual C++ is a programming environment used to create applications for the Microsoft Windows family of operating systems. To use these lessons, you must have installed either Microsoft Visual Studio 2013. Although Microsoft Visual Studio 2013 Community Editon provides many programming environments for the price of one, in our lessons, we will use it but we will cover only the Microsoft Foundation Class (MFC) library side.

After installing it, to use the programming environment, you must first open it. To do that, you would click Start -> (All) Programs -> Visual Studio 2013 -> Visual Studio 2013.

In our lessons, unless used in code, the -> arrow means an action that should follow another. Based on this:

  • Edit -> Copy means click Edit, then click Copy
  • View -> Toolbars -> Custom means click View position the mouse on Toolbars, and then click Custom

Practical LearningPractical Learning: Launching Microsoft Visual C++

 
  • To start Microsoft Visual C++ or Visual Studio, on the Taskbar, click Start (All) Programs -> Visual Studio 2013 -> Visual Studio 2013

ide1-vs2013

The Integrated Development Environment

 

After Microsoft Visual Studio has been opened, the screen you get is called an Integrated Development Environment or IDE. The IDE is the set of tools you use to create a program.

The title bar is made of three section. The left section shows the system icon. The system icon is used to identify the application that you are using. Almost every application has its own system icon. The system icon holds its own list of actions; for example, it can be used to move, minimize, maximize or close (when double-clicked) a window.

The middle section of the title bar displays Microsoft Visual Studio. This starting title displays in the beginning until you decide to create a particular type of application, then the title changes. You will experience it once we start some programming assignments. The middle section of the title bar can be also used to move, minimize, maximize the top section of the IDE, or to close Visual Studio. You can perform these actions by right-clicking the title bar and selecting from the menu.

The right section of the title bar shows three system buttons:

Button Role
Minimizes the window
Maximizes the window
Restores the window
Closes the window

The main menu under the title bar is used to perform all types of actions on the IDE. In our lessons:

  • The expression "main menu" refers to the menu in the top section of the IDE
  • MSVC means Microsoft Visual C++.

A toolbar is an object made of buttons. These buttons provide the same features you would get from the main menu. Under the main menu, the IDE is equipped with a Standard toolbar used to create a new project, open a file, save a project, etc.

The Code Editor

 

Besides designing applications, one of your most regular jobs will consist of writing code that directs the computer as to what to do, when, and how to do it. This is done in an appropriate window called the Code Editor.

The Code Editor is a feature-rich text editor programmed to recognize the parts of a program that belong to C++ or not. The Code Editor manages your jobs by organizing its files into labels or tabs. If your project contains more than one file, you can click the desired tab to access one of the files.

The basic building block of a program is called a C++ file. Whenever you create a new project, the Microsoft Visual Studio programming environment creates various files, such as header files and source files. To display a header file, you can double-click its name in the Class View. Since the source and the header file go in pair (when using classes), they hold the same name but have different extensions.

The Toolbars

 

A toolbar is an object made of buttons. These buttons provide the same features you would get from the (main) menu, only faster. Under the main menu, the Integrated Development Environment (IDE) is equipped with the Standard toolbar.

By default, when you start Microsoft Visual Studio, it is equipped with one toolbar: Standard. To get more toolbars, on the main menu, you can click View -> Toolbars and click the toolbar of your choice. You can also right-click any available toolbar or the main menu. This displays a list of all the available toolbars. Those that are currently opened have a check mark next to them.

A toolbar is equipped with buttons. To know what a button is used for, you can position the mouse on top of it. A tool tip will come up and display for a few seconds. In our lessons, each button on any toolbar will be named after its tool tip. This means that, if a tool tip displays "New", its button will be called the New button.

Microsoft Visual Studio's menus and toolbars can be customized. You can customize a menu category on the main menu by adding a menu item to it. You can customize a toolbar by adding a button to it. To start, right-click anything on the main menu or on any toolbar and click Customize... For example, imagine you want to add an item named Start Without Debugging so that it would let you easily execute your projects and you want to add its button to the Standard toolbar, and imagine you want to position it on the left side of the Start button:

customize1-vs2013

To proceed:

          1. You can right-click any button on any toolbar or right-click the main menu and click Customize
          2.  On the Customize dialog box, click the Commands tab
          3.  Click the Toolbars radio button
          4.  In the right combo box, select the toolbar to which you want to add a button. In this case, that would be Standard
          5. In the Controls list, click the button that will succeed the one you want to add. In this case, this would be Start / Continue:
          6. customize11-vs2013

          7. In the right list, click Add Command
          8.  In the Add Command dialog box, in the Categories list, select the category that has the button you want
          9.  In the Commands list, click the button or menu item you want. For our example, that would be Start Without Debugging
          10. customize2-vs2013
          11. After makiing the selection, click OK
          12. customize3-vs2013
          13. On the Customize dialog box, click Close:

 customize21-vs2013

In the same way, you can customize any toolbar and any menu category.

The Studio Windows

 

 

The Start Page

 

The Start Page is the first wide area that appears when Microsoft Visual Studio comes up. The left section displays a list of recently used projects under Recent Projects. At any time, to display the Start Page:

  • You can click the Start Page label in the top section of the Code Editor
  • On the main menu, you can click View -> Start Page

If you have just installed Microsoft Visual Studio or have not previously opened a project, the Recent Projects section would be empty. Once you start creating and using projects, they display in the Recent Projects section by their names.

Showing and Closing a Window

 

When you start or open a project, Microsoft Visual Studio makes some windows available. These are the most regularly used windows. If you think that one of them is not regularly used in your types of assignments, you can remove it from the screen. To hide a window, you can click its Close button Close.

All of the windows you can use are listed in the View menu. Therefore, if a window is not displaying, you can click View on the main menu and click a window of your choice.

Practical LearningPractical Learning: Showing the Windows

 
  1. On the main menu, click View -> Solution Explorer
  2. Again, on the main menu, click View -> Toolbox

Auto Hiding a Window

 

When working on a project, you will use a set of windows that each accomplishes a specific purpose. Some windows are represented with an icon but hide the rest of the body. To display such a window, you can position the mouse on it. This would expand the window:

 wndexpand1-vs2013

If you expand a window, it would display a title bar with three buttons. One of the button is called Auto Hide:

wndexpand2-vs2013

If you expand a window but find out you don't need it any more, you can just move the mouse away. The window would return to its previous state. Based on this functionality, if you are working with a window and move the mouse away, it would retract. If you need it again, you would have to reopen it using the same technique. If you are going to work with a certain window for a while, you can keep it open even if you move the mouse away. To do this, you can click the Auto Hide button. If clicked, the Auto Hide button changes from pointing left to pointing down:

autohide1-vs2013

By default, Microsoft Visual Studio installs some windows to the left and some others to the right of the screen. You can change this arrangement if you want. To do this, expand a window, then click its title bar and start dragging. While you are dragging, to assist you with a new position, the studio displays five boxes:

dragging1-vs2013

Docking a Window to a Side of the Studio

 

To position a window on one side of the screen, drag its title bar to the box that represents that side. When you get to a side, a transparent blue rectangle would be drawn to indicate the possible position. Drop the window to either the most right guiding box to position it to the right of the screen, or to the most left guiding box to position it to the left of the screen. Here is an example:

docking1-vs2013

or

docking2-vs2013

To position a window to the top or the bottom side of the studio, drag its title bar to either the most top guiding box to position it to the top of the studio or to the most bottom guiding box to position it to the bottom of the studio. Here is an example:

docking3-vs2013

 

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/955926.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

C++字符串选择char数组还是std::string比较

在实际项目中,选择使用 char数组(C风格字符串)还是 std::string主要取决于性能要求、内存控制、安全性、开发效率以及与外部接口的兼容性。没有绝对最好的选择,关键是根据具体场景进行权衡。考量维度 推荐选择 关键…

fastadmin配合宝塔面板造成cors error 跨域问题

最近写外包程序,需要给用户远程提供研发测试环境,为了方便维护研发环境,使用了宝塔面板进行搭建 该项目是一个unapp+fastadmin 开发的app,以及后台管理。 然后发现了一个坑。 众所周知app和前后端分离的站都会涉及…

2025年系统门窗定制厂家权威推荐榜单:品牌/系统门窗源头厂家、专业定制厂家精选

随着建筑节能环保标准的不断提高和消费者对家居品质需求的日益增长,系统门窗作为建筑外围护结构的关键组成部分,正迎来市场的黄金发展期。2025年,我国系统门窗市场规模已突破1000亿元,其中具备智能制造背景与绿色认…

12 Kodi

12 KodiKodi TV版本 # 简介 跨平台播放器 Kodi,本篇文章只介绍下 Kodi 看电视直播这个功能,其实这款软件还有好多强大的功能,能够播放几乎所有流行的音频和视频格式 # 下载Kodi https://kodi.tv/download/android/ …

收藏!计算机领域除顶会外,这6大核心期刊你绝不能错过

对于计算机领域的科研人来说,追顶会、读顶会论文是日常标配。但你知道吗? 除了CVPR、NeurIPS这些顶会 ,计算机领域还有一批影响力深远、覆盖方向多元的核心期刊 ,它们或是领域理论的压舱石,或是跨学科应用的试验田…

视频汇聚平台EasyCVR赋能电力行业智能化转型的“可视化”基石

在“数字中国”与“新型电力系统”建设的战略背景下,电力行业的智能化转型已不是选择题,而是必答题。然而,传统的电力视频系统存在设备品牌杂、协议不互通、数据价值挖掘浅等痛点,形成了众多“信息孤岛”。EasyCVR…

2025年平顶山专业戒网瘾机构权威推荐榜单:孩子戒网瘾/戒网瘾/正规戒网瘾源头机构精选

在数字化时代背景下,青少年网络成瘾问题日益受到社会关注。据2025年教育部门统计数据显示,我国青少年网络依赖现象发生率已达18.6%,专业干预服务的市场需求持续增长。 随着家庭教育理念的升级和专业服务的规范化发展…

视频融合平台EasyCVR:打造智慧酒店一体化安防体系,筑牢安全管理防线

一、需求背景 在智慧酒店的建设浪潮中,宾客体验的便捷性与个性化备受关注,然而,一切智慧服务的基石——安全,却始终是酒店运营的生命线。传统酒店安防体系常面临设备品牌杂乱、系统相互孤立、响应效率低下等痛点,…

2025年沈阳编程机构权威推荐榜单:spike编程/scratch编程/python编程源头机构精选

在数字化教育快速发展的背景下,编程教育已成为培养青少年科技创新能力的重要途径。据统计,2025年全国少儿编程市场规模同比增长超20%,其中沈阳作为东北地区的教育重镇,编程教育渗透率显著提升。本文基于课程体系完…

为什么库存永远不准?从流程角度拆解账实不符的根源

为什么库存永远不准?从流程角度拆解账实不符的根源。 我接触过很多制造企业和仓库管理项目,规模有大有小,行业也不一样,但共同点非常明确:库存永远不准。 很多公司误以为库存不准是因为员工不用心,所以开始罚钱.…

virt-manager代替virtualbox

背景 virtualbox无法在6.12内核中调用kvm报错VirtualBox cant operate in VMX root mode. Please disable the KVM kernel extension, recompile your kernel and reboot. (VERR_VMX_IN_VMX_ROOT_MODE).嗯,看来Oracle意…

2025年触摸薄膜开关优质厂家权威推荐榜单:二维码薄膜开关/PVC薄膜开关/电容薄膜开关源头厂家精选

2025年全球薄膜开关市场正迎来稳健增长,据行业报告显示,未来几年该市场将保持稳定发展态势,中国已成为全球重要的生产和消费市场之一。 作为现代电子设备中不可或缺的交互元件,触摸薄膜开关以其结构轻薄、密封性好…

解析安川机器人氩弧焊省气的工作原理

在工业焊接领域,保护气体的消耗一直是成本控制中的一个重要因素。特别是对于采用氩弧焊技术的安川焊接机器人来说,如何有效减少气体使用量而不影响焊接质量,成为了众多企业追求的目标。近年来,一种名为WGFACS的节气…

Gitlab通过Token生成的用户怎么删除

Gitlab创建Token克隆代码后会在对应项目生成一个Bot的用户在页面是无法删除的 会报如下错误403: You do not have thepermission to access this page Please contact your GitLab administrator to get permission.需…

Linux---进程信号 - 教程

Linux---进程信号 - 教程pre { white-space: pre !important; word-wrap: normal !important; overflow-x: auto !important; display: block !important; font-family: "Consolas", "Monaco", &q…

模拟电路噪声优化

在精密 IC 设计中,噪声是性能提升的关键瓶颈。本篇博客将聚焦模拟电路中的噪声来源、分析与优化技术,帮助设计者突破性能极限。 1、噪声类型与挑战模拟电路中常见的噪声包括: I. 热噪声:由电阻中电子随机运动产生,…

FPGA自学笔记(正点原子ZYNQ7020):1.Vivado软件安装与点灯 - 教程

pre { white-space: pre !important; word-wrap: normal !important; overflow-x: auto !important; display: block !important; font-family: "Consolas", "Monaco", "Courier New", …

【办公类-109-06】20250916圆牌卡片15CM手工纸+动物头像+拼音表+word单面编辑 - 教程

pre { white-space: pre !important; word-wrap: normal !important; overflow-x: auto !important; display: block !important; font-family: "Consolas", "Monaco", "Courier New", …

Prometheus监控系统安装

Prometheus是基于go语言开发的。 Go(又称Golang)是Google开发的一种静态强类型、编译型、并发型,并具有垃圾回收功能的编程语言,可以支持多种语言客户端 Prometheus下载:https://prometheus.io/download/ 1、安装…

把24款搜狗拼音热门皮肤转成了fcitx可用的

把24款搜狗拼音热门皮肤转成了fcitx可用的〔下载〕5.8M 将近我的语言模型的两倍了。:-) ssf2fcitx在转换部分.ssf文件时,openssl的库里出错,我怀疑是Qt的问题〔详情〕。 修改版不用Qt,无此问题。 ssf2dir把.ssf文件…