Questions tagged [visual-c++]

Microsoft Visual C++ is a C, C++ and C++/CLI compiler for Windows. The most recent version of the compiler is Visual C++ 2019. The compiler supports the following languages: C (supports C90 and most of C99 and C11 parts of the ISO C++ standard as of Visual Studio 2019); C++ (support for most C++11, C++14 and C++17 features and some C++20 features as of Visual Studio 2019) C++/CLI (Provide interoperability with .NET languages like C#).

Microsoft Visual C++ is a C, C++ and C++/CLI compiler for Windows. The most recent version of the compiler is Visual C++ 2019.

The compiler supports the following languages:

  • C: Supports C90 and most of C99 and C11 parts of the ISO C++ standard as of Visual Studio 2019
  • C++: Also includes support for most C++11, C++14 and C++17 features, and some of C++20 as of Visual Studio 2019
  • C++/CLI, providing .NET integration in C++
  • C++/CX for interfacing with WinRT

Visual C++ also supports debugging a native code, mixed (native+managed) code, as well as raw assembly code. Rich debugging features include debugging from start, attaching to a local or a remote process. It also allows multiple processes to be debugged at once. Breakpoints, conditional breakpoints, data breakpoints are of great help.

Resources

29606 questions
102
votes
6 answers

C++ include and import difference

What is the difference between #include and #import in C++?
Marius
  • 54,363
  • 28
  • 121
  • 143
102
votes
12 answers

Visual Studio support for new C / C++ standards?

I keep reading about C99 and C++11 and all these totally sweet things that are getting added to the language standard that might be nice to use someday. However, we currently languish in the land of writing C++ in Visual Studio. Will any of the new…
Colen
  • 12,368
  • 20
  • 72
  • 101
100
votes
10 answers

Is gettimeofday() guaranteed to be of microsecond resolution?

I am porting a game, that was originally written for the Win32 API, to Linux (well, porting the OS X port of the Win32 port to Linux). I have implemented QueryPerformanceCounter by giving the uSeconds since the process start up: BOOL…
Bernard
  • 43,502
  • 18
  • 52
  • 69
100
votes
2 answers

Is the VC++ code DOM accessible from VS addons?

Visual Studio IntelliSense for VC++ includes the "complete" EDG C++ parser (also used by Intel and others). Since the C# Code DOM is accessible to addons (correct me if I'm wrong), is the C++ Code DOM also accessible? Can this be used to analyse an…
Robin Rodricks
  • 99,791
  • 133
  • 372
  • 575
97
votes
7 answers

What is the difference between C++ and Visual C++?

What is the difference between C++ and Visual C++? I know that C++ has the portability and all, so if you know C++ how is it related to Visual C++? Is Visual C++ mostly for online apps? Would Visual Basic be better for desktop applications?
adam
94
votes
7 answers

C++11 features in Visual Studio 2012

A preview version of Visual Studio 2012 (the next version after VS2010) is now available. Does anyone know what new C++11 features it supports? (I'm not in a position to try it out at the moment).
HighCommander4
  • 44,537
  • 22
  • 112
  • 180
94
votes
4 answers

How does the Import Library work? Details?

I know this may seem quite basic to geeks. But I want to make it crystal clear. When I want to use a Win32 DLL, usually I just call the APIs like LoadLibrary() and GetProcAdderss(). But recently, I am developing with DirectX9, and I need to add…
smwikipedia
  • 52,824
  • 76
  • 267
  • 432
94
votes
2 answers

What version of Visual Studio is Python on my computer compiled with?

I am trying to find out the version of Visual Studio that is used to compile the Python on my computer It says Python 2.6.2 (r262:71605, Apr 14 2009, 22:40:02) [MSC v.1500 32 bit (Intel)] on win32 What I do not understand is this MSC V.1500…
leon
  • 4,521
  • 6
  • 35
  • 36
93
votes
4 answers

what does __declspec(dllimport) really mean?

I saw the Qt source code like this: class Q_CORE_EXPORT QBasicAtomicInt { public: ... }; Which Q_CORE_EXPORT macro defines like below: define Q_DECL_IMPORT __declspec(dllimport) So what does __declspec(dllimport) really mean?
gemfield
  • 2,852
  • 5
  • 21
  • 24
93
votes
23 answers

Get a file name from a path

What is the simplest way to get the file name that from a path? string filename = "C:\\MyDirectory\\MyFile.bat" In this example, I should get "MyFile". without extension.
nidhal
  • 1,309
  • 3
  • 13
  • 14
89
votes
7 answers

How to call C++ function from C?

I know this. Calling C function from C++: If my application was in C++ and I had to call functions from a library written in C. Then I would have used //main.cpp extern "C" void C_library_function(int x, int…
claws
  • 47,010
  • 55
  • 140
  • 185
88
votes
5 answers

module unsafe for SAFESEH image C++

I am using Microsoft Visual Studio 2011 Professional Beta I am trying to run the OpenCV C++ files (http://opencv.willowgarage.com/wiki/Welcome) that I have compiled using cMake & the Visual Studio Complier. However when I go to debug the project I…
Aaron Thompson
  • 1,680
  • 1
  • 23
  • 31
86
votes
5 answers

How is "int* ptr = int()" value initialization not illegal?

The following code (taken from here): int* ptr = int(); compiles in Visual C++ and value-initializes the pointer. How is that possible? I mean int() yields an object of type int and I can't assign an int to a pointer. How is the code above not…
sharptooth
  • 159,303
  • 82
  • 478
  • 911
85
votes
3 answers

Double cast to unsigned int on Win32 is truncating to 2,147,483,648

Compiling the following code: double getDouble() { double value = 2147483649.0; return value; } int main() { printf("INT_MAX: %u\n", INT_MAX); printf("UINT_MAX: %u\n", UINT_MAX); printf("Double value: %f\n", getDouble()); …
85
votes
5 answers

How do I set a path in Visual Studio?

How do I set a path for DLL files to be searched in Visual Studio for a particular project alone? Now I am setting it in the environment path variable, but I would like better control over this.
yesraaj
  • 42,284
  • 65
  • 185
  • 246