
VC
文章平均质量分 64
杜冰
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
CSTRING转char *\\char *转CSTRING 乱码问题
CString st=_T("123");int nLength = st.GetLength();int nBytes = WideCharToMultiByte(CP_ACP,0,st,nLength,NULL,0,NULL,NULL);char* path1 = new char[ nBytes + 1];memset(path1,0,nLength + 1);WideC原创 2014-11-09 14:53:54 · 504 阅读 · 0 评论 -
MFC 重绘函数
void CDialogDiagnose::OnPaint(){ CPaintDC dc(this); // device context for painting // TODO: 在此处添加消息处理程序代码 CDC MemDC; MemDC.CreateCompatibleDC (&dc); CBitmap *pOldBmp; pOldBmp = MemDC.Se转载 2015-06-25 16:27:41 · 539 阅读 · 0 评论 -
C_C++变量命名规则
1、 变量名只能是字母(A-Z,a-z)和数字(0-9)或者下划线(_)组成。2、 第一个字母必须是字母或者下划线开头。3、 不能使用C++关键字来命名变量,以免冲突。4、 变量名区分大小写。 变量命名规则:一、 用最短字符表示最准确的意义。二、 使用变量前缀。1、 整型前缀int n转载 2015-06-19 16:01:28 · 454 阅读 · 0 评论 -
VC区域重绘判定圆点
区域重绘 RECT stRect; pThis->m_ceItemInfo.GetWindowRect(&stRect); pThis->m_ceItemInfo.GetParent()->ScreenToClient(&stRect); pThis->m_ceItemInfo.GetParent()->InvalidateRect(&stRect, true); 判断圆原创 2015-06-19 16:19:32 · 341 阅读 · 0 评论 -
封装按钮
// SkinButton.cpp : 实现文件//#include "stdafx.h"#include "project.h"#include "SkinButton.h"// SkinButtonIMPLEMENT_DYNAMIC(SkinButton, CButton)SkinButton::SkinButton(){ m_bMouseLeave =转载 2015-04-28 15:58:30 · 396 阅读 · 0 评论 -
ADO 操作 数据库
#include "StdAfx.h"#include "Ado.h"#include #include using namespace std;CAdo::CAdo(void){if (!SUCCEEDED(::CoInitialize(NULL))){MessageBox(NULL, _T("初始化COM失败!!!"), _T("text"), MB_OK);}// or afxoleinit转载 2015-04-28 15:54:52 · 268 阅读 · 0 评论 -
ADO操作数据库
#include "StdAfx.h"#include "Ado.h"#include #include using namespace std;CAdo::CAdo(void){if (!SUCCEEDED(::CoInitialize(NULL))){MessageBox(NULL, _T("初始化COM失败!!!"), _T("text"), MB_OK);}// or afxoleinit转载 2015-04-28 15:53:42 · 294 阅读 · 0 评论 -
多线程CreateThread函数的用法及注意事项
当使用CreateProcess调用时,系统将创建一个进程和一个主线程。CreateThread将在主线程的基础上创建一个新线程,大致做如下步骤: 1在内核对象中分配一个线程标识/句柄,可供管理,由CreateThread返回 2把线程退出码置为STILL_ACTIVE,把线程挂起计数置1 3分配context结构 4分配两页的物理存储以准备栈,保护页设置为PAGE_REA转载 2015-04-25 11:29:11 · 335 阅读 · 0 评论 -
各种数据转换::::转载
本人并未对以下所有方法进行测试,仅仅是为了给大家一个参考。 Unicode(统一码、万国码、单一码)是一种在计算机上使用的字符编码。它为每种语言中的每个字符设定了统一并且唯一的二进制编码,以满足跨语言、跨平台进行文本转换、处理的要求。1990年开始研发,1994年正式公布。随着计算机工作能力的增强,Unicode也在面世以来的十多年里得到普及。在非 Unicode 环境下,由于不同国家转载 2015-04-24 09:42:40 · 450 阅读 · 0 评论 -
VC DEVICE插拔消息
WM_DEVICECHANGE消息 电脑或者DEVICE配置发生改变,反馈给应用程序wParam Event that has occurred. This parameter can be one of the following values from the Dbt.h header file.ValueMeaningDBT_CONFIGCHA转载 2015-04-20 11:38:18 · 468 阅读 · 0 评论 -
VC 判断系统是否进入睡眠模式
LRESULT CALLBACK WindowProc( HWND hwnd, // handle to window UINT uMsg, // WM_POWER WPARAM wParam, // power-management event LPARAM lParam // function-specific data);转载 2015-04-20 11:23:39 · 421 阅读 · 0 评论 -
使用API创建窗口
// 新建一个窗口,其消息循环负责处理BYHX消息,有状态改变时直接Post到界面 HWND parent_hWnd =(HWND)pPrinter->m_byhxHandle;//GetForegroundWindow(); HINSTANCE parent_hInst =GetModuleHandle(NULL); WNDCLASSEX wcex0 ={ sizeof(WNDC原创 2014-12-04 10:28:29 · 295 阅读 · 0 评论 -
标准C++读写文件
{char *my1= (char *)malloc(10);ifstream mys;ofstream my;my.open("1.txt");my.write("10101",5);my.close();mys.open("1.txt",ios::in);mys.getline(my1,6);printf(my1);mys.close();//原创 2014-12-01 22:09:39 · 412 阅读 · 0 评论 -
MFC 下使用COM
// 44Dlg.cpp : 实现文件//#include "stdafx.h"#include "44.h"#include "44Dlg.h"#include "afxsock.h"#include "C:\Users\Dick\Desktop\新建文件夹\COM001\COM001\COM001_i.h"#include "C:\Users\Dick\De原创 2014-12-01 21:54:41 · 563 阅读 · 0 评论 -
邮槽--进程间通信
发送端// mail2.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include "windows.h"#include "stdio.h"int _tmain(int argc, _TCHAR* argv[]){char szMailAddr[]="\\\\.\\mailslot\\mymails";i原创 2014-12-01 22:36:32 · 384 阅读 · 0 评论 -
STL之LIST使用
// List.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include "stdlib.h"#define NULL 0#define TYPE struct stu#define LEN sizeof(struct stu)struct stu{int num;int age;struct stu *ne原创 2014-12-01 22:12:04 · 288 阅读 · 0 评论 -
va_list va_start cfindfile遍历文件
=================================================================CFileFind findfile; bool work = findfile.FindFile(L"C:\\*",0); int i = 0; while (work) { work = findfile.FindNextFile()原创 2014-11-14 15:27:49 · 309 阅读 · 0 评论 -
VC透掉背景色
//透掉背景色 //CBitmap m_bit; //m_bit.LoadBitmap(strBmpPath); //HBITMAP bBit = (HBITMAP)m_bit.m_hObject; //if (GetObjectType(bBit) == OBJ_BITMAP) //{ // CSize csBitmap = GetBitmapSize(bBit);原创 2015-07-06 14:44:46 · 386 阅读 · 0 评论