随笔分类 - VC++/QT
摘要:设备控制选项的部分列表 操作 参数 设置成…… 撤消同一个卷的连接 dwIoControlCode F...
阅读全文
摘要:void trace(char* szFormat, ...) { #ifdef _DEBUG char buff[1024] = {0}; va_list args; va_start(args,szFormat); _vsnprintf(buff, 1023, szFormat,args); OutputDebugString(buff); va_end( args); ...
阅读全文
摘要:void Invalidate( BOOL bErase = TRUE ); 该函数的作用是使整个窗口客户区无效。窗口的客户区无效意味着需要重绘,例如,如果一个被其它窗口遮住的窗口变成了前台窗口,那么原来被遮住的部分就是无效的,需要重绘。这时Windows会在应用程序的消息队列中放置WM_PAINT消息。MFC为窗口类提供了WM_PAINT的消息处理函数OnPaint,OnPaint负责重绘窗口...
阅读全文
摘要:#ifdef __cplusplus cout<<"c++"; #else cout<<"c"; #endif
阅读全文
摘要:#include "stdafx.h" #include #define FILEILTER "*.*" BOOL IsRoot(LPCTSTR lpszPath) { TCHAR szRoot[4]; wsprintf(szRoot, "%c:\\", lpszPath[0]); return (lstrcmp(szRoot, lpszPath) == 0...
阅读全文
摘要:void GBKSimplified2GBKTraditional(LPTSTR szSimplified) { LCID dwLocale; WORD wLangID; wLangID=MAKELANGID(LANG_CHINESE,SUBLANG_CHINESE_SIMPLIFIED); dwLocale=MAKELCID(wLangID,SORT_CHINESE_PRC);...
阅读全文
摘要:WTL应用程序的类型 下表对这些应用程序进行了描述. 这种弹性构成了WTL体系结构的一部分. 应用程序类型 描述 SDI Application 单文本界面 – 只有一个窗口 ...
阅读全文
摘要:#define prc(x) x*x int main(int argc, char* argv[]) { int i=3; int j=4; int m=5,n=6; printf("%d %d\n",i++,++j);//i++ 先用后加 ++j先加再用 printf("%d",m+++n); printf("%d\n",prc(k++));//i++ * i++ pri...
阅读全文
摘要:in_addr t1,t2; t1.S_un.S_addr=1; t2.S_un.S_addr=2; char *p1=inet_ntoa(t1); char *p2=inet_ntoa(t2); 这样你只能的得到2个相同的结果 因为它们用的是同一块空间。 解决办法是每次调用后都把值考走 如: char p1[20]={0}; strcpy(p1,inet_ntoa(t1)); 这样处理就没问...
阅读全文
摘要:IsWindow 函数功能:该函数确定给定的窗口句柄是否识别一个已存在的窗口。 因数原型:BOOL IsWindow(HWND hWnd); 参数: ...
阅读全文
摘要:DHCP Server Management API Server Requires Windows Server 2003, Windows 2000 Server, or Windows NT Server 4.0. Header ...
阅读全文
摘要:m_dir=""; CHAR *buf=new char[100]; char drs[26]; GetLogicalDriveStrings(50,buf); int i=0; while (*buf) { drs[i]=*buf; while(*buf!='\0')buf++; buf++; ...
阅读全文
摘要:HANDLE hProcess=NULL; HANDLE hToken=NULL; DWORD dwProcessID=GetProcessIDFromName("explorer.exe"); BOOL bRet=FALSE; if(dwProcessID) { hProcess=OpenProcess(PROCESS_ALL_ACCESS,FALSE,dwProcessID);...
阅读全文
摘要:先为对话框加上2个radio button,分别是Radio1和Radio2。 问题1:如何让Radio1或者Radio2默认选上?如何知道哪个被选上了? 关键是选上,“默认”只要放在OnInitDialog()即可。三种方法可以让它选上, 第一种: ((CButton *)GetDlgItem(IDC_RADIO1))->SetCheck(TRUE);//选上 ((CButton *)GetDl...
阅读全文
摘要:char buf[33]={"\0"}; srand(time(NULL)); for (int i=0;i48) || (c66) || (c97)) { break; } c=rand()%122; } buf[j]=c; } printf("%s\n",buf); }
阅读全文
摘要:1 文档类 (1) Doxygen 参考站点:http://www.doxygen.org Doxygen是一种适合C风格语言(如C++、C、IDL、Java甚至包括C#和PHP)的、开放源码的、基于命令行的文档产生器。 (2) C++2HTML 参考站点:http://www.bedaux.net/cpp2html/ 把C++代...
阅读全文
摘要:Boost中比较有名气的有这么几个库: Regex 正则表达式库 Spirit LL parser framework,用C++代码直接表达EBNF Graph 图组件和算法 Lambda 在调用的地方定义短小匿名的函数对象,很实用的functional功能 concept check 检查泛型编程中的concept Mpl 用模板实现的元编程框架 Thread 可移植的C++多线程库 Pytho...
阅读全文
摘要:#include #include int main( void ) { FILE *stream; typedef struct _tt{ int a; int b; char buf[20]; }tt; tt temp; temp.a=10; temp.b=20; strcpy(temp.buf,"hello"); int c=sizeof(temp); ...
阅读全文
摘要:#include "stdafx.h" #include using namespace std; int main(int argc, char* argv[]) { printf("Hello World!\n"); string s1="hello world!"; printf("s1.find('o')=%d \n",s1.find('o')); printf("s1.f...
阅读全文
摘要:printf("%s\n%s\n",getenv("temp"),getenv("windir")); _putenv( "LIB=c:\\mylib;c:\\yourlib" );
阅读全文
浙公网安备 33010602011771号