共 8 篇文章 |
|
取CString子串。CString str("12345");CString test;test = str.Left(2);//左边两个AfxMessageBox(test);//12test = str.Right(2);//右边两个AfxMessageBox(test);//45test = str.Mid(2, 3);//索引为2开始的三个AfxMessageBox(test);//345. 阅1107 转0 评0 公众公开 14-04-24 17:14 |
以空格分割字符串取得子串#include void substring(CString str,CArray& strArray){ while(str.Find(_T(" "))+1){CString str1 = str.Left(str.Find(_T(" ")));strArray.Add(str1);str.Delete(0,str1.GetLength()+1);}strArray.Add(str);} 阅268 转0 评0 公众公开 14-03-14 18:36 |
阅913 转12 评0 公众公开 13-11-09 14:48 |
Format的使用CString s,s1;std::string s2; 参数为CStrings.Format("%s",s1)参数为strings.Format("%s",s2.c_str());也可用于把其他类型向CString的转化。 阅94 转0 评0 公众公开 13-11-07 16:43 |
阅194 转0 评0 公众公开 13-11-05 15:28 |
对于某些控件来说,pNMHDR则会解释成其它内容更丰富的结构对象的指针,如:对于列表控件来说,pNMHDR常常指向一个NMCUSTOMDRAW对象,NMCUSTOMDRAW结构如下:typedef struct tagNMCUSTOMDRAWINFO { NMHDR hdr; DWORD dwDrawStage; HDC hdc; RECT rc; DWORD dwItemSpec; UINT uItemState; ... 阅824 转3 评0 公众公开 13-11-05 07:37 |
NM_CUSTOMDRAW消息解释NM_CUSTOMDRAW消息解释 common control 4.7版本介绍了一个新的特性叫做Custom Draw,这个名字显得模糊不清,让人有点摸不着头脑,而且MSDN里也只给出了一些如风的解释和例子,没有谁告诉你你想知道的,和究竟这个特性有什么好处。NM_CUSTOMDRAW Messages提供给你的信息:一个更小的简单例子: 下面的例子将演示怎么去... 阅34 转自almathm 公众公开 13-11-04 21:55 |