大约有 45,300 项符合查询结果(耗时:0.0468秒) [XML]
Boost智能指针——shared_ptr - C/C++ - 清泛网 - 专注C/C++及内核技术
...1.use_count()<<" references\n";
boost::shared_ptr<implementation> sp2 = sp1;
std::cout<<"The Sample now has "<<sp2.use_count()<<" references\n";
sp1.reset();
std::cout<<"After Reset sp1. The Sample now has "<<sp2.use_count()<<" references\n";
sp2.reset();
std:...
CMap用法 - C/C++ - 清泛网 - 专注C/C++及内核技术
...
CMapInt map;
//添加key,val
map.SetAt(1, "str1");
map.SetAt(2, "str2");
map.SetAt(3, "str3");
map.SetAt(1, "str11"); //把str1覆盖了
//查找(方法一:Lookup)
CString str;
if (map.Lookup(1, str))
{
printf("find:%s\n", str);
}
//查找(方法二:P...
mfc 画圆角矩形 - C/C++ - 清泛网 - 专注C/C++及内核技术
...ct rect;
GetClientRect(&rect);
int x = (rect.Width() - cxIcon + 1) / 2;
int y = (rect.Height() - cyIcon + 1) / 2;
}
else
{
CRect rc(10, 10, 100, 80);
//画圆角矩形
SIZE sizeRect = {3, 3};
DrawRoundRect(this->GetDC(), rc, sizeRect);
}
这里直接使用的窗口...
WSAAsyncSelect模型 - C/C++ - 清泛网 - 专注C/C++及内核技术
...工程,工程名为test,然后在testDlg.h中定义
#include "winsock2.h"
#pragma comment(lib, "WS2_32")
#define WM_SOCKET (WM_USER+1)
同时在该文件中加入一个自定义消息处理函数
afx_msg LRESULT OnSocketMsg(WPARAM wParam,LPARAM lParam);
在testDlg.cpp中定义
ON_MES...
c++ boost::multi_index composite keys efficiency - C/C++ - 清泛网 - 专注C/C++及内核技术
...s this mean that the structure is stored such that a lookup for a specific 2-part composite key will take O(n=1) time, i.e. is the container sorted such that there is a pointer directly to each item, or does the boost container retrieve a list that matches the first part of the composite key and the...
预编译头文件来自编译器的早期版本,或者预编译头为 C++ 而在 C 中使用它(...
...持不变:
c文件右键“属性”,设置界面同上。
2、方案二:使用静态lib库。
方案2:影响的文件比较多,则把它们都设置禁止预编译头的话仍然会使项目总体的编译速度大大降低,得不偿失。这时考虑可以为这组文件建...
MFC中使用CSplitterWnd分割窗口后视图大小的问题 - C/C++ - 清泛网 - 专注C/C++及内核技术
...要的结果。
CSize sizeDummy;
m_wndSplitterH.CreateStatic(this, 2, 1);
if (!m_wndSplitterH.CreateView(0, 0, RUNTIME_CLASS(CGraphFrame), sizeDummy, pContext))
这时,你可以:
1、设置一下m_wndSplitterH的SetRowInfo属性函数,如:m_wndSplitterH.SetRowInfo(0,100,0);
...
更改MFC对话框默认的窗口类名 - C/C++ - 清泛网 - 专注C/C++及内核技术
...,我们可以直接使用它们。比如,对话框的窗口类为“#32770”,按钮的窗口类为“Button”,列表框的窗口类为“ListBox”……等等。
很多时候,我们需要用到FindWindow函数来查找已经存在的窗口,然后给它发送消息。或者查询系...
[完整源码实例] 修改 CListCtrl 的标题栏字体颜色;重绘 CListCtrl 标题栏 ...
...rawItemStruct->CtlType == ODT_HEADER);
HDITEM hdi;
TCHAR lpBuffer[256];
hdi.mask = HDI_TEXT;
hdi.pszText = lpBuffer;
hdi.cchTextMax = 256;
GetItem(lpDrawItemStruct->itemID, &hdi); // Draw the button frame.
::DrawFrameControl(lpDrawItemStruct->hDC, &lpDrawItemStruct->rc...
CListCtrl 行高设置,自定义行高 - C/C++ - 清泛网 - 专注C/C++及内核技术
... if( bHighlight ) //如果被选中
{
pDC->SetTextColor(RGB(255,255,255)); //文本为白色
pDC->FillRect(rcBack, &CBrush(RGB(90,162,0)));
}
else
{
pDC->SetTextColor(RGB(0,0,0)); //文本为黑色
pDC->FillRect(rcBack, &CBrush(RGB(2...
