简单的 win32对话框程序 c++ 模式对话框 非模式对话框
摘要:模式对话框程序:LRESULT CALLBACK DialogProc(HWND hWnd,UINT uMsg,WPARAM wParam,LPARAM lParam) { switch(uMsg) { case WM_INITDIALOG: //MoveWindow(hWnd,100,100,500,300,FALSE); SetWindowPos(hWnd,NULL,200,200,0,0,SWP_NOSIZE); return TRUE; // 表示已经初始化 case WM_COMMAND: if(LO...
阅读全文
posted @
2012-03-14 17:58
2-3^
阅读(1817)
推荐(0)
字符串指针在 VC 中的应用
摘要:本文讨论 char* 和 wchar_t* 在 VC2010 中的应用。char* 和 wchar_t* 字符串的定义、合并、拆分、查找等合并:char *a,*b,*ab;a = "123 ";b = "456 ";int nLen = strlen(a) + strlen(b);ab = new char[nLen+1];memset(d, 0, nLen+1);strcat(ab, a);strcat(ab, b);ab[nLen] = '\0 ';printf( "%s ", ab);delete []ab;c
阅读全文
posted @
2011-03-03 22:02
2-3^
阅读(368)
推荐(0)
动态多维数组在 VC 中的应用
摘要:怎样给多维数组动态分配内存//Allocate:int **p = new int* [m];for(int i = 0 ; i < m ; i++) p[i] = new int[n];//Use:for(int i = 0 ; i < m; i++) for(int j = 0 ; j < n ; j++) p[i][j] = i * j;//Free:for(int i = 0 ; i < m ; i++) delete[] p[i];delete[] p;1. 演示形为int[2][3]的二维动态数组///////////////////////////////
阅读全文
posted @
2011-02-28 23:12
2-3^
阅读(584)
推荐(0)