Skip to main content

Posts

Showing posts from May, 2011

Adding Classes

To add a class to your project, you have various options. You can separately create a header file then create a source file. You can also import an existing header file and a source file from any valid path. Microsoft Visual C++ makes it easy to create a C++ class. When doing this, a header and a source files are prepared. A (default) constructor and a destructor are added. You can delete or completely change the supplied constructor and/or the destructor. Also, Microsoft Visual C++ includes the name of the header file in the source file so you would not have forgotten to do this. Most classes in Microsoft Visual C++ have their names starting with the letter C. Although this is only a suggestion, and any valid class name would work fine, to keep some harmony, in our lessons, we will follow this convention. To create a new class and add it to your project: On the main menu, click Insert -> Add Class... In the Class View, right-click the name of the project, position the mouse on Add...

Adding Existing Files to a Project

If a file had already been created and exists on a separate folder, drive, directory or project, you can import it and add it to your application. When you decide to add an existing file to a project, because Microsoft Visual Studio allows you a great level of flexibility on the types of files you can add, it is your responsibility to check that the file is valid. If you copy a file from somewhere and paste it in the folder that contains your project, the file is still not considered as part of the project. You must explicitly add it. Before adding an existing file to your project: On the main menu, you can click File -> Add Existing Itemテδ「テ「窶堋ャテつヲ On the main menu, you can also click Project -> Add Existing Itemテδ「テ「窶堋ャテつヲ In the Solution Explorer, you can right-click the name of the project, position your mouse on Add and click Add Existing Itemテδ「テ「窶堋ャテつヲ Any of these actions would open the Add Existing Item dialog box. This requires you to locate the item and select it. O...

Creating a File

Although the most popular files used in Microsoft Visual C++ are header and source files, this IDE allows you to create various other types of files that are not natively C++ types. To create a file, if a project is currently opened: On the main menu, click Project -> Add New Item... This would open the New dialog box from where you can select the desired type of file and click Open. By default, the new file would open in the Source Code Editor. If you want to open the file otherwise, after selecting it in the New dialog box, click the arrow of the Open As combo box. In the Solution Explorer or the Class View, right- click the name of the project, position the mouse of Add, and click the option you want

Introduction to Microsoft Visual C++/MFC

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 2010. Although Microsoft Visual Studio 2010 Professional 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 -> Microsoft Visual Studio 2010 -> Microsoft Visual Studio 2010. 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 To start Microsoft Visual C++ or Visual Studio, on the Taskbar, click Start (All) Prog...

Links

Official resources MSDN Visual C++ Home microsoft.public.vc.language The Top CodeGuru CodeProject DeveloperFusion.com C/C++ Users Journal RSDN (RU) First Steps (RU) Sources.ru (RU) Tricks, Tips, FAQs Bjarne Stroustrup's C++ Style and Technique FAQ CodeGuru FAQ C++ FAQ Lite by Marshall Cline CodeProject Forum FAQ Boob Moore's page (Win32, NT, MFC) Edelmiro Fuentes's page http://www.sources.ru/cpp/cpp_vcpp_faq.shtml (RU) Akzhan Site (RU) Forums, newsgroups CodeGuru Forum microsoft.public.vc.language comp.lang.c++ RSDN Forum (RU) Libraries, Components, Add-ons, Add-ins Boost Libraries #1 for C++! TinyXML - light yet powerful XML library. Forget about MSXML! :) Whole Tomato Software: Code syntax highlighting Compuware corporation: BoundsChecker, SoftICE etc. Xtreme ToolkitPro - Industry leading Visual C++ MFC UI controls. STL Error Decryptor UCanCode: XD++ MFC Class Library for Diagrams Regular Expression Library Disk File Sy...