vs中有趣的 windows message compiler

三 25th, 2010

vs自带了一个mc.exe的程序,这个东西鲜有人知,它就是windows的message compiler程序。

mc编译mc代码,把它转变了一个bin格式的文件,放到资源中加载。在使用 windows event log , formatmessage的时候,就用得上这个消息了。formatmessage 有一个类似于 printf的形式的格式化能力。不过是用%1,%2这样的字眼,而不是%s,%d。这种%1,%2的形式理适合国际化。

codeproject上有一篇关于message compiler的文章:  http://www.codeproject.com/KB/system/mctutorial.aspx

windows kernel有不少地方使用mc格式的文本。比如windows 在安装的时候,提示欢迎,格式化等的文字都来源于安装盘smss.exe的message resource里。

生成的 .bin 文件格式;

binfile =  dword x + idgroups[x] + message[]

idgroup = dword startid + dword endid  + dword offset_to_message

message = dword sizeof(message) + char text[]

标签:
  1. SMS Gratis Indonesia
    三 2nd, 201106:19

    This is the perfect blog for anyone who wants to know about this topic. You know so much its almost hard to argue with you (not that I really would want…HaHa). You definitely put a new spin on a subject thats been written about for years. Great stuff, just great!. . .dont forget to visit my site SMS Gratis Semua OPerator , I will Visit Your Web Daily, it is great site i found in internet, Thx

  2. zyczenia urodzinowe
    三 2nd, 201120:08

    Not agree on several issues but the whole thing, so impressive. I just added this to my RSS feed!

  3. E-bike
    十一 15th, 201106:44
    #3
*