Uses of VC++

What does it mean on the download/install page where it says:

"You can use Visual C++ Express to build powerful .NET Framework applications immediately after installation. In order to use Visual C++ Express to build Win32 applications, you'll need to take just a few more steps."

And is there a button to compile and run your C source code without messing around in a cmd window



Answer this question

Uses of VC++

  • petevick

    VS detect that something changed in project and want to rebuild it, sometimes it's annoying, but acceptable in general. You can check box that VS will automatically rebuild without questions.

    stdafx.h is included to minimize build time, compiler keep intermediate compilation data of this file (it includes most system headers), so your project files always include stdafx.h and this file include all system and library headers, so you don't need to worry that you forget include something in your sources.

    _tmain is different than main, but not too much. Windows use Unicode and ANSI encodings. If UNICODE & _UNICODE symbols declared, then your program will compile as Unicode (char = 16 bit), otherwise it will compile as old DOS/Win95 ANSI program (char = 8 bit). _tmain is a macro that will hide differencies of Unicode or ANSI from you (it expands to wmain or main - Unicode or ANSI version of main).



  • ThRaShErUk

    Visual Studio decompile code from other libraries and show there code definition. You can always put cursor on function of interest and press F12 to browse it. If this is your function - you will see it's body, if this is library function - you will see definition and class that define it.

    You can also find useful Object Browser (Ctrl+Alt+J).



  • dedebong

    Well Im really sorry if Im being slow here, but what type of project should I create just put my c source code into, and to compile and run


  • Ivo6070

    ok, atm, Im just writting programs to run in the command window, so I wont bother with that sdk thing. but when I double click my source code file (it's written in c, i hope thats ok) and it opens in VC++, but the run button is blanked out and F5 does nothing...

    how do i compile and run it;
    a)within VC++
    b)from the cmd window, using VC++'s compiler

    Thanks


  • R1ZWAN

    Basically without any modifications VCEE can only build .net framework applications and console applications. You need to acquire the platform sdk to compile native windows applications.

    If you want to get the VCEE for the .net framework or console application writing, then you can use it as it is without installing anything else. But if you want to write applications with windows or other things in the windows subsystem then you need to get the platform sdk too.



  • collide

    You must create new project (File\New), add your file in it (Project\Add existing item) and then it will be able to compile and run.

  • herowukong

    Thanks for the help, but whenever I run any program (even a fresh win32 console template), I get "This project is out of date" and "Would you like to build it ".

    What does this mean and how do I fix it

    Also, why does a fresh win32 console template have stdafx.h included as a header And why is the main function called "_tmain", rather than just "main"

    Thank you!


  • gabrielocio

    You used standard library headers, almost all C++ compilers have them. You don't need to worry.

  • Igor Afanasev

    Hi!

    It's advertisement :)

    Visual Studio have "Run and Debug" button by default on toolbar (F5) and Ctrl+F5 used to "Run without Debug". It will compile source if necessary.



  • Anton Bagayev

    If this is console project (a.k.a. DOS, command line), then create Win32 Console Application.

    If it use Win32 GUI, then you can create Win32 Project.



  • Shankar Joseph

    Thanks; thats brilliant.

    What is the code definition window at the bottom of the screen Can I use it to find out about functions syntax


  • engloon

    You said that stdafx.h includes all headers. Does that mean that I don't need to include stdio.h or iostream.h as long as I have included stdafx.h

    Also, should I always just use _tmain instead of main Does it just mean my program will be more versitile I dont have to do anything else differently I can just treat it exactly the same as main


  • Steven in Montreal

    ok, great!

    Will the header files be different for each compiler you use At the moment, I have been programming using Borland, and so start my source code files with something like this:

    #include <stdio.h>
    #include <string.h>
    #include <math.h>
    #include <stdlib.h>

    Will that pose a problem if Im now using VC++ If so, what are the basic header files to include for this


  • desny

    You can check stdafx.h, if it include stdio.h & iostream.h - don't need to include them again. If they are not there - add them there and include stdafx.h in your sources. This will be better for compilation speed.

    If you want to make programs that can be run in Unicode natively, then you need to use TCHAR instead of CHAR and tmain instead of main. It's preffered way of writing apps - they can be compiled to old systems and to the new Unicode-based systems. The only thing to keep in mind - TCHAR can be 1 or 2 bytes, depend on #define UNICODE symbol. So you never think of string "ABC" as of 3 bytes + 4th null byte, you must think of it as of 3 chars + 4th null char and char can be 1 or 2 bytes.

    Why you still progam in C It was supressed by C++ a long time ago. And now there is much more modern language than C++ called C#. If you new to Windows programming, I suggest you to go into C# from the start.



  • Uses of VC++