
c++
IT_Kyle
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
c++ Excel 合并单元格
c++ Excel 合并单元格原创 2022-10-19 10:48:04 · 835 阅读 · 0 评论 -
map基本函数
map 的基本操作函数: C++Maps 是一种关联式容器,包含“关键字/值”对 begin()返回指向 map 头部的迭代器 clear()删除所有元素 count()返回指定元素出现的次数 empty() 如果 map 为空则返回 true end() 返回指向 ma...原创 2022-04-30 17:45:32 · 1170 阅读 · 0 评论 -
C/C++中【提高程序效率的9个简单方法】及【20个重点笔记】
一、程序效率的提升(1)如果选择为if---if---if--,则应选择if--else if--else或者是switch-case;后两者比较的次数少,效率高;例如:if(1==a) {dosomething;}if(2==a) {dosomething;}if(3==a) {dosomething;}以上三个if都得执行,但是下面的:switch(a){case 1:do something; break;case 2:do something; break;case 3:do s转载 2022-04-01 14:59:00 · 2105 阅读 · 0 评论 -
Socket 常见错误码
Socket error 0 - Directly send errorSocket error 10004 - Interrupted function callSocket error 10013 - Permission deniedSocket error 10014 - Bad addressSocket error 10022 - Invalid argumentSocket error 10024 - Too many open filesSocket er...转载 2021-07-08 16:31:23 · 2921 阅读 · 0 评论 -
RGB565 转 RGB
void RGB565ToRGB(unsigned short n565Color){ short nRed = (n565Color & 0xf800) >> 8; short nGreen = (n565Color & 0x07e0) >> 3; short nBlue = (n565Color & 0x001f) << 3;}原创 2021-07-01 17:25:29 · 520 阅读 · 0 评论 -
CFile::Read()读取中文乱码问题
if (file.Open(strPath, CFile::modeRead)){ file.Seek(0, CFile::begin); nFileLen = file.GetLength(); pbuf = new char[nFileLen + 1]; file.Read(pbuf, nFileLen); pbuf[nFileLen] = 0; file.Close(); //用CA2W 转换格式 strbuf = CA2W(pbuf, CP_UTF8); if原创 2021-06-02 14:37:40 · 945 阅读 · 0 评论 -
COleDateTime 时间在秒上加减
因为无法在COleDateTime上直接进行加减,需要将COleDateTime 转成CTime,再进行操作。COleDateTime 转 CTimeSYSTEMTIME sys_time;ole_time.GetAsSystemTime(sys_time);CTime c_time;c_time = CTime(sys_time);然后用c_tiem 进行加减秒。CTime Time(L"");Time.Format(“%Y-%m-%d %H:%M:%s”);...原创 2021-05-10 11:50:48 · 531 阅读 · 0 评论 -
判断文档是office打开,还是WPS打开
word和Excel文档的类型可以区分当前文档是用office打开还是wps打开,所以我们就获取文档类型,进行判断。wps打开的文档,它的文档类型是DOC、DOCX、XLS、XLSXoffice打开的文档,它的文档类型是Microsoft*****之类的//strPath 文档路径//strExt 文档后缀BOOL OpenByWps(CString strPath, CString strExt){ BOOL bWps = FALSE; //获取文件类型 CString strVal(原创 2020-12-09 18:31:51 · 3978 阅读 · 0 评论 -
判断是否兼容WPS
//判断当前是否用WPS打开BOOL OpenByWPS(){ BOOL bOpenByWPS = FALSE; HKEY hKey; //WPS注册表路径 LPCTSTR strSubKey = L"Software\\Kingsoft\\Office\\6.0\\Common"; long lRet = ::RegOpenKeyEx(HKEY_CURRENT_USER, strSubKey, 0, KEY_QUERY_VALUE, &hKey); if (lRet == ERRO原创 2020-12-09 17:22:41 · 444 阅读 · 0 评论 -
判断电脑是否安装WPS
BOOL InstallWPS(){ BOOL bInstall = FALSE; HKEY hKey; LPCTSTR strSubKey = L"Software\\Kingsoft\\Office\\6.0\\Common"; long lRet = ::RegOpenKeyEx(HKEY_CURRENT_USER, strSubKey, 0, KEY_QUERY_VALUE, &hKey); if (lRet == ERROR_SUCCESS) { CString strV原创 2020-12-09 17:03:49 · 1710 阅读 · 0 评论 -
代码实现软件兼容电脑版本
void SetCompatible(){ //获取电脑版本 CString stOSysetemVerion; int iVer = 0; OSVERSIONINFOW OsVersionInfo; OsVersionInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFOW); GetVersionExW(&OsVersionInfo); if (OsVersionInfo.dwPlat.原创 2020-10-29 19:10:23 · 230 阅读 · 0 评论 -
无响应 --- 问题事件名称: AppHangB1
描述: 出现了一个问题,该问题导致了此程序停止与 Windows 进行交互。问题签名: 问题事件名称: AppHangB1 应用程序名: xxxx.exe 应用程序版本: 1.0.0.1 应用程序时间戳: 5f9a5a49 挂起签名: 8919 挂起类型: 0 OS 版本: 6.1.7601.2.1.0.256.1 区域设置 ID: 2052 其他挂起签名 1: 89190c586db7774c17e6efda...原创 2020-10-29 14:54:50 · 18210 阅读 · 1 评论 -
获取系统端口号
//获取端口号BOOL CMyBlueT::GetCOM(){ SetTips(L"正获取COM端口号。。。"); int nCount = 0; CRegKey RegKey; m_vCom.clear(); My_COM myCom; if (RegKey.Open(HKEY_LOCAL_MACHINE, L"Hardware\\DeviceMap\\SerialComm") == ERROR_SUCCESS) { while ...原创 2020-09-18 10:17:50 · 509 阅读 · 0 评论 -
error C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead.
解决方法是:【项目属性】,【C++】里的【预处理器】,在里面加入一段代码:_CRT_SECURE_NO_WARNINGS。原创 2020-05-09 09:39:25 · 238 阅读 · 0 评论 -
C++ 用命名模式写撤销操作
1.首先建立命令虚基类.h//基类虚函数class Command{public: Command(void){}; virtual ~Command(void){};public: virtual void Redo() = 0; virtual void Undo() = 0;};2.创建管理命令的类.h#include "Command.h"#i...原创 2019-08-22 19:22:25 · 422 阅读 · 0 评论