摘要: //-------------------------------------------------------------------------------------- // File: MyWnd.cpp // // This application demonstrates creating a window // // Copyright (c) lwm //-----------... 阅读全文
posted @ 2018-07-31 00:16 xslwm 阅读(243) 评论(0) 推荐(0) 编辑
摘要: 1 #pragma once 2 #include 3 using namespace std; 4 5 template 6 class CMyVector 7 { 8 public: 9 CMyVector() { buff = NULL; len = maxSize = 0; } 10 ~CMyVector() { _clear()... 阅读全文
posted @ 2017-12-03 17:24 xslwm 阅读(524) 评论(0) 推荐(0) 编辑
摘要: 基于C的文件操作 在ANSI C中,对文件的操作分为两种方式,即流式文件操作和I/O文件操作一、流式文件操作 1.fopen() FILE *fopen(const char *filename,const char *mode) //4996 文件通过fopen_s和 _wfopen_s打开后是不 阅读全文
posted @ 2017-08-13 22:22 xslwm 阅读(1225) 评论(0) 推荐(0) 编辑
摘要: 1 CString strSqlPath = _T("E:\\QQ\\Bin\\QQScLauncher.exe"); 2 3 int nLen = WideCharToMultiByte(CP_ACP, 0, strSqlPath, -1, NULL, 0, NULL, NULL); 4 if (nLen != 0) 5 { 6 c... 阅读全文
posted @ 2017-07-19 23:46 xslwm 阅读(160) 评论(0) 推荐(0) 编辑
摘要: //APP 里面 //1.// 此程序只能运行一次,用互斥量来判断程序是否已运行 //2. 3. 阅读全文
posted @ 2017-07-19 23:44 xslwm 阅读(209) 评论(0) 推荐(0) 编辑
摘要: 在CTestConsoleApp类中重载InitInstance()并在该函数中输入: AllocConsole(); // 开辟控制台SetConsoleTitle(_T("Debug Output")); // 设置控制台窗口标题FILE* pf; freopen_s(&pf,"CONOUT$" 阅读全文
posted @ 2017-07-19 23:18 xslwm 阅读(217) 评论(0) 推荐(0) 编辑
摘要: 1 void CMyPrntScrDlg::Screen(const char* filename) 2 { 3 //GetDC(); 4 CDC *pDC;//屏幕DC 5 pDC = CDC::FromHandle(::GetDC(NULL));//获取当前整个屏幕DC 6 int BitPerPixel = pDC->GetDeviceCaps(... 阅读全文
posted @ 2017-07-19 23:15 xslwm 阅读(584) 评论(0) 推荐(0) 编辑
摘要: 后面两个函数返回一个new的指针,接收用完后需要自己手动释放 char* 到string :直接初始化或者赋值 string到char*: const char *str = s.c_str();之后s改变,str将随之改变,所以最好将s重新拷贝一份 不允许vector初始化数组,但是可以用数组初始 阅读全文
posted @ 2017-07-14 23:09 xslwm 阅读(413) 评论(0) 推荐(0) 编辑
摘要: 设置编辑框滚动条在最新的位置 CListBox:列表框 CListCtrl:报表 //设置listCtrl的风格 //添加列 //添加行 //添加每行内容 阅读全文
posted @ 2017-07-14 23:04 xslwm 阅读(862) 评论(0) 推荐(0) 编辑
摘要: //************工作者线程**************1.在头文件中添加UINT ThreadFunc(LPVOID lpParam); 注意应在类的外部 2.添加protected型变量:CWinThread* pThread 3.添加线程处理函数:UINT ThreadFunc(LP 阅读全文
posted @ 2017-07-14 22:46 xslwm 阅读(1626) 评论(0) 推荐(0) 编辑