• 【学习笔记】MC.exe 生成H和RC文件


    在编译DEVCON.exe时提示找不到msg.h,发现存在msg.mc文件,可以使用MC.exe 进行编译出h头文件和rc资源文件,在此记录下,自己学习也是方便其他人。

    1. MC.exe

    usage:
    MC [-?aAbcdnouUv] [-m ] [-h ] [-e ] [-r ] [-x ]
    [-w ] [-W ] [-z ]
    [-km | -um | -cs ] [-mof] [-p ] [-P ]
    [<filename.man>] [<filename.mc>]

       -?               - displays this message
       -a               - input file is ANSI (default).
       -A               - messages in .BIN file should be ANSI.
       -b               - .BIN filename should have .mc filename included for uniqueness.
       -c               - sets the Customer bit in all of the message Ids.
       -d               - FACILTY and SEVERITY values in header file in decimal.
                          Sets message values in header to decimal initially.
       -e <extension>   - Specify the extension for the header file (1-3 chars)
       -h <path>        - gives the path of where to create the C include file
                          Default is .
       -m <length>      - generate a warning if the size of any message exceeds
                          <length> characters.
       -n               - terminates all strings with null's in the message tables.
       -o               - generate OLE2 header file (use HRESULT definition instead of
                          status code definition)
       -r <path>        - gives the path of where to create the RC include file
                          and the binary message resource files it includes.
                          Default is .
    
       -s <path>        - generate binary resource per provider
                          generate summary global resource MCGenResource.BIN
    
       -t <path>        - validate against baseline resource
    
       -u               - input file is Unicode.
       -U               - messages in .BIN file should be Unicode (default).
       -v               - gives verbose output.
       -W <file>        - specifies path to winmeta.xml file.
       -w <file>        - specifies path to eventman.xsd file.
       -x <path>        - gives the path of where to create the .dbg C include
                          file that maps message Ids to their symbolic name.
                          This option can only be used with message text file.
       -z <basename>    - gives the base name of the generated files.
                          Default is basename of input file.
       <filename.man>   - gives the name of manifest file to compile
       <filename.mc>    - gives the name of a message file to compile
    
       Code Generation Options
       -----------------------
       -km              - generate Kernel Mode logging macros
       -um              - generate User Mode logging macros
       -cs <namespace>  - generate C# (managed) logging class
                          based on FX3.5 Eventing class
       -css <namespace> - generate static C# (managed) logging class
                          based on FX3.5 Eventing class
    
       -co              - add callout macro to invoke user code at loggin.
                          not availalbe for c#, and ignored.
       -mof             - generate downlevel support for all function/macros generated.
                          MOF file will be generated from the manifest.
                          MOF file will be placed in the location specified by
                          the "-h" switch.
       -p <prefix>      - defines the macro name prefix applied to
                          each generated logging macro.
                          Default is "EventWrite"
       -P <prefix>      - defines the text at the start of each event
                          symbol name to remove before forming the macro names.
                          Default is NULL.
    
       Note: Switches 'w' and 'W' are not required and will be removed in future.
       Note: At most one .mc and/or one .man file can be processed in one invocation.
       Note: Generated files have the Archive bit cleared.
    

    2.使用

    上面的命令提示已经很明确了,生成命令就是下面的代码了

    C:Program Files (x86)Microsoft SDKsWindowsv7.1ABin>MC.Exe -r C:UsersjohnDownloadsDevice_Console__DevCon__Tool -h C:UsersjohnDownloadsDevice_Console__DevCon__Tool C:UsersjohnDownloadsDevice_Console__DevCon__Toolmsg.mc
    MC: Compiling C:UsersjohnDownloadsDevice_Console__DevCon__Toolmsg.mc
    

    image
    image

    作者:Dozeoo
    本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。
  • 相关阅读:
    .NET循环遍历文件夹下所有文件.改所有文件的文件名后缀名
    PB传参数,传一个或多个参数,PB截取字符串
    .NET微信公众号选择模板给粉丝推送消息
    与 @上官苏 同学 的 学习对话
    《【寻求】跑车或飞机启动的波形》 回复
    《民科的对立面,不是官科,而是科学教信徒》 回复
    《【推荐】史上最美科普诗歌:量子泪》 回复
    反民科吧 是 我们 新的 大本营
    转自 反民科吧 《【原创】相对论之误》
    《【永久】东方学帝论文存贮站》 回复
  • 原文地址:https://www.cnblogs.com/nightnine/p/14612793.html
Copyright © 2020-2023  润新知