摘要: 一个本来可以运行的程序,今天debug的时候,出现了 一堆错误:类似:files\microsoft visual studio 9.0\vc\include\codeanalysis\sourceannotations.h(47) : error C2011: “vc_attributes::YesNoMaybe”: “enum”类型重定义1> d:\program files\microsoft visual studio 9.0\vc\include\codeanalysis\sourceannotations.h(47) : 参见“vc_attributes::YesNoMayb 阅读全文
posted @ 2013-11-18 19:02 Tup 阅读(419) 评论(0) 推荐(0)
摘要: //#include "stdafx.h" //不使用预编译头#include #include #include using namespace std;int _tmain(int argc, _TCHAR* argv[]){ CString str1; str1.Format(L"Who R U ? NO.%d", 999); cout<<str1<<endl;//以常规方式输出 wcout<<str1<<endl;//直接输出CString wcout<<str1.GetBuffer() 阅读全文
posted @ 2013-11-18 19:00 Tup 阅读(560) 评论(0) 推荐(0)
摘要: GetTextExtentPoint32 函数功能:计算指定的正文字符串的宽度和高度 函数原型:BOOL GetTextExtentPoint32(HDC hdc,LPCTSTR lpString,int cbString,LPSIZE lpSize); 参数: hdc: 设备环境句柄 lpString:指向正文字符串的指针,此字符串不必以\0结束,因为cbString指定了字符串的长度 cbString:要纳入计算的字符串的字符数 lpSize: 指向SIZE结构的指针,该结构中字符串的尺寸将被返回。 返回值:如果函数调用成功,返回值是非零值;调用失败,返回0 Windows NT:... 阅读全文
posted @ 2013-11-18 18:38 Tup 阅读(2069) 评论(0) 推荐(1)
摘要: 1.求字符串的长度:(string.h wchar.h) size_t __cdecl strlen(const char*); size_t __cdecl wcslen(const wchar_t*)2. 打印字符串: printf wprintf你所熟悉的含字符串参数的C运行期函数都有相对应的宽字符处理方法。 阅读全文
posted @ 2013-11-18 18:30 Tup 阅读(184) 评论(0) 推荐(0)