Opening Microsoft Visual Studio. On Microsoft Windows Vista and XP to open the visual studio do the following:

Similar documents
CST8152 Compilers Creating a C Language Console Project with Microsoft Visual Studio.Net 2005

CST8152 Compilers Creating a C Language Console Project with Microsoft Visual Studio.Net 2010

CST8152 Compilers Creating a C Language Console Project with Microsoft Visual Studio.Net 2003

TREX Set-Up Guide: Creating a TREX Executable File for Windows

Visual C++ Tutorial. For Introduction to Programming with C++ By Y. Daniel Liang

Creating a MOM 2005 Peformance Graph Report From a Template

EECE.2160: ECE Application Programming Spring 2018 Programming Assignment #1: A Simple C Program Due Monday, 1/29/18, 11:59:59 PM

Tutorial : creating a Max/MSP external project for Windows using Visual Studio

Getting started 7. Setting properties 23

Get an Easy Performance Boost Even with Unthreaded Apps. with Intel Parallel Studio XE for Windows*

Creating Mixed Language Projects with Microsoft Developer Studio 2005, Intel Fortran, MS C++ and Canaima Legacy Software

APPENDIX A. CODE COMPOSER STUDIO (CCS) v5: A BRIEF TUTORIAL FOR THE DSK6713

User Guide. Introduction. Requirements. Installing and Configuring. C Interface for NI myrio

Tutorial - Exporting Models to Simulink

Configuring Visual Studio 2017 with SFML Game Engine

Project: E337 GRAPHIC INTERFACE DESIGN FOR SIMULATION SOFTWARE

Fundamental C# Programming

Getting Started with Visual Studio

Binghamton University. EngiNet. State University of New York

PISCES Installation and Getting Started 1

Module 3: Working with C/C++

As CCS starts up, a splash screen similar to one shown below will appear.

MS Visual Studio.Net 2008 Tutorial

Welcome Application. Introducing the Visual Studio.NET IDE. Objectives. Outline

Compiling MapleSim C-Code in Visual C Express

Building AMD64 Applications with the Microsoft Platform SDK. Developer Application Note

Code::Blocks Student Manual

A Guide to Installing OLI Software

Hello World on the ATLYS Board. Building the Hardware

How to build Simbody 2.2 from source on Windows

Getting started 7. Setting properties 23

Tutorial for VC++ UDF Studio 18.2 SP1 Chinese Version

CIS 231 Windows 10 Install Lab # 3

Using OpenGL & GLUT in Visual Studio.NET 2003

How to configure the Matlab interface

CREATING CUSTOMER MAILING LABELS

Targeting the NetWare Operating System PDK 5.0

Uninstall A Apps Windows 8 Programming Using Microsoft Visual C++

As CCS starts up, a splash screen similar to one shown below will appear.

Outlook tips for road warriors

VI-CENTER EXTENDED ENTERPRISE EDITION GETTING STARTED GUIDE. Version: 4.5

Appendix M: Introduction to Microsoft Visual C Express Edition

C++ - OpenGL - Setting up Visual Studio

Check the Desktop development with C++ in the install options. You may want to take 15 minutes to try the Hello World C++ tutorial:

15 - Libraries Activating libraries

Sun VirtualBox Installation Tutorial

To get started with Visual Basic 2005, I recommend that you jump right in

Saleae Device SDK Starting a Device SDK Project on Windows Starting a Device SDK Project on Linux... 7

Installing Geant4 v9.5 for Windows

PART 1: Getting Started

ALTIRIS Console 6.5 Overview

ECE 103 In-Class Exercise L1 Guide

dbdos PRO 2 Quick Start Guide dbase, LLC 2013 All rights reserved.

EDEM Dynamics Coupling Quick Start Guide

Visual C++ MFC Programming By Example By John E. Swanke

For additional information, please consult the Read-Me and Help documentation or contact Electro-Voice or Dynacord technical support.

Files and Folders Management

Managing Files & Folders

How to Talk To Windows. What did it say?

Code::Blocks Student Manual

CANape ASAM-MCD3 Interface Version Application Note AN-AMC-1-103

SonicCell. Using SonicCell with SONAR LE. Workshop ÂØÒňÎ. Expandable Synthesizer Module and Audio Interface SCWS03 1

Introduction to Microsoft Access 2016

OUTLOOK TIPS AND TRICKS GINI COURTER, M.B.A., TRIAD CONSULTING

Linking Reports to your Database in Crystal Reports 2008

IMPLEMENTING SCL PROGRAMS. Using Codeblocks

Quick Start Guide - Contents. Opening Word Locating Big Lottery Fund Templates The Word 2013 Screen... 3

Installing the application involves several steps. Note that you must install QuickBooks on your computer prior to installing this application.

How to debug Wcem.dll with.net Studio

How do I apply the patch files?

Windows XP - MVX Printer Driver Installation

I N S T A L L A T I O N

Getting started with System Center Essentials 2007

INTRODUCTION ACCESS 2010

Window Server 2012 Hyper-V Virtual Machine Snapshots

Fairfield University Using Xythos for File Storage

Visual Studio.NET. Although it is possible to program.net using only the command OVERVIEW OF VISUAL STUDIO.NET

VIRTUALIZATION MANAGER ENTERPRISE EDITION GETTING STARTED GUIDE. Product: Virtual Iron Virtualization Manager Version: 4.2

Developing Applications using Universal Driver 6.0x in Windows CE 6.0

Introduction to C/C++ Programming

Portable applications are programs that are fully functional without having to install them on your PC.

Setting up a Project and Debugging with Visual Studio

Introduction. Key features and lab exercises to familiarize new users to the Visual environment

This manual will explain how to do a mail merge in Cordell Connect, using the following Windows programs:

Microsoft Visual Studio User Guide Wotuy

Reading: Managing Files in Windows 7

CRM CUSTOMER RELATIONSHIP MANAGEMENT

Installation Guide ~ Visual Studio C Express Edition

Windows Programming Using MFC and Visual C ++.Net

Creating a new form with check boxes, drop-down list boxes, and text box fill-ins. Customizing each of the three form fields.

Overview of the Microsoft.NET Framework

Code Blocks Cannot Find Compiler Executable Windows 7

Color Controller E-41A. Customer User Addendum

Problems with PSQL and Windows 10 Release 1803

Word: Print Address Labels Using Mail Merge

INFORMATICS LABORATORY WORK #2

EMS DESKTOP CLIENT Installation Guide

WRITING CONSOLE APPLICATIONS IN C

FmPro Migrator Developer Edition - Table Consolidation Procedure

Microsoft Access 2010

Transcription:

If you are a beginner on Microsoft Visual Studio 2008 then you will at first find that this powerful program is not that easy to use for a beginner this is the aim of this tutorial. I hope that it helps quite a few people out. I am assuming that you are not a complete n00b and have installed Microsoft Visual Studio. I have install the complete set of tools that Microsoft have available where as you might have just Install Microsoft Visual C++ (cpp) OR C Sharp (c#) or any tools that help with the programming language that you are aiming to use to program you applications so parts of this tutorial may not be very useful to you. There may be slight differences in the way that you re Microsoft Visual Studio looks compared to the ones in the screenshots and some of the features may be missing as I am using Microsoft Visual Studio Professional and I am also running Microsoft Windows Vista Ultimate Edition at the time of writing this tutorial. In this tutorial I will be using Microsoft Visual Studio to create a win32 application so if you are not using c++ these tutorials may become useless to you all together. Opening Microsoft Visual Studio On Microsoft Windows Vista and XP to open the visual studio do the following: Start Menu => All Programs => Microsoft Visual Studio 2008 => Microsoft Visual Studio 2008. That s all there is to it you have now successfully opened Microsoft Visual Studio and you should now see the Microsoft Visual Studio splash screen (see Figure 1.0) Figure 1.0

Let s Explore the Studio Ok so now let s have a look at the Microsoft Studio Layout the first page that you will see is the start page (see Figure 1.1) this will be the very first page that you will see every time you open Microsoft Visual Studio and also when you close all any open solutions that you may have open. This will be the case unless you have set one of your Projects to be your Default Project when opening Microsoft Visual Studio in that case the Default Project will open up automatically and the start screen will be totally bypassed until you close the open Solution. Figure 1.1

The Recent Projects (Figure 1.3) is the area of the start screen is where all the projects that you have been working on will appear in a ordered list the last project that you worked on last appears at the top of the list. To carry on working on a project simply click on the project name in the Recent Projects list and it will open the Project that you clicked for you. I find to be a very useful feature. The Recent Projects also includes options to create a new project and open any other project that isn t displayed on the list simply click the project links next to Open: and Create: Text Labels

Figure 1.3 The main area (Figure 1.4) of the start screen includes a list of articles from the MSDN (Microsoft Developer Network) website which is a very useful place to go when you need help and has references for all the programming languages that come with visual studio. Simply click on any of the links in this area and if you are connected to the internet you will be taken to the MSDN website article that you chose. Figure 1.4

The Getting Started screen (Figure 1.5) is a list of links that will help you get started using visual studio and you may find that the links in this area are very useful simply click on the titles to go to the news article or help document. Figure 1.5

The getting Visual Studio Headlines screen (Figure 1.6) is a list of links that will have news about the visual studio I.D.E updates and other interesting headlines that Microsoft Microsoft thinks may be of interest to the users of visual studio Figure 1.6 Creating a Project The first thing to do is to create a new project for our program. To create a project, follow these 6 easy to follow steps: 1. Under the File menu, Select New, and then select Project from the Sub Menu that appears (Figure 1.7). Alternatively, you can press Ctrl+Shift+N (Shortcut Key Combination). The New Project dialog box will be displayed (Figure 1.8). Figure 1.7

Figure 1.7 2. Enter a name for your Project in the Name box the Solution name will mirror the Project name so there is no need to fill it in or change it but ill leave that step up to you. 3. Select which type of Project you will be creating in the Project Types Pane on the left, and then select a template from the Templates pane on the right. 4. Choose a location for your new project in the Location box, either by typing a directory path or by clicking Browse and navigating to the appropriate directory. 5. Click the OK button and the Win32 Application Wizard will be displayed (Figure 1.8). This Project will possess a simple, Win32 interface, and will display a message box onto the screen for our test purpose. Before proceeding, though, you need to change some setting Click next on the Win32 Wizard Setting wizard will appear (Figure 1.9). Figure 1.8

Figure 1.9

6. Know comes the point where you decide what type of support you application will need ill explain a little about each option below Under Application Type: Windows Application Check this option if the application you are programming is for windows WIN32 API Console App Check this option if your application is going to be aimed at the windows console (Looks similar to dos console) Dll Select this box if you are creating a DLL (Dynamic Link Library) File Dll,s are files that you can include in your application to make it easy to manage parts of your code if you

have a large project and don t want to have to recompile you re whole application to be able to update a tiny part of your code. Dll,s end in the.dll extension Static Library Select this option if option if you want to create a static library which is similar to a dll but if you use one of these the size of your application will become huge compared to application that use Dll,s because the code from the library s are put inside of your application when you compile it. Under Add Common header File For: ATL Check this option if you are planning to user the ATL (Active Template Library) library s in your applicants so that the program you create will include the header files for the Library s. MFC was introduced in 1992 with Microsoft's C/C++ 7.0 compiler for use with 16-bit versions of Windows as an extremely thin OOP/C++ wrapper for Windows API (C). C++ was just beginning to replace C for development of commercial application software (as predominant way to interface the API). With that, they also shipped the very first replacement for (older, alphanumeric) IDE called PWB. New "App Studio" was a good set of designers available at the time, still existent today (2008). MFC Check this option if you are planning to user the MFC (Microsoft Foundation Classes) library s in your applicants so that the program you create will include the header files for the Library s. The Active Template Library (ATL) is a set of template-based C++ classes developed by Microsoft that simplify the programming of Component Object Model (COM) objects. The COM support in Visual C++ allows developers to create a variety of COM objects, OLE Automation servers, and ActiveX controls.[1] [2] Patterned after the Standard Template Library (STL), ATL includes an object wizard that sets up primary structure of the objects very quickly with a minimum of hand coding. The current most up to date version of the Microsoft Microsoft Foundation Classes is 9.0 Under additional options: Empty project Check this box if you want your project to be empty and not use the default template includes and code template that is included Export Symbols This option will only become available if the empty project is checked. You only have to use this option if you wish the compiler to export symbols from dlls when linking to them

in your application at the compiler Precompiled Header This option if you with to use a Precompiled Header to help out the compiler. In many programs, the majority of header files that are included are provided by the operating system. As a result, the compiler spends a significant proportion of its time parsing the same files for every program that is compiled on a given platform. In modern operating systems, there can be literally thousands of header files, and in some cases many or all of these are included by a single master include file such as windows.h on Windows or Cocoa/Cocoa.h on Mac OS X. In order to reduce compilation times, modern compilers often allow these header files, which rarely change, to be pre-compiled into a form that is easier for the compiler to load. This intermediate form is known as a pre-compiled header, and is commonly held on disk with the extensions.pch or.gch. 7. That s it simply click the Finish button to create the project. The wizard correctly initializes all the compiler settings for the project. If you got this far well done you now know how to open Visual Studio What the start Screen does and how to create a new project. Using the Solution Explorer Adding a Files to your Project 1. Right Click the folder you want to add a file to in the solution explorer and select Add then New item (Figure 2.0) or click the add new item button on the toolbar (see Figure 1.10) in my example I want to add a header (.h) file to my project but you may add anything you want to your project after clicking new item. 2. Select the type of file you want to add from the box that opens (Figure 2.1) there all labeled and it should not be that hard to figure out what each file is used for if you have a little programming experience of enter there names into Google or Wikipedia and do a little research after selecting the type of file you want to add enter a file name in the Name box. 3. Choose a location for your new project in the Location box, either by typing a directory path or by clicking Browse and navigating to the appropriate directory. The default location should be ok though. To finish click Ok. Figure 1.10

Figure 2.0 Figure 2.1

Editing Code: 1. To edit a file in Visual Studio simply Double-Click the file you want to edit in the solution explorer or Right-Click the file in Solution Explorer and click Open either way you will do exactly the same thing open the file for editing (Figure 2.2). Figure 2.2

2. Now edit and add the code for your program in code window (Figure 2.3) Figure 2.3 Compiling and Executing the Program Building the Executable The next thing to do is build the source into a executable file. The term build in Visual Studio I.D.E refers to compiling and linking the program. Visual Studio.NET compiles

any source files that have changed since the last build and any new resources into object files (.obj), if no compile errors were generated in the compiler, then the build process will carry on to the linker to perform a link of the generated object (.obj) files into a executable file. To build the executable, select Build Solution from the Build (Figure2.5) menu or press Ctrl+Shift+B or F7. Figure 2.5 An Output window displaying the build progress will appear near the bottom of the Visual Studio.NET window. If no errors are encountered, the message Build: 1 succeeded, 0 failed, 0 skipped should appear in the Output window (Figure 2.4). If any problems occur, the Output window will contain a list of errors and warnings, as shown in figure 2.4. Figure 2.4

Executing your program Once you ve eliminated all errors and you ve successfully built the project, you can finally execute the program. Choose Start without Debugging from the Debug menu to run the program. You can also press CTRL+F5 to execute the program or the easiest way is to use the Start Debugging button on the toolbar (Figure 2.6). Figure 2.6 Linking Library Files There are two ways I know of to link library files to your project the first way can be used in your source (.cpp file) at the top or in a header file (.h file) type the following bit of code: #pragma comment(lib, "libname") Where libanme is the name of the library The second way in which you can link lib files is to go to the project menu then Properties (see Figure 1.7) in the properties select Configuration properties => Linker => Input Then add the names of your lib files in the Additional Dependencies box like: Libname1; libname2; Libane3 (See Figure 2.8) Figure 2.7

Figure 2.8 Checking for I.D.E updates Click Help => Check for Updates (See Figure 2.9) Removing Files

Right click on the file you want to remove in the solution explorer and click the delete option or press delete key. (see Figure 2.10) Renaming Files Right click on the file you want to rename in the solution explorer and click the rename option or press F2. and retype the name of the file (see Figure 2.10) Figure 2.10 Including In your code you can create header files into cpp files the header files that you create can be included in your cpp files like this: #include "stdafx.h" And common windows header files like this #include <windows.h> Important note: stdafx.h is required by Visual C++ Win32 API apps if you don t have #include "stdafx.h" as your first header then it will not compile Figure 2.9

Tutorial Credits Author Wap2k np9844uk@yahoo.co.uk