Comet Configuation

While Comet barely uses macros for the import work of creating a COM library, there are a number of preprocessor switches that are used to alter certain behaviours and select code. While most of these refer to the compiler being used, there are a few that are intended to be used as external switches.

  • COMET_ALLOW_DECLSPEC_PROPERTY : Wrapper headers include declspec properties, allowing interface properties to be assigned-to and read as properties.
  • COMET_ASSERT_THROWS : Comet throws comet::assert_failed when internal assertions fail in debug builds.
  • COMET_ASSERT_THROWS_ALWAYS : Comet throws comet::assert_failed when internal assertions fail in both debug and release builds.
  • COMET_LOGFILE : See Call Logging.
  • COMET_LOGFILE_DEFAULT : See Call Logging.
  • COMET_NO_MBCS : Disable comet multi-byte-character-set conversion handling.
  • COMET_NO_MBCS_WARNING : Turn off the warning indicating that sdt::string is not compatible with MBCS.
  • COMET_USE_RAW_WRAPPERS : Tells com_ptr not to use the comet wrappers but to return raw interface pointers.

There are also a number of macros that are either utitlity macros, reflect compiler differences or Comet version differences that may be convenient to use within your own code.

  • COMET_ASSERT(expression) : Run-time assert.
  • COMET_STATIC_ASSERT(static-expression) : Compile-time assert.
  • COMET_NOTUSED(info) : Specify unused argument.
  • COMET_FORCEINLINE : Use before a method to apply force-inline if available.
  • COMET_VARIANT_TRUE,COMET_VARIANT_FALSE : Use in place of VARIANT_TRUE,VARIANT_FALSE to avoid type warnings.
  • COMET_MAJOR_VER : Major comet version
  • COMET_MINOR_VER : Minor comet version
  • COMET_BUILD : Comet version to compare against (yyyymmdd of distribution)
  • COMET_STRICT_TYPENAME : Used for when stricter compilers require 'typename' keyword and VC6 has an error.
  • COMET_CONST_TYPE(vartype, varname, value) : Define a typed constant for a class/struct (or use enum if not supported)