随笔分类 -  C++

VC隐藏控件
摘要:GetDlgItem(IDC_BUTTON1)->ShowWindow(SW_HIDE);GetDlgItem:通过ID得到窗口的句柄GetDlgItem functionApplies to:desktop apps onlyRetrieves a handle to a control in the specified dialog box.SyntaxC++HWND WINAPI GetDlgItem( _In_opt_HWND hDlg, _In_int nIDDlgItem);ParametershDlg[in, optional]Type:HWNDA handle to th 阅读全文
posted @ 2012-10-26 08:54 Jiang, X. 阅读(1178) 评论(0) 推荐(0)
C++命名规范
摘要:1.1 类型名首字母大写,末尾加_T。如: class TnppCoverageArea_T{…};1.2 1.2 变量和函数名 变量和函数名中首字母小写,其后每个英文单词的第一个字母大写,其他小写。 如: int flexPageCount;1.3 全大写函数名有一类函数,它们调用普通函数,只是对普通函数的错误返回做一般化处理。这些函数的名字要和所包含的函数名相同,只是全用大写字母。1.4 宏、常量和模板名全部大写。如: #define PIE 3.14 const int LENGTH = 1024; template<class TYPE_T>1.5 指针标识符名以p或者Pt 阅读全文
posted @ 2012-10-15 08:41 Jiang, X. 阅读(4927) 评论(0) 推荐(0)
How to use VS to manipulate Excel--使用MFC读写Excel
摘要:1. Build project with MFC Dialogue;2. Open (ctrl + alt + x) class wizard:3. Add class - From a type library4. Choose From File:5. Find the Road of excel.exe5. Add some classes to the project:6. Press F7 to test whether the code works;7. Delete or comment the code in each of the added in files.1 #imp 阅读全文
posted @ 2012-09-14 13:40 Jiang, X. 阅读(602) 评论(0) 推荐(0)
g++宏扩展
摘要:刚和朋友探讨了编译过程的宏扩展,联想到以前自己在fedora上用g++的-E指令试过,现在在windows上再来一遍。cpp文件:a.cpp#include <stdio.h>int main(){printf("a");return 0;}通过cmd进入g++所在目录并执行指令: g++ a.cpp -E发现程序之间将扩展后的内容打印了出来,于是将其写入文件: g++ a.cpp -E a.out得到a.out文件如下:# 1 "a.cpp"# 1 "<built-in>"# 1 "<comm 阅读全文
posted @ 2012-09-04 23:43 Jiang, X. 阅读(1269) 评论(0) 推荐(0)