2011/6/29

来源:互联网 发布:peak软件安卓版中文版 编辑:程序博客网 时间:2024/05/06 19:13
  1. 今天遇到的问题是定义了成员变量却发现函数是全局的
  2. CString->const char *

 const int num = filename.GetLength();
 char tmp[ MAX_SIZE ];
 memset( tmp, 0, MAX_SIZE );
 strncpy( tmp, LPCTSTR(filename), num );

  1. 命名规范:数据类型缩写+首字母大写的变量名
  2. 对于tinyxml的使用总结:
  • 定义XML文档类: TiXmlDocument *myDocument = new TiXmlDocument( XmlFileName );
  • 加载XML文档中的数据:myDocument->LoadFile();
  • 获取根节点:Root = myDocument->RootElement();
  • 获取第一个孩子节点:Data = Record->FirstChildElement();
  • 获取下一个兄弟节点:Data = Data->NextSiblingElement();
  • 获取节点中的文本内容:csCapacity = Child->GetText();
  • 获取属性为ServiceId的值:Data->Attribute( "ServiceId" );
  • 获取节点的第一个属性:Data->FirstAttribute();
  • 获取节点名:Data->Value();