- 博客(11)
- 资源 (1)
- 收藏
- 关注
原创 SQL SERVER 同表跨连接拷贝数据
<br />首先得去掉一个权限限制<br />SQL Server 阻止了对组件 'Ad Hoc Distributed Queries' 的 STATEMENT'OpenRowset/OpenDatasource' 的访问,因为此组件已作为此服务器安全配置的一部分而被关闭。系统管理员可以通过使用 sp_configure 启用 'Ad Hoc Distributed Queries'。开启方法如下: <br />EXEC sp_configure 'show advanced options', 1 <b
2010-12-15 15:59:00
517
原创 vs2005下控制台程序运行时报找不到MSVCR80.dll的解决办法
<br />加入下面的预处理指令即可解决问题<br />#pragma comment(linker, "/"/manifestdependency:type='Win32' name='Microsoft.VC80.CRT' version='8.0.50608.0' processorArchitecture='X86' publicKeyToken='1fc8b3b9a1e18e3b' language='*'/"")<br />
2010-11-12 15:59:00
588
转载 获取当前可执行文件的路径
使用了cstringvoid GetCurrentPath(char *pPath){ CString strPath; //get entire path of running application and its title GetModuleFileName(NULL,pPath,MAX_PATH); strPath.Format(pPath); int iPos=strPath.ReverseFind('//'); if ((unsigned)iPos == -1)
2010-11-08 09:39:00
633
原创 双文件日志记录
<br />特点<br />1 采用双文件记录日志信息<br />2 当一个文件写满后,清空另外一个文件继续写入<br />3 可设置最大日志文件大小<br />4 文本文件使用unicode进行编码<br /> <br /> #define DEFAULT_STR_BUFF_LEN 2048class DoubleLog{public: DoubleLog(void); ~DoubleLog(void); bool Init(const string& logFileName)
2010-11-06 10:08:00
490
原创 参数字符串的构建与解析类
<br />参数字符串解析类<br />class StrParam{public: void SetOp(wchar_t sop); bool Init(const wstring& initStr); wstring GetParam(const wstring& str); int GetInt(const wstring& str); StrParam();private: map<wstring, wstring> mdata; bool InsertStr
2010-11-06 09:55:00
509
原创 定时关闭的消息提示框
<br />有时需要弹出一个messagebox提醒用户, messagebox会导致线程阻塞, 如果用户一直不点确定,则线程会一直阻塞在那里。<br />这个类实现了一个messagebox,如果用户在指定时间内没有点确定,则自动关闭该消息框。<br /> <br />class AutoCloseMsg{public: AutoCloseMsg(void); ~AutoCloseMsg(void); void ShowMsg(LPCTSTR szContext,LPCTSTR szT
2010-11-06 09:46:00
1400
原创 利用互斥控制程序只有一个运行实例
<br />bool CheckOneInstance(LPCTSTR mutexName){ HANDLE hOnceRunMutex ; wstring strClassName= mutexName; bool bFind = false; hOnceRunMutex = OpenMutex(MUTEX_ALL_ACCESS,FALSE,strClassName.c_str()); if(hOnceRunMutex==NULL) { bFind = false;
2010-11-06 09:31:00
405
原创 打开所在文件夹并选中文件
<br />在迅雷中,右键点击 "打开所在文件夹"<br /> <br />可以打开目标文件所在的文件夹,并选中目标文件.<br /> <br />一个实现是:<br /> <br />wstring filename = L"%systemroot%/xxx.txt"; ShellExecute(NULL,L"open",L"explorer.exe",filename.c_str(),NULL,true);
2010-08-30 16:17:00
507
原创 chMSG宏以及宏展开
读windows核心编程,看到一个宏chMSG这个宏的功能是在编译的时候向输出窗口输出一条消息,包含文件名和行号.比如在代码中输入#pragma chMSG(测试开始) 在编译的时候在输出窗口就会输出类似下面的消息,双击这条消息便能跳到指定行f:/test/wincore/processview/processview.cpp(24):测试开始以下是这个宏的定义 #de
2010-03-23 17:39:00
2177
原创 string与wstring的互转
string与wstring的互转实际上就是多字节字符串与宽字符串的转换.我们可以使用MultiByteToWideChar和WideCharToMultiByte进行转化. 以MultiByteToWideChar为例: MultiByteToWideChar的原型如下 int MultiByteToWideChar( UINT CodePage, DWORD
2010-03-21 17:57:00
1241
原创 chHANDLE_DLGMSG 对话框消息处理宏的一点点心得
最近读到windows核心编程 作者制作的chHANDLE_DLGMSG 对话框消息处理宏 #define chHANDLE_DLGMSG(hWnd, message, fn) / case (message): return (SetDlgMsgResult(hWnd, uMsg, / HANDLE_##message((h
2010-03-21 03:01:00
1893
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人