大约有 1,900 项符合查询结果(耗时:0.0091秒) [XML]
半个汉字的校验与处理(C++) - C/C++ - 清泛网 - 专注C/C++及内核技术
...生新的半个汉字。
以下是我近期对半个汉字的处理,C++代码如下:
// strSrc: 原始字符串
// nMaxLen: 截断后的最大长度
char *GetTruncate(char *strSrc, int nMaxLen)
{
if (strSrc == NULL || nMaxLen == 0)
{
return NULL;...
BugTrap:程序崩溃快照、bug跟踪之利器 - C/C++ - 清泛网 - 专注C/C++及内核技术
...出崩溃信息对话框,直接将崩溃包保存文件,只需将上述代码改为:
static void SetupExceptionHandler()
{
LOG_TRACER();
BT_InstallSehFilter();
// 配置信息
BT_SetAppName(_T("MarketInfo"));
//自动保存crash文件
BT_SetReportFilePath(_T("crash")...
一个宏命令,就可以程序崩溃时生成dump文件 - C/C++ - 清泛网 - 专注C/C++及内核技术
...初始化时加入 DeclareDumpFile();
创建头文件DumpFile.h, 将下列代码放进文件中:
#pragma once
#include <windows.h>
#include < Dbghelp.h>
#include <iostream>
#include <vector>
using namespace std;
#pragma comment(lib, "Dbghelp.lib")
namespace NSDumpFile
{
...
由“Pure Virtual Function Called” 考虑到的 - C/C++ - 清泛网 - 专注C/C++及内核技术
.../887598.html (分析汇编,底层而完善)
一些短小的验证代码:Pure_Virtual_Function_Called考虑到的.rar
Pure Virtual Function Called
VC/MFC 临界区域使用方法实例 - C/C++ - 清泛网 - 专注C/C++及内核技术
...。
Windows 98没有可以使用的TryEnterCriticalSection函数的实现代码。调用该函数总是返回FALSE。
PS:可以定义不同的临界区域对象(CRITICAL_SECTION)来锁定不同的共享资源,使用方法就是传递不同的参数对象,如m_cs_test。
临界区域 CRI...
stl 字符串std::string作为std::map主键key的实例 - C/C++ - 清泛网 - 专注C/C++及内核技术
...串作为key的常见用法,并使用find_if实现map按value值查找。代码如下:
#include <map>
#include <string>
#include <algorithm>
using namespace std;
class map_value_finder
{
public:
map_value_finder(const std::string &cmp_string):m_s_cmp_string(cmp_string){}
boo...
div布局居中的方法 - C/C++ - 清泛网 - 专注C/C++及内核技术
...景div横铺float:left,然后指定显示div宽度并设置margin:auto。代码如下:
<div class="testbg">
<div class="test"/>
</div>
<style>
<!--
.testbg{
position:relative;
width:100%;
float:left;
}
.testbg .test{
position:relative;
width:1000px;
height:60px;
margi...
php array为空的判断 - C/C++ - 清泛网 - 专注C/C++及内核技术
...断问题,个人一般用empty()来做数组非空判断,这样感觉代码看起来更容易理解。
转自: http://www.lutuzhi.com/theweb/433.html
php array 数组 为空判断
MFC SysLink的使用方法 - C/C++ - 清泛网 - 专注C/C++及内核技术
...DR, LRESULT *pResult)
{
// TODO: 在此添加控件通知处理程序代码
PNMLINK pNMLink = (PNMLINK) pNMHDR;
if (wcscmp(pNMLink->item.szUrl, L"https://www.tsingfun.com") == 0)
{
// 主要执行语句
ShellExecuteW(NULL, L"open", pNMLink->item.szUrl, NUL...
SHFileOperation 这个API函数怎么用起来结果飘忽不定? - C/C++ - 清泛网 -...
...决:
改用C++的FindNextFile,支持 * 通配符查找文件,核心代码如下:
WIN32_FIND_DATA FindFileData;
char szCurPath[MAX_PATH + 1] = { 0 };
GetCurrentDirectory(MAX_PATH, szCurPath);
CString findFileName;
findFileName.Format("%stest*.txt", szCurPath);
HANDLE hFind = ::Find...