VC++ Extensions

Preprocessor

  • #pragma once - Put at the top of every .cpp file. (Not part of the standard, but it should be. gcc now has it, too.)
  • #import - Loads a type library

Macros

  • _DEBUG
  •  __FUNCDNAME____FUNCSIG__, and __FUNCTION__

Calling Conventions

  • __cdecl - Parameters are placed onto the stack from right to left, and the caller is responsible for popping them off the stack after the function returns. __cdecl is the default.
  • __stdcall - Parameters are placed onto the stack from right to left, and the function is responsible for popping them off the stack before returning. va_args are not possible. __stdcall is the COM calling convention.

Classes

  • _com_ptr_t
  • _bstr_t
  • _variant_t
  • _com_error

Precompiled Headers

  • VS AppWizard creates by default.

Other Dialects

Microsoft also created C++/CLI for DotNET, and C++/CX & C++/WinRT for WinRT.


References