
C++
文章平均质量分 62
PunCha
这个作者很懒,什么都没留下…
展开
-
Compiler Warning C4150: deletion of pointer to incomplete type 'XXX'; no destructor called
Look at the following codes:// C4150.cpp// compile with: /W2class IncClass;void NoDestruct( IncClass* pIncClass ){ delete pIncClass;} // C4150, define class to resolveReason: The compil原创 2008-06-03 15:24:00 · 1081 阅读 · 0 评论 -
微软新一代输入法框架 TSF - Text Service Framework 小小的研究
虽说是转载的,但是其中,有很多我自己的评论,我会用红色的字标出来,参考的博文有:TSF架构:http://blog.youkuaiyun.com/mspinyin/article/details/6137709TSF代码实例:http://www.dotblogs.com.tw/code6421/archive/2010/09/27/17909.aspxTSF的一个C# Wrapp转载 2013-10-28 15:28:22 · 21878 阅读 · 4 评论 -
VC++在Win7和Win8系统下获得百度输入法的名字
主要是在Win8下面,输入法走的都是TFS框架,Imm开头的函数部分不能用了!TBD....bool CAcDwgView::isCurrentImeBaiduPinyinIme() const{ // Get OS version bool isWindows8OrGreater = false; OSVERSIONINFOEX osvi;原创 2013-10-24 18:17:58 · 7775 阅读 · 3 评论 -
MFC中获取App,MainFrame,Doc和View类等指针的方法
From: http://hi.baidu.com/wxnxs/item/156a68f5b3b4ed18e3e3bd03MFC中获取App,MainFrame,Doc和View类等指针的方法1 获取应用程序类(App)指针在任何类中都可用MFC全局函数AfxGetApp()获得2 获取框架类(MainFrame)指针1)在App中获得Ma转载 2013-12-18 14:54:55 · 2879 阅读 · 0 评论 -
WinDbg之Page Heap实践
#include "stdafx.h"#include int _tmain(int argc, _TCHAR* argv[]){ char* pszBuffer1 = new char[0xe]; memset(pszBuffer1, 1, 0xe); char* pszBuffer2 = new char[0xF]; memset(pszBuffer2, 2, 0xF);原创 2013-10-16 02:40:36 · 3203 阅读 · 1 评论 -
浅谈C/C++堆栈指引
From: http://blog.youkuaiyun.com/mynote/article/details/5835615C/C++堆栈指引Binhua Liu前言 我们经常会讨论这样的问题:什么时候数据存储在飞鸽传书堆栈(Stack)中,什么时候数据存储在堆(Heap)中。我们知道,局部变量是存储在堆栈中的;debug时,查看堆栈可以知道函数的调用顺序;函数调用时传递参转载 2013-09-24 01:43:42 · 1146 阅读 · 0 评论 -
并发学习之:对条件变量(condition variable)的讨论
From: http://blog.youkuaiyun.com/fengge8ylf/article/details/6896380 作者:王东 1.1 什么是条件变量和条件等待?简单的说:条件变量(condition variable)是利用线程间共享的全局变量进行同步的一种机制,主要包括两个动作:一个线程等待某个条件为真,而将自己挂起;另一个线程使转载 2013-01-11 02:23:41 · 2979 阅读 · 0 评论 -
并发学习之:多线程编程中条件变量和虚假唤醒的讨论
From: http://siwind.iteye.com/blog/1469216From:http://en.wikipedia.org/wiki/Spurious_wakeupAccording to David R. Butenhof's Programming with POSIX Threads ISBN 0-201-63392-2:"S转载 2013-01-11 15:21:10 · 3115 阅读 · 0 评论 -
并发学习之:Keyed Events(没看懂,要调试下才能明白,伤心!)
From: http://locklessinc.com/articles/keyed_events/Keyed EventsThe primitives used for synchronization between threads in a Linux process are based on the Futex multiplexing syscall. This转载 2013-01-10 00:26:18 · 2333 阅读 · 0 评论 -
并发学习之:不使用内核对象同步的并发队列
From: http://msdn.microsoft.com/zh-cn/library/windows/desktop/ms686962(v=vs.85).aspxFrom: http://blog.chinaunix.net/uid-192452-id-3345030.htmlThe following example uses the InitializeSListHead转载 2013-01-09 23:55:08 · 1102 阅读 · 2 评论 -
并发学习之:等待定时器(Waitable Timer)
From:http://blog.youkuaiyun.com/zhangjinqing1234/article/details/7195826通过异步程序调用(APC)实现的定时功能编译:张海粟 定时器是一个在特定时间或者规则间隔被激发的内核对象。结合定时器的异步程序调用可以允许回调函数在任何定时器被激发的时候执行。本文的例子代码显示了如何实现。 使用本定时器时,你需要把常量转载 2013-01-08 00:50:45 · 1597 阅读 · 0 评论 -
并发学习之:APC (异步过程调用)
一个简单的APC例子,对应于Windows 并发编程指南p124。#include "stdafx.h"#include #include VOID NTAPI ApcFunc(ULONG_PTR pValue){ printf("Hello, this is APC and the parameter value is %d\n", *((DWORD*)pValue原创 2013-01-07 01:01:30 · 839 阅读 · 0 评论 -
获取系统的DPI设置
在Measure控件的宽度的时候,有时候需要考虑DPI的缩放,一个简单的函数调用就可以解决:GetDeviceCaps()会返回当前的DPI值,一般是96,Win7下面设置为125%,就变成了120。// Use "A" to measure the hint list width. "M" is too long and displayText// can be too sho原创 2012-11-29 14:41:13 · 6491 阅读 · 0 评论 -
32/64位操作系统,数据类型字节数对比
http://blog.youkuaiyun.com/hfutlsy/article/details/6916418常用数据类型对应字节数 可用如sizeof(char),sizeof(char*)等得出 32位编译器: char :1个字节 char*(即指针变量): 4个字节(32位的寻址空间是2^32, 即32个bit,也就是4个字节。同理64位编译器)转载 2012-04-16 15:39:25 · 2560 阅读 · 0 评论 -
文件操作的 Win32 API
需要头文件:shlwapi.h其中有一些函数功能存在重复,我在认为比较常用的的函数上加红。BOOL PathFileExists(LPCTSTR lpszPath)功能:检查文件/路径是否存在LPTSTR PathFindFileName(LPCTSTR pPath)功能:获得路径中的文件名例如: PathFileFileName( “c:\\Pro转载 2012-04-01 10:56:11 · 1259 阅读 · 0 评论 -
What happend: Exception throws in the .ctor()?
1. If an exception was thrown in a type's .ctor(), then the class's destrutor wouldn't be called.2. If a exception was catched in a try-catch block, all the well-constructed object will be destructe原创 2008-06-03 16:12:00 · 704 阅读 · 0 评论 -
TSF 在Win 8.1下的问题处理(未写完)
最近发现,之前解决的输入法问题在Windows 8.1下又不工作了,联系了微软给出了解决方案,先写把原型代码贴一下: if (!(GetKeyState(VK_CONTROL) < 0)) { if (!IPEIsActive()) { try原创 2014-01-22 18:31:09 · 2724 阅读 · 0 评论