Intro to MFC. Open VS and create new project 1)Open MS Visual Studio 2008 Professional (It must be the Professional Edition, the Express Edition will.

Slides:



Advertisements
Similar presentations
1 After completing this lesson, you will be able to: Create a database. Create a table using the Table Wizard. Create and modify a table in Design view.
Advertisements

Burning a Video or File to a CD 1.Double click on the Nero- Burning Rom icon on your desktop or go to “Start” > “Programs” > “ahead Nero” > “Nero Burning.
11 Getting Started with ASP.NET Beginning ASP.NET 4.0 in C# 2010 Chapters 5 and 6.
© by Pearson Education, Inc. All Rights Reserved.
Visual Basic 2010 How to Program. © by Pearson Education, Inc. All Rights Reserved.2.
Visual Basic 2010 How to Program Reference: Instructor: Maysoon Bin Duwais slides Visual Basic 2010 how to program by Deitel © by Pearson Education,
Guide to Oracle10G1 Introduction To Forms Builder Chapter 5.
 2006 Pearson Education, Inc. All rights reserved Introduction to the Visual C# 2005 Express Edition IDE.
Automating Tasks With Macros
CA 121 Intro to Programming Tariq Aziz and Kevin Jones GUI Programming in Visual Studio.NET Chapter 1 Tariq Aziz and Kevin Jones.
CA 121 Intro to Programming Tariq Aziz and Kevin Jones GUI Programming in Visual Studio.NET Chapter 2 Tariq Aziz and Kevin Jones.
Automating Tasks With Macros. 2 Design a switchboard and dialog box for a graphical user interface Database developers interact directly with Access.
1 Introduction to the Visual Studio.NET IDE Powerpoint slides modified from Deitel & Deitel.
1 Creating Icons for Commands When there is not an icon related to a command in your toolbars, you will see a question mark (?). No preview available …
Chapter 9 Macros, Navigation Forms, PivotTables, and PivotCharts
Microsoft Visual Basic 2005 CHAPTER 8 Using Procedures and Exception Handling.
Visual Basic 2008 Express Edition The IDE. Visual Basic 2008 Express The Start Page Recent Projects Open an existing project Create a New Project.
Hello World In C++ and Microsoft Visual C++. Directions to begin a project 1. Go to All Programs 2. Open Visual Studio C++ 3. Click on New Project 4.
Making a Timer in Alice.
Introduction to Graphical User Interfaces. Objectives * Students should understand what a procedural program is. * Students should understand what an.
IT 211 Project Integration and Deployment Lab #11.
IE 411/511: Visual Programming for Industrial Applications
A First Look At Microsoft Visual Basic Lesson 1. What is Microsoft Visual Basic? Microsoft Visual Basic is a software development tool, which means it.
Putting Applets into Web Pages.  Two things are involved in the process of putting applets onto web pages ◦ The.class files of the applet ◦ The html.
Creating a Project with C++ Builder
Teacher’s Assessment Assistant Worksheet Builder Starting the Program
Classic Controls Trần Anh Tuấn A. Week 1 How to create a MFC project in VS 6.0 How to create a MFC project in VS 6.0 Introduction to Classic Controls.
Tutorial 11 Five windows included in the Visual Basic Startup Screen Main Form Toolbox Project Explorer (Project) Properties.
Project Deployment IT [211 CAP] How to convert your project to a full application.
BIL528 – Bilgisayar Programlama II Introduction 1.
Visual Basic.NET BASICS Lesson 1 A First Look at Microsoft Visual Basic.NET.
Course ILT Forms and queries Unit objectives Create forms by using AutoForm and the Form Wizard, and add or modify form headers and footers Open and enter.
Chapter 2 – Introduction to the Visual Studio .NET IDE
1 Creating Windows GUIs with Visual Studio. 2 Creating the Project New Project Visual C++ Projects Windows Forms Application Give the Project a Name and.
Microsoft Visual Basic 2005 BASICS Lesson 1 A First Look at Microsoft Visual Basic.
Visual Basic for Application - Microsoft Access 2003 Programming applications using Objects.
CS 281 – Fall 2015 Lab 4 Parametric Query and Forms in MS Access.
Dreamweaver MX. 2 Tools for Code Editing (p. 366) n An HTML editor like Dreamweaver writes most of the code you need, but at times you will need to perform.
This is how you invoke the Microsoft Visual Studio 2010 Software. All Programs >> Microsoft Visual Studio 2010.
1 After completing this lesson, you will be able to: Create a form using AutoForm. Create a form using the Form Wizard. Add controls to a form. Modify.
Chapter 3 I Need a Tour Guide (Introduction to Visual Basic 2010) Clearly Visual Basic: Programming with Visual Basic nd Edition.
Lecture Set 2 Part A: Creating an Application with Visual Studio – Solutions, Projects, Files 8/10/ :35 PM.
COMPUTER PROGRAMMING I 3.01 Apply Controls Associated With Visual Studio Form.
11 Getting Started with ASP.NET Beginning ASP.NET in C# and VB Chapters 1 and 2.
Build a database II: Create tables for a new Access database Create your tables In a relational database, tables store your data. Your data doesn’t “live”
Visual Basic.Net. Software to Install Visual Studio 2005 Professional Edition (Requires Windows XP Pro) MSDN Library for Visual Studio 2005 Available.
COMPUTER PROGRAMMING I 3.01 Apply Controls Associated With Visual Studio Form.
 2002 Prentice Hall. All rights reserved. 1 Introduction to the Visual Studio.NET IDE Outline Introduction Visual Studio.NET Integrated Development Environment.
CS 281 – Fall 2010 Lab 4 Parametric Query and Forms in MS Access.
Problem: Take Two Numbers, Add Them Together And Display The Results. Now To Build The Flowchart… We Probably Need One Like This… Let’s Add The Routines…
 2007 Pearson Education, Inc. All rights reserved Introduction to the Visual Basic Express 2005 IDE.
Lessons Copy and Paste Text Drag and Drop Text 2-Saving Documents 3- Printing 4-Inserting Tables Modifying Page Layout Format Page Margins Insert a Blank.
Getting Started with Microsoft Word
Dive Into® Visual Basic 2010 Express
Chapter 2: The Visual Studio .NET Development Environment
Weebly Elements, Continued
Visual Basic Code & No.: CS 218
Using a template to create a document
Chapter 2 – Introduction to the Visual Studio .NET IDE
3.01 Apply Controls Associated With Visual Studio Form
RAD Certification Checkpoint #2 Introducing RadStudio (Hello World)
1. Introduction to Visual Basic
Visual programming Chapter 1: Introduction
3.01 Apply Controls Associated With Visual Studio Form
Working with Dialogs and Controls
Introduction to the Visual C# 2005 Express Edition IDE
MFC Dialog Application
Quick Start Guide for Visual Studio 2010
Chapter 2 – Introduction to the Visual Studio .NET IDE
GUI Programming in Visual Studio .NET
Presentation transcript:

Intro to MFC

Open VS and create new project 1)Open MS Visual Studio 2008 Professional (It must be the Professional Edition, the Express Edition will not work. You can get the Professional version for free from ELMS) 2)Select File -> New -> Project… Fig. 1 – Step 2

3) Now under the Visual C++ tree select MFC, then MFC Application, then in the Name box type “MyFirstWindow” and choose OK. On the next window select Finish Fig 2 – New Project

4) You now have a new blank project. However, if you choose Debug -> Start without Debugging, you will see that an MFC project already has a basic window. Fig 3 – Start without Debugging Fig 4 –MFC Window without adding anything

5) Now let’s see the about Box, in your new window select Help -> About. A pretty plain About Box pops up. Now we’ll add our info to it. Fig 5 – Step 5 Fig 6 – Default About Box

6) Go back to Visual Studio. In the toolbar select View -> Resource View Fig 7 – Step 6

7) Now expand the tree in the Resource View. You want to get to MyFirstWindow -> MyFirstWindow.rc -> IDD_ABOUTBOX. 8) Double Click on IDD_ABOUTBOX. You will see the about box we just saw in the running window. Fig 8 - Step 7 Fig 9 - Step 8

9) On the right side of the Visual Studio Window there is a tab for the Toolbox, click on it. If it is not on the right side, look around, because it is possible to move it. Fig 10 – Step 9

10) You will now see the Toolbox. You can now drag and drop any of these GUI components into your window. Go ahead and try it out. Fig 11 –Step 10

11) Next lets add a button to the About Box, just by dragging it over and dropping it in. 12) Next, replace the default text Button1, with YourName. Right click on the new button and select Properties. Under Appearance, change the text to the right of Caption to YourName. Fig 12 – Step 12

13) Now just recompile the project and open the about box and see your change. Fig 13 – Modified About Box

Now let’s make the new button close the dialog. 14) Go back to the resource view, Right click “YourButton” -> Properties. 15) Change the ID from IDC_BUTTON1 to IDC_YOURNAME_BUTTON 16) Next double click on the button, it should take you to a new method, called void CAboutDlg::OnBnClickedYournameButton(). This method will be called when someone clicks on your button. Fig 14 – Change ID in Properties

17) To make your button close the window when it’s clicked, add “OnOK()” to the body of the method. 18) What calls this method? The MESSAGE_MAP; there you will find a line ON_BN_CLICKED(IDC_YOURNAME_BUTTON, &CAboutDlg::OnBnClickedYournameButton) There are many events that can be added; however be careful they are not all available for all components and even if it seems they should be available, they may not be. 19) Now recompile and check your button.

20) Notice how we can create or open many documents in our editor, but we can’t type in them. 21) Now create a document that we can type in. Create a new project, named “MyFirstDocWindow”, you can go back and do steps 1 to 3, but instead of hitting “Finish” to create the project hit “Next” multiple times until you are at the “Generated Classes” tab. Fig 15 – MFC Wizard Generated Classes Tab

22) Change the “Base Class” to “CEditView” in the drop down box 22) Now click “Finish”, once the project is created, compile it and see what happens. Fig 16 – MFC Wizard Generated Classes Tab