随笔分类 -  C/C++

摘要:\r:回车,ASCII码13 r->return\n:换行,ASCII码10 n->newline在Windows中:'\r'回车,回到当前行的行首,而不会换到下一行;'\n'换行,换到当前位置的下一行,而不会回到行首;\r与\n的区别:\r : return 到当前行的最左边。\n: ... 阅读全文
posted @ 2015-10-29 14:45 Lthis 阅读(9449) 评论(0) 推荐(0)
摘要:指向API的函数指针定义方法typedef NTSTATUS ( __stdcall *ZWQUERYSYSTEMINFORMATION ) ( IN SYSTEM_INFORMATION_CLASS SystemInformationClass, IN OUT PVOID Syst... 阅读全文
posted @ 2015-08-15 20:38 Lthis 阅读(357) 评论(0) 推荐(0)
摘要:原帖:程序崩溃时自动记录minidump的c++类封装了一个C++类,当程序意外崩溃的时候可以生成dump文件,以便确定错误原因。头文件://crash_dumper_w32.h#ifndef _CRASH_DUMPER_H_#define _CRASH_DUMPER_H_#include clas... 阅读全文
posted @ 2015-07-22 22:48 Lthis 阅读(515) 评论(0) 推荐(0)
摘要:VC6.0生成文件的种类和作用DSW:全称是Developer Studio Workspace,最高级别的配置文件,记录了整个工作空间的配置信息,她是一个纯文本的文件,在vc创建新项目的时候自动生成DSP:全称是Developer Studio Project,也是一个配置文件,不过她记录的是一个... 阅读全文
posted @ 2015-07-11 12:48 Lthis 阅读(797) 评论(0) 推荐(0)
摘要:作者信息:罗树鹏http://www.cnblogs.com/luoshupeng由于笔者在实践过程中走了一些弯路,所以把这些情况记录下来,希望为后来者提供一些经验。在VC6.0时代,可以通过组件为工程加入SplashScreen,具体方法是通过IDE中的菜单Project->Add to Proj... 阅读全文
posted @ 2015-04-27 23:31 Lthis 阅读(865) 评论(0) 推荐(0)
摘要:#include #include #include #include #include int SearchStr(PTSTR pszString, int iStrLen, PTSTR pszSearchStr){ int i = 0; int iSearchStrlen = _tc... 阅读全文
posted @ 2015-04-27 22:00 Lthis 阅读(546) 评论(0) 推荐(0)
摘要:先贴代码(小数点后6位) vc6.0测试#include "stdafx.h"#include #include int main(int argc, char* argv[]){ double d = 0.0; int nCount = 0; srand((int)time(0)... 阅读全文
posted @ 2015-04-18 20:18 Lthis 阅读(12591) 评论(0) 推荐(0)
摘要:void showErrorInfo(UINT nErrCode, UINT nLine, LPCTSTR lpFuncName, UINT nType);/**************************************************************** // Fun... 阅读全文
posted @ 2015-03-23 21:14 Lthis 阅读(339) 评论(0) 推荐(0)
摘要:VS2013下测试// conselTest.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include int _tmain(int argc, _TCHAR* argv[]){ printf_s("行号:%d\n函数名:%s\n文件名:%s\n", ... 阅读全文
posted @ 2015-03-23 20:03 Lthis 阅读(125) 评论(0) 推荐(0)
摘要:1.方法1 TCHAR pBuf[MAX_PATH]; //存放路径的变量 GetCurrentDirectory(MAX_PATH, pBuf); //获取程序的当前目录 _tcscat_s... 阅读全文
posted @ 2015-03-04 17:25 Lthis 阅读(2018) 评论(0) 推荐(0)
摘要:// 判断是否存在文件BOOL pathIsFile(TCHAR* lpPath){ // 过滤路径是文件夹的情况 // Code by Lthis if (PathIsDirectory(lpPath)) return FALSE; ... 阅读全文
posted @ 2015-03-03 17:29 Lthis 阅读(601) 评论(0) 推荐(0)
摘要:十六进制字符串转十六进制数字 x64/x86 http://www.cnblogs.com/khler/archive/2010/11/10/1873284.html 本文为khler原作,转载必须确保本文完整并完整保留原作者信息及本文原始链接E-mail: khler@163.comQQ: 233 阅读全文
posted @ 2015-01-07 16:09 Lthis 阅读(478) 评论(0) 推荐(0)
摘要:Strsafe.h functionReplacesStringCchCatStringCchCatExstrcat, wcscatStringCchCatNStringCchCatNExstrncatStringCchCopyStringCchCopyExstrcpy, wcscpyStringC... 阅读全文
posted @ 2015-01-03 16:25 Lthis 阅读(403) 评论(0) 推荐(0)
摘要:现在都用宽字节(unicode)了,所以建议使用wstring取代string(ansi版)不像CString一样有Format函数去转换,string/wsting类型需要手动转换#include #include using namespace std;using std::endl;using... 阅读全文
posted @ 2015-01-03 09:56 Lthis 阅读(1737) 评论(0) 推荐(0)