How To

How to Write a C Program Using Visual Studio 6.0

Contributor
By Churyl T. Jones
eHow Contributing Writer
(0 Ratings)

Visual C++ 6.0 (VC6) is a GUI application frontend to Microsoft's C/C++ development environment. Programmers use VC6 to create and manage C/C++ development projects for executables, DLLs and other software components. VC6 allows you to edit, compile and incrementally link source code written in C or C++.
Because C is effectively a subset of C++, Visual C++ manages C programs as C++ projects. Therefore, writing a C program for use in VC6 mainly involves the programmer excluding C++-specific language features from his code, yet still using the C++ project options in the GUI.

Difficulty: Challenging
Instructions
  1. Step 1

    Start Visual C++, and choose File---->New--->Project

  2. Step 2

    Decide what type of project you want to create. The New Project option dialog is now presented, and there are several options to consider here. In general, you are deciding the type of deliverable that will be produced. This is something for you to decide, because you are the creative master of your project. See the Tips section for examples of what must be determined.

  3. Step 3

    Go to the bottom half of the dialog, and fill in the project name, its location on your hard disk and a solution name, which will be the file name for your project on the hard disk. Click "OK" to finalize your choices.

  4. Step 4

    Browse through the project settings using Next/Previous in the confirmation wizard that appears, and verify they are what you desire. If anything is not correct, make the proper adjustments in the wizard.

  5. Step 5

    Write your C Program in the edit window.

  6. Step 6

    Press F7 when you are finished writing your program so the computer can compile it.

Tips & Warnings
  • Tips for deciding your project type: Questions to answer: Output type - Executable, Static/Dynamic Library, or other type object? Windows Application Type - Assuming the result will run on the PC: Is it a full screen application using Direct X Graphics? A GUI that runs on the Windows Desktop? Or perhaps command-line application or background task that doesn't require the services Windows GDI messaging at all. Once you have figured out these questions, you can more easily navigate through the myriad choices you are confronted with now. The advantages of making these choices upfront is that they provide a predictable and error-free configuration shortcut for certain "boilerplate" options that fit your development goal. For instance, if you are writing an MFC application, then you will always need to include certain default MFC header files and link with specific MFC libraries to build an application without error. Visual Studio knows exactly which files these are, so it makes sense to allow it to fast-track your project by filling in these files as part of the project configuration. You can then add onto it later, secure that the minimum needed for a successful build is already there In the upper left of the dialog is a pane that lists project types. MFC stands for Microsoft Foundation Classes. It is a C++ class library, thus you cannot use it with plain C. Projects built with MFC are GUIs that utilize a massive and intricate series of classes meant to abstract and simplify the mundane, but necessary details of managing a Windows GUI application. It is essentially a high-level wrapper for Win32 services. Win32 is a massive umbrella that encompasses many types of projects. Win32 is the core API used to invoke and request services from Windows operating systems. Choose Win32 if your project is to run a PC and you want the freedom to write your code without having to conform the conventions of the MFC. General - If you are an advanced user, then you may wish to define exactly the parameters and components required for your project. Your project may be specialized or complicated enough such that it does not fit neatly into any of the categories discussed previously. This is the option for those who want total configuration control.

Post a Comment

Post a Comment
  • Have you done this? Click here to let us know.
I Did This

Related Ads

Computers
Alexia Petrakos,

Meet Alexia Petrakos eHow's Computers Expert.

Get Free Computers Newsletters

Copyright © 1999-2009 eHow, Inc. Use of this web site constitutes acceptance of the eHow Terms of Use and Privacy Policy.   en-US

eHow Computers
eHow_eHow Technology and Electronics