zoukankan      html  css  js  c++  java
  • Preprocessor Directives

    Preprocessor directives can appear anywhere in a source file, but they apply only to the remainder of the source file.

    #error:Error directives produce compiler-time error messages.
    #if !defined(__cplusplus)
    #error C++ compiler required.
    #endif

    #import
    Used to incorporate information from a type library. The content of the type library is converted into C++ classes, mostly describing the COM interfaces.     
    Header Files Created by Import
    #import creates two header files that reconstruct the type library contents in C++ source code. The primary header file is similar to that produced by the Microsoft Interface Definition Language (MIDL) compiler, but with additional compiler-generated code and data. The primary header file has the same base name as the type library, plus a .TLH extension. The secondary header file has the same base name as the type library, with a .TLI extension. It contains the implementations for compiler-generated member functions, and is included (#include) in the primary header file.
    If importing a dispinterface property that uses byref parameters, #import will not generate __declspec(property) statement for the function.
    Both header files are placed in the output directory specified by the /Fo (name object file) option. They are then read and compiled by the compiler as if the primary header file was named by a #include directive.

    The following compiler optimizations come with the #import directive:
        * The header file, when created, is given the same timestamp as the type library.
        * When #import is processed, the compiler first checks if the header exists and is up to date. If yes, then it does not need to be re-created.
    The #import directive also participates in minimal rebuild and can be placed in a precompiled header file. See Creating Precompiled Header Files for more information.

    #undef:Removes (undefines) a name previously created with #define.

    #elif

    #if DLEVEL == 0
        #define STACK 0
    #elif DLEVEL == 1
        #define STACK 100
    #elif DLEVEL > 5
        display( debugptr );
    #else
        #define STACK 200
    #endif

    #include :The #include directive tells the preprocessor to treat the contents of a specified file as if those contents had appeared in the source program at the point where the directive appears.
  • 相关阅读:
    聊聊Senior .net 面试,作为面试官你称职吗
    使用Microsoft BizTalk Adapter for mySAP Business Suite需要注意的一些限制点
    eos账号管理
    如何安装以太坊钱包Parity
    Infoq主办 Baidu Web 开发者大会记录
    http请求的详细过程转载
    php 下载保存文件保存到本地
    php section
    用javascript拼接html代码标签
    php使用sql数据库 取得字段问题
  • 原文地址:https://www.cnblogs.com/taoxu0903/p/1401791.html
Copyright © 2011-2022 走看看