大约有 2,800 项符合查询结果(耗时:0.0084秒) [XML]

https://www.tsingfun.com/it/cpp/1372.html 

Boost智能指针——shared_ptr - C/C++ - 清泛网 - 专注C/C++及内核技术

... 不要构造一个临时的shared_ptr作为函数的参数。 如下列代码则可能导致内存泄漏(当函数g()抛异常的时候就会泄露了,这个是boost文档上特地注明的标准bad Practices): void test() { foo(boost::shared_ptr<implementation>(new implementati...
https://www.tsingfun.com/it/cpp/1424.html 

VC/MFC 临界区域使用方法实例 - C/C++ - 清泛网 - 专注C/C++及内核技术

...。 Windows 98没有可以使用的TryEnterCriticalSection函数的实现代码。调用该函数总是返回FALSE。 PS:可以定义不同的临界区域对象(CRITICAL_SECTION)来锁定不同的共享资源,使用方法就是传递不同的参数对象,如m_cs_test。 临界区域 CRI...
https://www.tsingfun.com/it/cpp/1434.html 

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...
https://www.tsingfun.com/it/cpp/1463.html 

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...
https://www.tsingfun.com/it/cpp/1467.html 

php array为空的判断 - C/C++ - 清泛网 - 专注C/C++及内核技术

...断问题,个人一般用empty()来做数组非空判断,这样感觉代码看起来更容易理解。 转自: http://www.lutuzhi.com/theweb/433.html php array 数组 为空判断
https://www.tsingfun.com/it/cpp/1469.html 

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...
https://www.tsingfun.com/it/cpp/1493.html 

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...
https://www.tsingfun.com/it/cpp/1522.html 

error LNK2019: 无法解析的外部符号_socket,该符号在函数 中被引用 - C/C+...

... 解决方法如下: 在CPP文件include语句之后加上如下代码: #pragma comment(lib,"ws2_32.lib") LNK2019 socket
https://www.tsingfun.com/it/cpp/1548.html 

如何让CSplitterWnd分割窗口大小改变后不出现滚动条? - C/C++ - 清泛网 - ...

...果如图: 解决方案: 上面窗口的OnSize()函数中添加代码: //隐藏滚动条 ShowScrollBar(SB_BOTH, FALSE); 这时应该就OK了,效果如下: CSplitterWnd 滚动条
https://www.tsingfun.com/it/cpp/1550.html 

MFC判断窗口是否最小化、最大化 - C/C++ - 清泛网 - 专注C/C++及内核技术

...lg->GetSafeHwnd())) { ... } 最大化判断使用IsZoomed()函数,代码同上。MFC 判断窗口 最小化 最大化