c++ thread
共 4 篇文章
#ocx 格式转换
[code="c++"] #include #include "iconv.h" using namespace std; typedef unsigned char byte; class Convert { private: int code_convert(char *from_charset,char *to_charset,char *inbuf,int inlen,char *outbuf,int outlen){ iconv_t cd; int rc; char **pin = &inbuf; char **pout = &outbuf; cd = iconv_open(to_…
2013-06-14 14:31 · c++ stdio · c++ thread
strtok_r 字符分割
char * strtok_r(char *ptr, const char *sep, char **end) { if(!ptr) /* we got NULL input so then we get our last position instead */ ptr = *end; /* pass all letters that are including in the separator string */ while(*ptr && strchr(sep, *ptr)) ++ptr; if(*ptr) { /* so this is where the next piece of …
2013-01-18 15:51 · c++ primer · c++ thread · c++
C++ template
#include <iostream> using namespace std; template <class T> inline T Max(T a, T b) { return a > b ? a : b; } int main() { int a = 1, b = 2; cout << Max(a, b) << endl; cout << Max(1.0, 2.0) << endl; cout << Max("hello", "world") << endl; return 0; } 2.类模板 #include <iostream> using namespace std; tem…
2009-09-24 10:25 · c++ thread · C · C++ · J# · C#
VC++屏幕抓词的技术实现
屏幕上的文字大都是由gdi32.dll的以下几个函数显示的:TextOutA、TextOutW、ExtTextOutA、ExtTextOutW。实现屏幕抓词的关键就是截获对这些函数的调用,得到程序发给它们的参数。 我的方法有以下三个步骤: 一、得到鼠标的当前位置 通过SetWindowsHookEx实现。 二、向鼠标下的窗口发重画消息,让它调用系统函数重画 通过WindowFromPoint,ScreenToClient,InvalidateRect 实现。 三、截获对系统函数的调用,取得参数(以TextOutA为例) 1.仿照TextOutA作成自己的函数MyTextOutA,与TextO…
2008-11-17 18:09 · c++ thread · VC++ · 工作 · 数据结构 · DOS