zoukankan      html  css  js  c++  java
  • Tools

     1. DebugView,输出调试信息(不能F5,而是要Ctrl + F5,F5输出到VC的debug窗口)

     1 void DbgPrint(char* pFMT, ...)
     2 {
     3     char szBuf[1024] = {0};
     4     va_list lst;
     5     va_start(lst, pFMT);
     6     vsprintf(szBuf, pFMT, lst);
     7     va_end(lst);
     8     
     9     OutputDebugString(szBuf);
    10 }

     2. C语言,拼接字符串

     1 //使用后要free
     2 char* split(char* a, char* b) 
     3 {  
     4     char* c = (char*)malloc(strlen(a) + strlen(b) + 1);
     5     if (c == NULL) 
     6     {
     7         return NULL;
     8     }
     9     
    10     char* tempc = c;
    11     while (*a != '') 
    12     {  
    13         *tempc++ = *a++;  
    14     }  
    15     while ((*tempc++ = *b++) != '');
    16     
    17     return c;
    18 }

     3. 响应 WM_DROPFILES 消息(#define WM_DROPFILES 0x0233)

    1)MFC版

     1 void CTestDlg::OnDropFiles(HDROP hDropInfo) 
     2 {
     3     char szPath[MAX_PATH] = {0};
     4     
     5     DragQueryFile(hDropInfo, NULL, szPath, sizeof(szPath) / sizeof(*szPath));
     6     DragFinish(hDropInfo);
     7     
     8     SetDlgItemText(IDC_EDT_PATH, szPath);
     9 
    10     CDialog::OnDropFiles(hDropInfo);
    11 }

     2)SDK版

     1 case WM_DROPFILES:
     2 {
     3     char szPath[MAX_PATH] = {0};
     4 
     5     DragQueryFileA((HDROP)wParam, NULL, szPath, sizeof(szPath) / sizeof(*szPath));
     6     DragFinish((HDROP)wParam);
     7 
     8     HWND hEdit = GetDlgItem(hwnd, IDC_EDT_PATH);
     9     SetWindowTextA(hEdit, szPath);
    10     
    11     break;
    12 }
  • 相关阅读:
    node分离路由文件
    node项目搭建步骤
    在express获取POST(类似表单请求)的数据
    10分钟搭建Kubernetes容器集群平台(kubeadm)
    今日考题
    jQuery方法介绍
    JQuery练习题
    今日面试题:
    bom操作,事件与jquery
    今日理解之js
  • 原文地址:https://www.cnblogs.com/luzhiyuan/p/4361889.html
Copyright © 2011-2022 走看看