加载中
C++_读lin文件

lin后缀的为cad的线型文件. if(!PathFileExists(strFilePath.c_str())) { return false; } std::vector vecLineStyle; MdIfStream ifs; ifs.open(strF......

2019/09/03 20:35
496
C++_颜色COLORREF

1.OdCmColor转COLORREF OdCmColor odaColor; COLORREF refColor = RGB(odaColor.red(),odaColor.green(),odaColor.blue()); 2. COLORREF转OdCmColor COLORREF refColor OdCmColor odaColor;...

2019/01/24 15:20
534
c++_CDocument

CDocument:为用户定义的文档类提供了基本的函数功能,如创建、装载、保存等。 ON_COMMAND(ID_FILE_SEND_MAIL, OnFileSendMail) 发送邮件:OnFileSendMail()......

2018/11/06 11:07
1K
c++_CView

CView:视图程序设计中使用率最高的窗口对象,它是用户的主要操作界面。因为它通常以某种形式表示文档数据,所以称之为视图。一个视图对象只关联一个文档对象;一个文档对象可以关联多个视图,...

2018/09/26 13:24
1.3K
c++_CWinApp

CWinApp:MFC 中的主应用程序类封装用于 Windows 操作系统的应用程序的初始化、运行和终止. ON_COMMAND(ID_FILE_NEW, &CWinApp::OnFileNew) ON_COMMAND(ID_FILE_OPEN, &CWinApp::OnFileOpen)...

2018/09/26 11:37
2.3K
c++_拷贝构造函数

拷贝构造又叫复制构造;如果没有实现拷贝构造函数,c++会自动生成一个,叫做隐式拷贝构造函数.该自动生成的隐式拷贝构造也能应付绝大部分情况. 拷贝构造函数的格式: //定义 class CTest { publ...

2018/09/20 20:50
211
C++_CFontDialog字体选择对话框

LOGFONT* pLogFont = new LOGFONT; CFontDialog dlg(pLogFont );//构造函数初始化字体 COLORREF color=RGB(0,255,0); dlg.m_cf.rgbColors = color;////颜色则需要单独设置 if(IDOK == dlg.D...

2018/08/28 14:41
3.3K
C++_读写ini配置文件

1.WritePrivateProfileString:写配置文件 WritePrivateProfileString 函数的定义形式为: BOOL WritePrivateProfileString(LPCTSTR lpAppName, LPCTSTR lpKeyName, LPCTSTR lpString, LPCTST...

2018/07/23 19:29
1.3K
c++_导入/导出excel文件

方法1:通过数据库 (1)导出excel CDatabase database; CString sDriver = _T("MICROSOFT EXCEL DRIVER (*.XLS)"); // Excel安装驱动 CString sExcelFile = _T("c:\\系统告警信息导出文件....

2018/07/16 17:02
4.5K
C++_获得唯一id

//! 得到全局唯一ID __declspec(dllexport) CString GenGUID(); __declspec(dllexport) CString GenGUID() { CString strGUID = _T(""); GUID guid; HRESULT hr = CoCreateGuid(&gui......

2018/06/26 11:56
1.3K
C++_XML生成

例1: 先看一下,xml的结构 生成代码 CGeometry Parser; Parser.SetVersionEncoding(_T("version=\"1.0\" encoding=\"GBK\"")); CPSRAttribute aa; aa.m_strName = _T("PSRURI名称"); ...

2018/06/13 18:13
333
C++_CFileFind文件查找

CFileFind file; CString strDir = _T("C:\\Users\\Administrator\\Desktop"); //查找指定文件 bool bContinue = file.FindFile(strDir + _T("\\*.*"))); while(bContinue) { bContinue = fi...

2018/06/04 14:34
4.1K
boost使用详解

1. boost::any:万能数据类型 #include std::vector vec; template void VarEqu(mT& pVar, const boost::any& mAn) { pVar = boost::any_cast(mAn); } 2.......

2018/06/01 13:58
275
Base64编码

编码: std::string CCryptoEnvelop::Base64EncryptStr(byte* pPlaintext, int nLen) {   std::string outstr;   if (NULL == pPlaintext || nLen < 1)     return outstr;   Base64Encoder enco...

2018/01/05 11:59
76
编码格式的转换UTF8<——>GBK

GBK兼容GB2312,同时在GB2312标准的基础上扩展了GB13000包含的字。 CComVar CComVar::ToGBK(const char * strUtf8 ) {   int len=MultiByteToWideChar(CP_UTF8, 0, strUtf8, -1, NULL,0);   L...

2018/01/05 11:55
311
c++_CreateDirectory

CreateDirectory:创建文件夹 CreateDirectory 函数的定义形式为: BOOL CreateDirectory(LPCTSTR lpPathName,LPSECURITY_ATTRIBUTES lpSecurityAttributes); 第一个参数:lpPathName: 文件夹...

2017/11/16 20:09
1.7K
C++__waccess/_access

_waccess:文件是否可以访问 int _waccess( const wchar_t *path, int mode ); if (_waccess(strItemPath, 0) != -1) //存在文件,并可以访问 _access: int _access( const char *path, ...

2017/10/28 17:57
158
C++_CTime/COleDateTime时间

CTime:获取时间 CString strTime; CTime timeCurr = CTime::GetCurrentTime(); strTime.Format(_T("%d%d%d%d%d%d"),timeCurr.GetYear(),timeCurr.GetMonth(),timeCurr.GetDay(),timeCurr.G...

2017/10/28 17:24
1K
C++_SHFileOperation文件夹操作

SHFileOperation: 可以实现各种文件操作,如文件的拷贝、删除、移动等 . 需要的库文件: #include <Shlwapi.h> #pragma comment (lib,"Shlwapi.lib") SHFileOperation函数的定义形式为: int S...

2017/06/08 15:32
8.7K

没有更多内容

加载失败,请刷新页面

返回顶部
顶部