2013年4月23日

CListCtrl ---CImageList & CHeaderCtrl

摘要: 在CListCtrl 中 包含着CHeaderCtrl 对应的控件1.在CListCtrl 中使用图片: 1 CMyDialog::OnInitDialog() 2 { 3 //CListCtrl m_list; // 定义为成员变量; 4 //CImageList m_imagelistNormal; // 定义为成员变量 5 //CImageList m_imagelistSmall; 6 //CImageList m_imagelistState; 7 8 //在这里有多种方法可以插入image 9 // 1)可以使用 CImageLi... 阅读全文

posted @ 2013-04-23 16:10 code.life 阅读(432) 评论(0) 推荐(0)

2013年2月19日

no more than

摘要: no more than adv. 只是not more than n. 至多 .(仅仅,不超过)这两个词的用法及区别,很明显是不一样的.no more than:是相当于一个“副词”(adv.)。意思是:“ 只是”例如: I am no more than a worker.我仅仅是个工人。分开用时表示no more ... than-“和......一样不(否定两者)、正如……一样不(否定两者)”。He is no more deligent than I am.他和我一样不勤奋。not more than:是相当于一个“名词”(n.)。意思是: “至多”例:The experiment 阅读全文

posted @ 2013-02-19 10:20 code.life 阅读(230) 评论(0) 推荐(0)

2013年1月8日

TerminateThread 不要使用的证据

摘要: 听过无数次不要TerminateThread,只是工作中常用,貌似也没有什么问题。今天在高强度测试中发现了一个不可原谅的错误。参看下面的例子DWORD __stdcall mythread(void* ){ while( true ) { char* p = new char[1024]; delete p; }}int _tmain(int argc, _TCHAR* argv[]){ HANDLE h = CreateThread(NULL, 0, mythread, NULL, 0, NULL); Sleep(1000); TerminateThread(h, 0); h = NULL; 阅读全文

posted @ 2013-01-08 17:40 code.life 阅读(168) 评论(0) 推荐(0)

关于Main()函数的小技巧

摘要: 话说,有这样一道笔试题:#include "stdio.h"void print(){*}void main(){}要求在*部分写代码使整个程序运行后输出“hello world”,有些人说,这还不简单啊,于是写出这样的代码:01.#include "stdio.h" 02.void print()... 阅读全文

posted @ 2013-01-08 17:37 code.life 阅读(137) 评论(0) 推荐(0)

类型转换(Type casting)

摘要: 1 //首先简单介绍下C++默默为我们生成和调用的函数 2 class Empty {}; 3 //如果你写上面的code, C++编译器会为你生成下面的code 4 class Empty{ 5 public: 6 Empty() {...} ... 阅读全文

posted @ 2013-01-08 17:11 code.life 阅读(344) 评论(0) 推荐(0)

模板实参推断(Template argument deduction)

摘要: 函数模板(Function template) 和 类模板(Class template)1.函数模板 类型实参的类型转换受限,一般而论,不会转换实参以匹配已有的实例化,相反,会产生新的实例。除了产生新的实例化之外,编译器只会执行两种转换。View Code 1 template <typename T> T fobj(T, T); //arguments are copied 2 3 template <typename T> 4 T fref(const T&, const T&); //reference arguments 5 6 string 阅读全文

posted @ 2013-01-08 11:34 code.life 阅读(222) 评论(0) 推荐(0)

2012年10月19日

0xcdcdcdcd, 0xdddddddd, 0xcccccccc

摘要: 在Visual C++ 编译器中:0xcdcdcdcd --Created but not initialised0xdddddddd--Deleted.0xfeeefeee -- Freed memeory set by NT's heap manager0xcccccccc -- Uninitialized locals in vc6 when you compile w/ /GZ0xabababab -- Memory following a block allocated by LocalAllc() 阅读全文

posted @ 2012-10-19 23:30 code.life 阅读(423) 评论(0) 推荐(0)

导航

点击右上角即可分享
微信分享提示