VC common knowledge

xiaoxiao2021-03-06  79

1: Get the system time dates (using getLocaltime) CString Stime, Syear, SMONTH, SDAY; SystemTime Curtime; getLocalTime (& Curtime); Syar.Format ("% D years", curtime.wyear); smonth.format ("% D Month) ", Curtime.wmonth; sday.format ("% d day ", curtime.wday; stime = syear smhood sday; // curtime.wHour // curtime.wminute // curtime.wSecond IBM AFXMESSAGEBOX (STIME) ; 2: Separation string CString str = "4D3F0A2278"; Unsigned char A [12]; long x; for (int i = 0; I <(str.getLength () / 2); i ) {SSCANF (Str.MID (2 * i, 2), "% x", & x); A [i] = x;} 3: get the current directory (getCurrentDirectory) char Curpath [max_path]; dword size = max_path; getCurrentDirectory (Size, Curpath); AFXMessageBox (Curpath); // cstring number; int Len = lineLength; lPtstr P = Number.getBuffer (LEN); this-> getLine (0, p, len); afxMessageBox (Number); get system GetSystemDirectory 4: Extract digital CString Strnum; CString STR ("test 125 countries 87kk"); Strnum = getStr (STR); AFXMessageBox (Strnum); 5: Create a Molding dialog CDLG_Test * aa = New CDLG_Test; AA-> Create (IDD_DIALOG1, NULL); AA-> ShowWindow (sw_show); 6: Get window absolute coordinate CString Strnum, S TRNUM1; CRNUM1; GetClientRect (& Rect); Strnum.format ("x:% D", Rect.top); strnum1.format ("Y:% D", Rect.Left); strnum = strnum Strnum1; AFXMessageBox (Strnum); 7: Copy folder ShfileOpstruct op; char frombuf [] = "e: // Temp / 0"; char tobuf [] = "sintekserver // personal document // 陈伟 / 0"; ; Op.hwnd = NULL; Op.wFunc = FO_COPY; Op.pFrom = FromBuf; Op.pTo = ToBuf; Op.fFlags = FOF_NOCONFIRMATION | FOF_RENAMEONCOLLISION; Op.fAnyOperationsAborted = FALSE; Op.hNameMappings = NULL; Op.lpszProgressTitle = NULL ; if (SHFILEOPERATION (& OP) ==

转载请注明原文地址:https://www.9cbs.com/read-92870.html

New Post(0)