札记
来源:互联网 发布:淘宝开店新规 编辑:程序博客网 时间:2024/05/02 03:04
1. string a,b,c;
a=a+b; //error!
a+=b; //OK!
2011-11-03
话题1. 下面这段节选与《Win32多线程程序设计》
Critical section并不是核心对象,因此没有所谓的handle这样的东西,它和核心对象不同,它存在于进程的内存空间中,不需要像Create这样的API函数获得一个 critical section handle, 你应该做的是一个类型为CRITICAL_SECTION的局部变量初始化,方法是调用InitializeCriticalSection():
由上面三个关键字看出来了一个结论:handle是一个核心对象,并且要用create之类的API才能生成。
由于对handle的好奇,我搜索出以下内容:
HANDLE
s are intentionally opaque representations that provide encapsulation and abstraction from internal Win32 resources. This way, the Win32 APIs could potentially change the underlying type behind a HANDLE, without it impacting user code in any way (at least that's the idea).
The handles in these example are really just a new, presumably friendlier, name for void *
, which is exactly what a HANDLE
is in the Win32 API (look it up at MSDN). It provides an opaque wall between the user code and the Win32 library's internal representations that increasesportability, between versions of Windows, of code that uses the Win32 API.
由此我想到了strategy,它把不同的算法用统一的接口封装。
- 札记
- 札记
- 札记
- 札记
- 札记
- 札记
- 札记
- 札记
- 札记
- 札记
- 南方札记
- 饭桶札记
- 小札记
- 日常札记
- 五一札记
- 五一札记
- NHibernate 札记
- 软件工程札记
- 企业成本管理的五大误区
- C#打印(PrintDocument、PrintDialog、PageSetupDialog、PrintPreviewDialog)
- 一致性哈希算法及其在分布式系统中的应用
- DOM进阶
- java.lang.NoSuchMethodError问题处理(同一类型的jar包有不同版本存在)
- 札记
- android与PC,C#与Java 利用protobuf 进行无障碍通讯【Socket】
- 用Windows Server 2003配置VPN
- VB中Set的用法
- 路由掩码最长匹配原则
- 带all、cube和rollup的Group By查询
- 【java】解码解码
- 第四回 在NB中创建JavaFX2.0应用
- 设计模式学习之体会