
C++
tina_tian1
行到水穷处,坐看云起时
展开
-
gdb调试core dump文件
[root@localhost CMarketServer_dist]# gdb -c core.18669GNU gdb (GDB) Red Hat Enterprise Linux (7.2-83.el6)Copyright (C) 2010 Free Software Foundation, Inc.License GPLv3+: GNU GPL version 3 or lat原创 2015-11-16 18:00:59 · 5699 阅读 · 0 评论 -
数据库字段 C++定义
通过加入assigned字段来判断是否需要更新数据库字段field.h#ifndef _FIELD_H_#define _FIELD_H_#include #define SETIFASSIGNED(A, B) \ if (B.assigned()) { \ A = B; \ } \templateclass Field{pub转载 2015-12-21 17:56:41 · 682 阅读 · 0 评论 -
c++ windows app激活另一app的某窗口
激活application.exe 窗口标题1/窗口标题2/窗口标题3中的一个,先找到先激活。调用ShowBondMainWindow()即可#include "showmainwindow.h"#include #include #pragma comment (lib, "Psapi.lib")//define members#define MAX_WINDOW_COUNT原创 2015-11-24 17:17:25 · 1011 阅读 · 0 评论 -
C++屏蔽Windows中文输入法
void LoginDlg::onPasswordFocusChanged(bool isfocus){ HWND wnd = (HWND)this->winId(); if (isfocus) { //focus on hIMC_ = ::ImmGetContext(wnd); if(hIMC_) { ImmAssociateContext(wnd, n原创 2015-11-24 17:30:15 · 4675 阅读 · 0 评论 -
gdb调试linux可执行程序
[root@localhost CSwapServer_dist]# gdb CSwapServerGNU gdb (GDB) Red Hat Enterprise Linux (7.2-83.el6)Copyright (C) 2010 Free Software Foundation, Inc.License GPLv3+: GNU GPL version 3 or later原创 2015-11-13 18:18:50 · 7657 阅读 · 0 评论 -
qtablewidget 导出为 excel
From: http://blog.youkuaiyun.com/cool222/article/details/38639647在 Qt 5.2 中使用 OLE 将 qtablewidget 导出为 excel,效果如下:只用了一个函数,大家可以把它粘贴到自己的类里使用。在头文件中请包含以下文件:#include #include #include转载 2015-11-09 15:02:16 · 1630 阅读 · 0 评论 -
通过QT 转换html文件为word文档
void onPrintBtn(){ //1. open SaveDialog and get a file name if (last_path_.isEmpty()) { QString path = QStandardPaths::standardLocations(QStandardPaths::DocumentsLocation).at(0); QDir::root()原创 2015-11-09 15:06:22 · 5225 阅读 · 0 评论 -
注意include .h 文件的使用
场景:(看到项目中有如下使用方式,觉得会存在弊端,占用不必要的内存,虽然结果没有问题。)多个变量定义在一个fid.h文件,多个cpp文件(比如100个)同时#include "fid.h"弊端:任意一变量会在cpp文件中展开,如果fid.h被include了100次,任一fid.h中的变量将在可执行文件中定义100次,之所以链接不会出错重复定义,是因为变量被cons原创 2015-09-06 18:06:29 · 3667 阅读 · 0 评论 -
类的callback抽象定义和调用
场景:多个类对象的多个操作需要回调.1. 定义CallbackAction, 保存类对象及此类相关操作template class ActionCallback{public: typedef void(T::*FUN)(Output_Type tuple); Callback(T* obj, FUN method) { class_ = obj; met原创 2015-08-14 18:31:00 · 824 阅读 · 0 评论