it 加油站

2008年3月18日

c/c++ 宏的妙用

摘要: 大家在进行C/C++编程的时候,常常定义一些枚举类型的数据,例如: typedef enum TOKENID { TID_ARGS, TID_MAKEREFANY } TOKENID; 然后在展示或者处理的过程中又要使用和此枚举相关的一些信息。如: const TOKINFO m_rgTokenInfo[TID_NUMTOKENS] = { {L"__arglist" ,TFF_MSKEYWORD | TFF_TERM...}, {L"__makeref" , TFF_MSKEYWORD | TFF_TERM...} }; 一种机制 就是使用字典来解决,这样就需要手工保证两边加入的一致性。另一种更好的 解决方案是使用Macro来解决: 1、宏使用的定义 2、枚举定义 3、信息相关定义。 阅读全文

posted @ 2008-03-18 10:59 antilope 阅读(543) 评论(0) 推荐(1) 编辑
版权声明 Copyright Declaration

摘要: 本分类中用到的代码有些是sscli20_20060311.tgz中的源代码,在引用过程中请注意版权! // ==++== // // // Copyright (c) 2006 Microsoft Corporation. All rights reserved. // // The use and distribution terms for this software... 阅读全文

posted @ 2008-03-18 10:37 antilope 阅读(295) 评论(0) 推荐(0) 编辑

2008年3月17日

一款功能强大的轻量级代码编辑器SciTE

摘要: SciTE对编程语言的支持很好,是专为程序员订做的的编辑器。大小总共几百K,代码的显示非常美观,支持代码折叠、自动完成。还能根据编译输出结果跳到出错行,还有很多程序员需要的功能。通过配置文件进行配置非常灵活。 更重要的一点它是一款免费软件。 http://scintilla.sourceforge.net/ 阅读全文

posted @ 2008-03-17 13:59 antilope 阅读(299) 评论(0) 推荐(0) 编辑

2008年2月27日

Rva2Offset

摘要: /// /// The PE format frequently uses the term RVA (Relative Virtual Address). An RVA is the address of an item /// once loaded into memory, with the base address of the image file subtracted from it (i.e., the offset from the /// base address where the file is loaded). The RVA of an item will almost always differ from its position within /// the file on disk. To compute the file position of an item with RVA r, search all the sections i 阅读全文

posted @ 2008-02-27 12:56 antilope 阅读(359) 评论(0) 推荐(0) 编辑