- 博客(34)
- 资源 (2)
- 收藏
- 关注
原创 Ubuntu 8.04 Install insight
Ubuntu 8.04 Install insight1,Download package from http://sourceware.org/insight/downloads.php2,untar it to user folder,like /home/me/insight3,cd /home/me/insight folder, run:a,./configure
2013-07-09 17:11:18
778
原创 Fedora 9 Install QT
1,Download qt-everywhere-opensource-src-4.7.1.tar.bz2 to ~./Downloads 2,Unzip it to /usr/local$ tar -jxvf qt-everywhere-opensource-src-4.7.1.tar.gz -C /usr/local3,Add QT PATH to your .bash_profi
2013-06-19 15:34:41
1308
转载 Windows LangId 数值对照表
通过GetUserDefaultLangID(),GetSystemDefaultLCID(),GetSystemDefaultLangID()等函数取出的LangId,可以对比一下表。Display nameValueDefault charsetArabic1025ArabicBas
2012-06-15 16:17:26
6795
转载 C++实现urlencode,urldecode
namespace HttpUtility{ typedef unsigned char BYTE; inline BYTE toHex(const BYTE &x) { return x > 9 ? x -10 + 'A': x + '0'; } inline BYTE fromHex(const BYTE &x)
2012-05-30 15:42:26
7954
转载 Quotes about programming languages
What computer scientists, authors and programmers think of popular programming languages.All languages"There are two ways of constructing a software design. One way is to make it so simple
2012-05-22 12:01:07
852
转载 HTML <form> 标签的 enctype 属性
定义和用法enctype 属性规定在发送到服务器之前应该如何对表单数据进行编码。默认地,表单数据会编码为 "application/x-www-form-urlencoded"。就是说,在发送到服务器之前,所有字符都会进行编码(空格转换为 "+" 加号,特殊符号转换为 ASCII HEX 值)。实例在下面的例子中,表单数据会在未编码的情况下进行发送:enctype=
2012-05-22 09:41:45
548
转载 字符串处理 - ANSI - Unicode - UTF8 转换
最近发现一个比较全的字符串编码转换的方法,记录如下:2008-11-4: 使用MultiByteToWideChar和WideCharToMultiByte写的4个ANSI Unicode UTF-8 相互转换的函数。2008-11-5: 使用C语言标准库mbstowcs和wcstombs写的w2m和m2w两个函数,分别对应ANSI Unicode 相互转换。2008-11-8: 包
2012-04-26 15:03:52
4910
转载 取得两个 FILETIME 的时间差
如果为SYSTEMTIME,可以通过SystemTimeToFileTime先转到FILETIME#define NOMINMAX #include #include SYSTEMTIME systemtime_difference(SYSTEMTIME const& st1, SYSTEMTIME const& st2) { FILETIME ft1;
2011-12-28 16:59:15
6352
翻译 获取createprocess运行的命令行中产生的字符(Pipe方法)
感谢http://www.vckbase.com/english/code/misc/redirect.shtml.htm所提供的源码,或从以下链接下载http://download.youkuaiyun.com/detail/sandro_zhang/3869045主要函数整理如下。void Redirect(){ wchar_t command_line[] = L"output
2011-12-01 22:40:18
3219
原创 C++取得系统时间
string GetTimeStr(){ char buffer [80] = {0}; struct tm timeStruct; time_t localTime; localTime = time(NULL); localtime_s(&timeStruct, &localTime); strftime( buffer, 80, "%Y-%
2011-12-01 12:46:51
1649
原创 设置程序 不显示控制台窗口
1,在程序开始时调用FreeConsole();(windows.h)2,在VC开发环境的控制台还是会有的,因为那是VC调的,不过你的程序不会输出到那个控制台罢了(http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/freeconsole.asp)在工程属性里面分别设置lin
2011-11-30 12:20:44
8552
原创 打印机控制命令行
在CMD中输入rundll32 printui.dll,PrintUIEntry 即可得到如下用法和示例:Usage: rundll32 printui.dll,PrintUIEntry [options] [@commandfile] /a[file] binary file name /b[name] base printer name /c[name] unc mach
2011-11-30 10:52:27
6811
转载 Multipart Internet Mail Extensions (MIME)
Description of Data ContentTypical Filename ExtensionsMIME type/subtype Text and Text-Related Types HTML text data (RFC 1866)html htm text/ht
2011-11-19 21:40:29
901
原创 VC下添加和删除系统托盘图标,处理响应事件(Shell_NotifyIcon)
分步骤如下:1,定义用户消息#define WM_TRAY_NOTIFY (WM_USER + 8118)2,添加托盘图标NOTIFYICONDATA data;memset(&data, 0, sizeof(data));// the basic functions need only V1#ifdef NOTIFYICONDATA_V1_SIZE data.cbS
2011-11-01 16:08:01
5183
原创 像素,尺寸大小的转换
今日转换打印机页面大小时有些含糊,现做记录。以A4纸为例:XPS文件中print ticket 大小如下:210000297000单位为微米。即A4大小以毫米计算,为 210×297mm.分辨率是96像素/英寸时,A4纸的尺寸的图像的像素是794×1123; 分辨率是150像素/英寸时,A4纸的尺寸的图像的像素是1240×1754; 分辨率是300像素/英
2011-10-31 17:25:15
16278
原创 image 图片生产XPS文件
由图片转为XPS文件,需要调用windows 版本为6.0后的API创建XPS,然后用图片刷将图片刷上去即可。并且如需加入print ticket可以用同样的方法加载资源,并载入,以下为我昨天参考MSDN上面的例子写好的源码,共享之。#include #include #include #include #include #include #include #include
2011-10-27 08:59:55
2455
1
原创 DEFINE_ENUM_FLAG_OPERATORS(x)的作用
#define DEFINE_ENUM_FLAG_OPERATORS(x)今天编译XPS相关的Sample,出现以下错误:1>c:\program files\microsoft sdks\windows\v7.1\include\msopc.h(440) : error C4430: missing type specifier - int assumed. Note: C++ does
2011-10-26 13:40:52
1614
原创 curl 以http方式读取文件并保存
以下为主函数代码:void main(){ //initialization CURL *curl; CURLcode res; curl = curl_easy_init(); if(curl){ //d
2011-10-14 16:19:33
10809
原创 VC设置createwindow方法生成的form, button的bitmap背景图
前两天做了一个notify window的提示窗口,现整理纠结出来的主要方法。1,设置window form的背景图(IDI_NOTIFY_BG为resource.rc文件中定义的bitmap文件) MSG msg; HWND hWnd;
2011-09-30 15:37:26
3979
转载 CURL错误代码及含义
NAMElibcurl-errors - error codes in libcurlDESCRIPTIONThis man page includes most, if not all, available error codes in libcurl. Why
2011-09-30 14:42:55
57370
转载 VC++ 获得主机名与IP
char hostName[256];gethostname(hostName,256);char hostAddress[256];HOSTENT *hostEntry;hostEntry=gethostbyname(hostName);wsprintf(hostAd
2011-09-29 16:03:49
1162
原创 boost 分割字符串并存入集合(类似php中的EXPLODE)
string teststr = "1,2,3,4,5";boost::char_separator separator(",");boost::tokenizer > tokens(teststr, separator);boost::tokenizer >::itera
2011-09-29 16:00:58
599
原创 解决WndProc无法捕获捕获WM_MOUSELEAVE和WM_MOUSEHOVER消息的问题
1,定义一个全局变量,来标记下是否在Track。BOOL _bMouseTrack=TRUE;2,在回调函数的WM_MOUSEMOVE消息中使用TrackMouseEvent函数 case WM_MOUSEMOVE: if (_b
2011-09-28 10:50:38
2657
原创 createwindow 创建 STATIC 文本并设置字体
HFONT hf = CreateFont( 16, // nHeight 0,
2011-09-28 10:39:18
6186
1
转载 boost regex正则区配 IP 地址
#include #include #include int main(){ std::string text(" 192.168.0.1 abc 10.0.0.255 10.5.1 1.2.3.4a 5.4.3.2 "); const char* pa
2011-09-21 15:57:41
1704
原创 系统托盘图标显示菜单(TrackPopupMenu)无法自动消失解决方法
函数:SetForegroundWindow需要先设置当前窗口为系统活动窗口,之后,系统就会自动设置响应的操作,比如自动隐藏之类的。HMENU menu = CreatePopupMenu();AppendMenu(menu, MF_STRING, 2, strEx
2011-09-19 16:39:19
3999
转载 Device Class GUIDs for Popular Types of Hardware
今天发现驱动的类的GUID都是唯一的,不能随意更改,找到了一个列表,记录下来。Other than programming for a device driver, the Globally Unique Identifier (GUID) for a device
2011-09-19 10:22:49
1325
转载 TCHAR 认识整理
定义TCHAR是通过define定义的字符串宏使用原理 因为C++支持两种字符串,即常规的ANSI编码(使用""包裹)和Unicode编码(使用L""包裹),这样对应的就有了两套字符串字符串处理函数,比如:strlen和wcslen,分别用于处理两种字符串
2011-09-16 17:15:08
682
原创 编译错误syntax error : missing ';' before 'type'
大多此情况的解决方法是,在一个函数体中,变量定义要放在所有函数调用之前.#include int main(){ char a[100]; char b; memset(&a, 0, 100); return 0;}
2011-09-16 15:44:10
1118
转载 使用google breakpad生成dump文件
使用google breakpad生成dump文件 breakpad的主要功能就是生成dump文件,还可以将dump文件发送的远程http服务器。 breakpad的SVN在这里http://google-breakpad.googlecode.com/svn/trunk
2011-09-16 15:36:27
1175
转载 WaitForSingleObject的用法
Waits until the specified object is in the signaled state or the time-out interval elapses.To enter an alertable wait state, use the WaitF
2011-09-13 15:10:45
577
原创 用默认浏览器打开一个链接(ShellExecute)
ShellExecute(NULL, "open", "http://www.microsoft.com", NULL, NULL, SW_SHOWNORMAL);
2011-09-13 13:11:39
2181
原创 限制EDITTEXT可输入的字符个数
打开窗体初始句柄 LPCDLGTEMPLATE hDlg; // handle to loaded resource hDlg = notify_config::GetResourceDialog( IDD_AUTHENTICATION_DIALOG );
2011-09-13 13:11:13
1451
原创 boost 正则去除全部的空格
string xpsContent = "here is serveral space";boost::regex exptrim( "\\s" );string xpsContent_nospace = boost::regex_replace(xpsContent,
2011-09-13 13:10:57
2145
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人