爆款云主机2核4G限时秒杀,88元/年起!
查看详情

活动

天翼云最新优惠活动,涵盖免费试用,产品折扣等,助您降本增效!
热门活动
  • 618智算钜惠季 爆款云主机2核4G限时秒杀,88元/年起!
  • 免费体验DeepSeek,上天翼云息壤 NEW 新老用户均可免费体验2500万Tokens,限时两周
  • 云上钜惠 HOT 爆款云主机全场特惠,更有万元锦鲤券等你来领!
  • 算力套餐 HOT 让算力触手可及
  • 天翼云脑AOne NEW 连接、保护、办公,All-in-One!
  • 中小企业应用上云专场 产品组合下单即享折上9折起,助力企业快速上云
  • 息壤高校钜惠活动 NEW 天翼云息壤杯高校AI大赛,数款产品享受线上订购超值特惠
  • 天翼云电脑专场 HOT 移动办公新选择,爆款4核8G畅享1年3.5折起,快来抢购!
  • 天翼云奖励推广计划 加入成为云推官,推荐新用户注册下单得现金奖励
免费活动
  • 免费试用中心 HOT 多款云产品免费试用,快来开启云上之旅
  • 天翼云用户体验官 NEW 您的洞察,重塑科技边界

智算服务

打造统一的产品能力,实现算网调度、训练推理、技术架构、资源管理一体化智算服务
智算云(DeepSeek专区)
科研助手
  • 算力商城
  • 应用商城
  • 开发机
  • 并行计算
算力互联调度平台
  • 应用市场
  • 算力市场
  • 算力调度推荐
一站式智算服务平台
  • 模型广场
  • 体验中心
  • 服务接入
智算一体机
  • 智算一体机
大模型
  • DeepSeek-R1-昇腾版(671B)
  • DeepSeek-R1-英伟达版(671B)
  • DeepSeek-V3-昇腾版(671B)
  • DeepSeek-R1-Distill-Llama-70B
  • DeepSeek-R1-Distill-Qwen-32B
  • Qwen2-72B-Instruct
  • StableDiffusion-V2.1
  • TeleChat-12B

应用商城

天翼云精选行业优秀合作伙伴及千余款商品,提供一站式云上应用服务
进入甄选商城进入云市场创新解决方案
办公协同
  • WPS云文档
  • 安全邮箱
  • EMM手机管家
  • 智能商业平台
财务管理
  • 工资条
  • 税务风控云
企业应用
  • 翼信息化运维服务
  • 翼视频云归档解决方案
工业能源
  • 智慧工厂_生产流程管理解决方案
  • 智慧工地
建站工具
  • SSL证书
  • 新域名服务
网络工具
  • 翼云加速
灾备迁移
  • 云管家2.0
  • 翼备份
资源管理
  • 全栈混合云敏捷版(软件)
  • 全栈混合云敏捷版(一体机)
行业应用
  • 翼电子教室
  • 翼智慧显示一体化解决方案

合作伙伴

天翼云携手合作伙伴,共创云上生态,合作共赢
天翼云生态合作中心
  • 天翼云生态合作中心
天翼云渠道合作伙伴
  • 天翼云代理渠道合作伙伴
天翼云服务合作伙伴
  • 天翼云集成商交付能力认证
天翼云应用合作伙伴
  • 天翼云云市场合作伙伴
  • 天翼云甄选商城合作伙伴
天翼云技术合作伙伴
  • 天翼云OpenAPI中心
  • 天翼云EasyCoding平台
天翼云培训认证
  • 天翼云学堂
  • 天翼云市场商学院
天翼云合作计划
  • 云汇计划
天翼云东升计划
  • 适配中心
  • 东升计划
  • 适配互认证

开发者

开发者相关功能入口汇聚
技术社区
  • 专栏文章
  • 互动问答
  • 技术视频
资源与工具
  • OpenAPI中心
开放能力
  • EasyCoding敏捷开发平台
培训与认证
  • 天翼云学堂
  • 天翼云认证
魔乐社区
  • 魔乐社区

支持与服务

为您提供全方位支持与服务,全流程技术保障,助您轻松上云,安全无忧
文档与工具
  • 文档中心
  • 新手上云
  • 自助服务
  • OpenAPI中心
定价
  • 价格计算器
  • 定价策略
基础服务
  • 售前咨询
  • 在线支持
  • 在线支持
  • 工单服务
  • 建议与反馈
  • 用户体验官
  • 服务保障
  • 客户公告
  • 会员中心
增值服务
  • 红心服务
  • 首保服务
  • 客户支持计划
  • 专家技术服务
  • 备案管家

了解天翼云

天翼云秉承央企使命,致力于成为数字经济主力军,投身科技强国伟大事业,为用户提供安全、普惠云服务
品牌介绍
  • 关于天翼云
  • 智算云
  • 天翼云4.0
  • 新闻资讯
  • 天翼云APP
基础设施
  • 全球基础设施
  • 信任中心
最佳实践
  • 精选案例
  • 超级探访
  • 云杂志
  • 分析师和白皮书
  • 天翼云·创新直播间
市场活动
  • 2025智能云生态大会
  • 2024智算云生态大会
  • 2023云生态大会
  • 2022云生态大会
  • 天翼云中国行
天翼云
  • 活动
  • 智算服务
  • 产品
  • 解决方案
  • 应用商城
  • 合作伙伴
  • 开发者
  • 支持与服务
  • 了解天翼云
      • 文档
      • 控制中心
      • 备案
      • 管理中心

      VC6 TRACE宏的学习

      首页 知识中心 其他 文章详情页

      VC6 TRACE宏的学习

      2024-12-24 10:24:41 阅读次数:29

      amp,lt,NULL

      一,各宏定义如下:
      #ifdef _DEBUG
      #define TRACE              ::AfxTrace
      #define TRACE0(sz)              ::AfxTrace(_T("%s"), _T(sz))
      #define TRACE1(sz, p1)          ::AfxTrace(_T(sz), p1)
      #define TRACE2(sz, p1, p2)      ::AfxTrace(_T(sz), p1, p2)
      #define TRACE3(sz, p1, p2, p3)  ::AfxTrace(_T(sz), p1, p2, p3)
      #else
      inline void AFX_CDECL AfxTrace(LPCTSTR, ...) { }
      #define TRACE              1 ? (void)0 : ::AfxTrace
      #define TRACE0(sz)
      #define TRACE1(sz, p1)
      #define TRACE2(sz, p1, p2)
      #define TRACE3(sz, p1, p2, p3)
      #endif
       
      二. 调试输出的核心函数
      MFC调试输出的核心函数是AfxTrace,其代码如下:
      #ifdef _DEBUG   // entire file
      #ifdef AFX_AUX_SEG
      #pragma code_seg(AFX_AUX_SEG)
      #endif
      #ifdef _DEBUG
      #undef THIS_FILE
      static char THIS_FILE[] = __FILE__;
      #endif
      /
      // Helper routines that can be called from debugger
      void AFXAPI AfxDump(const CObject* pOb)
      {
       afxDump << pOb;
      }
      /
      // Diagnostic Trace
      void AFX_CDECL AfxTrace(LPCTSTR lpszFormat, ...)
      {
      #ifdef _DEBUG // all AfxTrace output is controlled by afxTraceEnabled
       if (!afxTraceEnabled)
        return;
      #endif
       va_list args;
       va_start(args, lpszFormat);
       int nBuf;
       TCHAR szBuffer[512];
       nBuf = _vsntprintf(szBuffer, _countof(szBuffer), lpszFormat, args);
       // was there an error? was the expanded string too long?
       ASSERT(nBuf >= 0);
       if ((afxTraceFlags & traceMultiApp) && (AfxGetApp() != NULL))
        afxDump << AfxGetApp()->m_pszExeName << ": ";
        afxDump << szBuffer;
       va_end(args);
      }
      #endif //_DEBUG
       
      三 全局DumpDC
      AFX_DATADEF CDumpContext afxDump;
       
      四. CDumpContext类接口
       
      class CDumpContext
      {
      public:
       CDumpContext(CFile* pFile = NULL);
      // Attributes
       int GetDepth() const;      // 0 => this object, 1 => children objects
       void SetDepth(int nNewDepth);
      // Operations
       CDumpContext& operator<<(LPCTSTR lpsz);
      #ifdef _UNICODE
       CDumpContext& operator<<(LPCSTR lpsz);  // automatically widened
      #else
       CDumpContext& operator<<(LPCWSTR lpsz); // automatically thinned
      #endif
       CDumpContext& operator<<(const void* lp);
       CDumpContext& operator<<(const CObject* pOb);
       CDumpContext& operator<<(const CObject& ob);
       CDumpContext& operator<<(BYTE by);
       CDumpContext& operator<<(WORD w);
       CDumpContext& operator<<(UINT u);
       CDumpContext& operator<<(LONG l);
       CDumpContext& operator<<(DWORD dw);
       CDumpContext& operator<<(float f);
       CDumpContext& operator<<(double d);
       CDumpContext& operator<<(int n);
       void HexDump(LPCTSTR lpszLine, BYTE* pby, int nBytes, int nWidth);
       void Flush();
      // Implementation
      protected:
       // dump context objects cannot be copied or assigned
       CDumpContext(const CDumpContext& dcSrc);
       void operator=(const CDumpContext& dcSrc);
       void OutputString(LPCTSTR lpsz);
       int m_nDepth;
      public:
       CFile* m_pFile;
      };
       
      void CDumpContext::HexDump(LPCTSTR lpszLine, BYTE* pby,
       int nBytes, int nWidth)
      // do a simple hex-dump (8 per line) to a CDumpContext
      //  the "lpszLine" is a string to print at the start of each line
      //    (%lx should be used to expand the current address)
      {
       ASSERT(nBytes > 0);
       ASSERT(nWidth > 0);
       ASSERT(AfxIsValidString(lpszLine));
       ASSERT(AfxIsValidAddress(pby, nBytes, FALSE));
      #ifdef _DEBUG // all CDumpContext output is controlled by afxTraceEnabled
       if (!afxTraceEnabled)
        return;
      #endif //_DEBUG
       int nRow = 0;
       TCHAR szBuffer[32];
       while (nBytes--)
       {
        if (nRow == 0)
        {
         wsprintf(szBuffer, lpszLine, pby);
         *this << szBuffer;
        }
        wsprintf(szBuffer, _T(" %02X"), *pby++);
        *this << szBuffer;
        if (++nRow >= nWidth)
        {
         *this << _T("/n");
         nRow = 0;
        }
       }
       if (nRow != 0)
        *this << _T("/n");
      }
      /
      #ifdef _UNICODE
      // special version for ANSI characters
      CDumpContext& CDumpContext::operator<<(LPCSTR lpsz)
      {
       if (lpsz == NULL)
       {
        OutputString(L"(NULL)");
        return *this;
       }
      #ifdef _DEBUG // all CDumpContext output is controlled by afxTraceEnabled
       if (!afxTraceEnabled)
        return *this;
      #endif //_DEBUG
       // limited length
       TCHAR szBuffer[512];
       _mbstowcsz(szBuffer, lpsz, _countof(szBuffer));
       return *this << szBuffer;
      }
       
      CDumpContext& CDumpContext::operator<<(LPCTSTR lpsz)
      {
       if (lpsz == NULL)
       {
        OutputString(_T("(NULL)"));
        return *this;
       }
      #ifdef _DEBUG // all CDumpContext output is controlled by afxTraceEnabled
       if (!afxTraceEnabled)
        return *this;
      #endif //_DEBUG
       if (m_pFile == NULL)
       {
        TCHAR szBuffer[512];
        LPTSTR lpBuf = szBuffer;
        while (*lpsz != '/0')
        {
         if (lpBuf > szBuffer + _countof(szBuffer) - 3)
         {
          *lpBuf = '/0';
          OutputString(szBuffer);
          lpBuf = szBuffer;
         }
         if (*lpsz == '/n')
          *lpBuf++ = '/r';
         *lpBuf++ = *lpsz++;
        }
        *lpBuf = '/0';
        OutputString(szBuffer);
        return *this;
       }
       m_pFile->Write(lpsz, lstrlen(lpsz)*sizeof(TCHAR));
       return *this;
      }
       
      void CDumpContext::Flush()
      {
       if (m_pFile)
        m_pFile->Flush();
      }
      void CDumpContext::OutputString(LPCTSTR lpsz)
      {
      #ifdef _DEBUG
       // all CDumpContext output is controlled by afxTraceEnabled
       if (!afxTraceEnabled)
        return;
      #endif
       // use C-runtime/OutputDebugString when m_pFile is NULL
       if (m_pFile == NULL)
       {
        AfxOutputDebugString(lpsz);
        return;
       }
       // otherwise, write the string to the file
       m_pFile->Write(lpsz, lstrlen(lpsz)*sizeof(TCHAR));
      }
       
      五 AfxOutputDebugString宏
      #ifdef _UNICODE
      #define AfxOutputDebugString(lpsz) /
       do /
       { /
        USES_CONVERSION; /
        _RPT0(_CRT_WARN, W2CA(lpsz)); /
       } while (0)
      #else
      #define AfxOutputDebugString(lpsz) _RPT0(_CRT_WARN, lpsz)
      #endif
       
      #ifdef _DEBUG
      #define _RPT0(rptno, msg) /
              do { if ((1 == _CrtDbgReport(rptno, NULL, 0, NULL, "%s", msg))) /
                      _CrtDbgBreak(); } while (0)
      #endif
       
      六 进入CRT
       
      _CRTIMP int __cdecl _CrtDbgReport(
              int nRptType,
              const char * szFile,
              int nLine,
              const char * szModule,
              const char * szFormat,
              ...
              )
      {
              int retval;
              va_list arglist;
              char szLineMessage[MAX_MSG] = {0};
              char szOutMessage[MAX_MSG] = {0};
              char szUserMessage[MAX_MSG] = {0};
              #define ASSERTINTRO1 "Assertion failed: "
              #define ASSERTINTRO2 "Assertion failed!"
              va_start(arglist, szFormat);
              if (nRptType < 0 || nRptType >= _CRT_ERRCNT)
                  return -1;
              /*
               * handle the (hopefully rare) case of
               *
               * 1) ASSERT while already dealing with an ASSERT
               *      or
               * 2) two threads asserting at the same time
               */
              if (_CRT_ASSERT == nRptType && _CrtInterlockedIncrement(&_crtAssertBusy) > 0)
              {
                  /* use only 'safe' functions -- must not assert in here! */
      #ifdef _WIN32
                  static int (APIENTRY *pfnwsprintfA)(LPSTR, LPCSTR, ...) = NULL;
                  if (NULL == pfnwsprintfA)
                  {
                      HANDLE hlib = LoadLibrary("user32.dll");
                      if (NULL == hlib || NULL == (pfnwsprintfA =
                                  (int (APIENTRY *)(LPSTR, LPCSTR, ...))
                                  GetProcAddress(hlib, "wsprintfA")))
                          return -1;
                  }
                  (*pfnwsprintfA)( szOutMessage,
                      "Second Chance Assertion Failed: File %s, Line %d/n",
                      szFile, nLine);
                  OutputDebugString(szOutMessage);
      #else  /* _WIN32 */
                  strcpy(szOutMessage, "Second Chance Assertion Failed: File ");
                  strcat(szOutMessage, szFile);
                  strcat(szOutMessage, ", Line ");
                  numtostring(nLine, &szOutMessage[strlen(szOutMessage)]);
                  strcat(szOutMessage, "/n");
                  _CrtOutputDebugString(szOutMessage);
      #endif  /* _WIN32 */
                  _CrtInterlockedDecrement(&_crtAssertBusy);
                  _CrtDbgBreak();
                  return -1;
              }
              if (szFormat && _vsnprintf(szUserMessage,
                             MAX_MSG-max(sizeof(ASSERTINTRO1),sizeof(ASSERTINTRO2)),
                             szFormat,
                             arglist) < 0)
                  strcpy(szUserMessage, TOOLONGMSG);
              if (_CRT_ASSERT == nRptType)
                  strcpy(szLineMessage, szFormat ? ASSERTINTRO1 : ASSERTINTRO2);
              strcat(szLineMessage, szUserMessage);
              if (_CRT_ASSERT == nRptType)
              {
                  if (_CrtDbgMode[nRptType] & _CRTDBG_MODE_FILE)
                      strcat(szLineMessage, "/r");
                  strcat(szLineMessage, "/n");
              }
              if (szFile)
              {
                  if (_snprintf(szOutMessage, MAX_MSG, "%s(%d) : %s",
                      szFile, nLine, szLineMessage) < 0)
                  strcpy(szOutMessage, TOOLONGMSG);
              }
              else
                  strcpy(szOutMessage, szLineMessage);
              /* user hook may handle report */
              if (_pfnReportHook && (*_pfnReportHook)(nRptType, szOutMessage, &retval))
              {
                  if (_CRT_ASSERT == nRptType)
                      _CrtInterlockedDecrement(&_crtAssertBusy);
                  return retval;
              }
              if (_CrtDbgMode[nRptType] & _CRTDBG_MODE_FILE)
              {
                  if (_CrtDbgFile[nRptType] != _CRTDBG_INVALID_HFILE)
                  {
      #ifdef _WIN32
                      DWORD written;
                      WriteFile(_CrtDbgFile[nRptType], szOutMessage, strlen(szOutMessage), &written, NULL);
      #else  /* _WIN32 */
                      long written = strlen(szOutMessage);
                      FSWrite((short)_CrtDbgFile[nRptType], &written, szOutMessage);
      #endif  /* _WIN32 */
                  }
              }
              if (_CrtDbgMode[nRptType] & _CRTDBG_MODE_DEBUG)
              {
      #ifdef _WIN32
                  OutputDebugString(szOutMessage);
      #else  /* _WIN32 */
                  _CrtOutputDebugString(szOutMessage);
      #endif  /* _WIN32 */
              }
              if (_CrtDbgMode[nRptType] & _CRTDBG_MODE_WNDW)
              {
                  char szLine[20];
                  retval = CrtMessageWindow(nRptType, szFile, nLine ? _itoa(nLine, szLine, 10) : NULL, szModule, szUserMessage);
                  if (_CRT_ASSERT == nRptType)
                      _CrtInterlockedDecrement(&_crtAssertBusy);
                  return retval;
              }
              if (_CRT_ASSERT == nRptType)
                  _CrtInterlockedDecrement(&_crtAssertBusy);
              /* ignore */
              return FALSE;
      }
      七 REACTOS中的OutputDebugStringA
      VOID
      WINAPI
      OutputDebugStringA(LPCSTR _OutputString)
      {
       _SEH2_TRY
       {
        ULONG_PTR a_nArgs[2];
        a_nArgs[0] = (ULONG_PTR)(strlen(_OutputString) + 1);
        a_nArgs[1] = (ULONG_PTR)_OutputString;
        /* send the string to the user-mode debugger */
        RaiseException(DBG_PRINTEXCEPTION_C, 0, 2, a_nArgs);
       }
       _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
       {
        /* no user-mode debugger: try the systemwide debug message monitor, or the
           kernel debugger as a last resort */
        /* mutex used to synchronize invocations of OutputDebugString */
        static HANDLE s_hDBMonMutex = NULL;
        /* true if we already attempted to open/create the mutex */
        static BOOL s_bDBMonMutexTriedOpen = FALSE;
        /* local copy of the mutex handle */
        volatile HANDLE hDBMonMutex = s_hDBMonMutex;
        /* handle to the Section of the shared buffer */
        volatile HANDLE hDBMonBuffer = NULL;
        /* pointer to the mapped view of the shared buffer. It consist of the current
           process id followed by the message string */
        struct { DWORD ProcessId; CHAR Buffer[1]; } * pDBMonBuffer = NULL;
        /* event: signaled by the debug message monitor when OutputDebugString can write
           to the shared buffer */
        volatile HANDLE hDBMonBufferReady = NULL;
        /* event: to be signaled by OutputDebugString when it's done writing to the
           shared buffer */
        volatile HANDLE hDBMonDataReady = NULL;
        /* mutex not opened, and no previous attempts to open/create it */
        if(hDBMonMutex == NULL && !s_bDBMonMutexTriedOpen)
        {
         /* open/create the mutex */
         hDBMonMutex = K32CreateDBMonMutex();
         /* store the handle */
         s_hDBMonMutex = hDBMonMutex;
        }
        _SEH2_TRY
        {
         volatile PCHAR a_cBuffer = NULL;
         /* opening the mutex failed */
         if(hDBMonMutex == NULL)
         {
          /* remember next time */
          s_bDBMonMutexTriedOpen = TRUE;
         }
         /* opening the mutex succeeded */
         else
         {
          do
          {
           /* synchronize with other invocations of OutputDebugString */
           WaitForSingleObject(hDBMonMutex, INFINITE);
           /* buffer of the system-wide debug message monitor */
           hDBMonBuffer = OpenFileMappingW(SECTION_MAP_WRITE, FALSE, L"DBWIN_BUFFER");
           /* couldn't open the buffer: send the string to the kernel debugger */
           if(hDBMonBuffer == NULL) break;
           /* map the buffer */
           pDBMonBuffer = MapViewOfFile(hDBMonBuffer,
                   SECTION_MAP_READ | SECTION_MAP_WRITE,
                   0,
                   0,
                   0);
           /* couldn't map the buffer: send the string to the kernel debugger */
           if(pDBMonBuffer == NULL) break;
           /* open the event signaling that the buffer can be accessed */
           hDBMonBufferReady = OpenEventW(SYNCHRONIZE, FALSE, L"DBWIN_BUFFER_READY");
           /* couldn't open the event: send the string to the kernel debugger */
           if(hDBMonBufferReady == NULL) break;
           /* open the event to be signaled when the buffer has been filled */
           hDBMonDataReady = OpenEventW(EVENT_MODIFY_STATE, FALSE, L"DBWIN_DATA_READY");
          }
          while(0);
          /* we couldn't connect to the system-wide debug message monitor: send the
             string to the kernel debugger */
          if(hDBMonDataReady == NULL) ReleaseMutex(hDBMonMutex);
         }
         _SEH2_TRY
         {
          /* size of the current output block */
          volatile SIZE_T nRoundLen;
          /* size of the remainder of the string */
          volatile SIZE_T nOutputStringLen;
          /* output the whole string */
          nOutputStringLen = strlen(_OutputString);
          do
          {
           /* we're connected to the debug monitor:
              write the current block to the shared buffer */
           if(hDBMonDataReady)
           {
            /* wait a maximum of 10 seconds for the debug monitor
               to finish processing the shared buffer */
            if(WaitForSingleObject(hDBMonBufferReady, 10000) != WAIT_OBJECT_0)
            {
             /* timeout or failure: give up */
             break;
            }
            /* write the process id into the buffer */
            pDBMonBuffer->ProcessId = GetCurrentProcessId();
            /* write only as many bytes as they fit in the buffer */
            if(nOutputStringLen > (PAGE_SIZE - sizeof(DWORD) - 1))
             nRoundLen = PAGE_SIZE - sizeof(DWORD) - 1;
            else
             nRoundLen = nOutputStringLen;
            /* copy the current block into the buffer */
            memcpy(pDBMonBuffer->Buffer, _OutputString, nRoundLen);
            /* null-terminate the current block */
            pDBMonBuffer->Buffer[nRoundLen] = 0;
            /* signal that the data contains meaningful data and can be read */
            SetEvent(hDBMonDataReady);
           }
           /* else, send the current block to the kernel debugger */
           else
           {
            /* output in blocks of 512 characters */
            a_cBuffer = (CHAR*)HeapAlloc(GetProcessHeap(), 0, 512);
            if (!a_cBuffer)
            {
             DbgPrint("OutputDebugStringA: Failed/n");
             break;
            }
            /* write a maximum of 511 bytes */
            if(nOutputStringLen > 510)
             nRoundLen = 510;
            else
             nRoundLen = nOutputStringLen;
            /* copy the current block */
            memcpy(a_cBuffer, _OutputString, nRoundLen);
            /* null-terminate the current block */
            a_cBuffer[nRoundLen] = 0;
            /* send the current block to the kernel debugger */
             DbgPrint("%s", a_cBuffer);
            if (a_cBuffer)
            {
             HeapFree(GetProcessHeap(), 0, a_cBuffer);
             a_cBuffer = NULL;
            }
           }
           /* move to the next block */
           _OutputString += nRoundLen;
           nOutputStringLen -= nRoundLen;
          }
          /* repeat until the string has been fully output */
          while (nOutputStringLen > 0);
         }
         /* ignore access violations and let other exceptions fall through */
         _SEH2_EXCEPT((_SEH2_GetExceptionCode() == STATUS_ACCESS_VIOLATION) ? EXCEPTION_EXECUTE_HANDLER : EXCEPTION_CONTINUE_SEARCH)
         {
          if (a_cBuffer)
           HeapFree(GetProcessHeap(), 0, a_cBuffer);
          /* string copied verbatim from Microsoft's kernel32.dll */
          DbgPrint("/nOutputDebugString faulted during output/n");
         }
         _SEH2_END;
        }
        _SEH2_FINALLY
        {
         /* close all the still open resources */
         if(hDBMonBufferReady) CloseHandle(hDBMonBufferReady);
         if(pDBMonBuffer) UnmapViewOfFile(pDBMonBuffer);
         if(hDBMonBuffer) CloseHandle(hDBMonBuffer);
         if(hDBMonDataReady) CloseHandle(hDBMonDataReady);
         /* leave the critical section */
         if(hDBMonDataReady != NULL)
          ReleaseMutex(hDBMonMutex);
        }
        _SEH2_END;
       }
       _SEH2_END;
      }
      VC6 TRACE宏的学习
      版权声明:本文内容来自第三方投稿或授权转载,原文地址:https://blog.csdn.net/joshua0137/article/details/4465669,作者:捕鲸叉,版权归原作者所有。本网站转在其作品的目的在于传递更多信息,不拥有版权,亦不承担相应法律责任。如因作品内容、版权等问题需要同本网站联系,请发邮件至ctyunbbs@chinatelecom.cn沟通。

      上一篇:使用函数钩子实现打印throw异常时的调用栈

      下一篇:如何提升逻辑思维能力

      相关文章

      2025-05-19 09:04:22

      开启关闭线程的封装类

      开启关闭线程的封装类

      2025-05-19 09:04:22
      NULL , static , void
      2025-05-19 09:04:22

      loki仿函数原理

      loki仿函数原理

      2025-05-19 09:04:22
      lt , void
      2025-05-16 09:15:17

      多源BFS问题(1)_01矩阵

      多源BFS问题(1)_01矩阵

      2025-05-16 09:15:17
      lt , 矩阵 , 遍历
      2025-05-16 09:15:17

      BFS解决拓扑排序(1)_课程表

      BFS解决拓扑排序(1)_课程表

      2025-05-16 09:15:17
      lt , 课程 , 队列
      2025-05-16 09:15:17

      BFS解决最短路问题(4)_为高尔夫比赛砍树

      BFS解决最短路问题(4)_为高尔夫比赛砍树

      2025-05-16 09:15:17
      BFS , lt , 复杂度 , 算法
      2025-05-16 09:15:10

      52.介绍AOP有几种实现方式

      52.介绍AOP有几种实现方式

      2025-05-16 09:15:10
      gt , lt , Spring
      2025-05-16 09:15:10

      C语言练习之猜名次-----A选手说:B第二,我第三;B选手说:我第二,E第四;C选手说:我第一,D第二;D选手说:C最后,我第三;E选手说:我第四,A第一;

      C语言练习之猜名次-----A选手说:B第二,我第三;B选手说:我第二,E第四;C选手说:我第一,D第二;D选手说:C最后,我第三;E选手说:我第四,A第一;

      2025-05-16 09:15:10
      amp , lt , 排名
      2025-05-14 10:33:16

      30天拿下Rust之字符串

      在Rust中,字符串是一种非常重要的数据类型,用于处理文本数据。Rust的字符串是以UTF-8编码的字节序列,主要有两种类型:&str和String。其中,&str是一个对字符数据的不可变引用,更像是对现有字符串数据的“视图”,而String则是一个独立、可变更的字符串实体。

      2025-05-14 10:33:16
      amp , Rust , str , String , 使用 , 字符串 , 方法
      2025-05-14 10:33:16

      30天拿下Rust之切片

      在Rust中,切片是一种非常重要的引用类型。它允许你安全地引用一段连续内存中的数据,而不需要拥有这些数据的所有权。切片不包含分配的内存空间,它仅仅是一个指向数据开始位置和长度的数据结构。

      2025-05-14 10:33:16
      amp , end , 切片 , 字符串 , 引用 , 索引 , 迭代
      2025-05-14 10:03:05

      C++ 11新特性之完美转发

      在C++编程语言的演进过程中,C++ 11标准引入了一系列重大革新,其中之一便是“完美转发”机制。这一特性使得模板函数能够无损地传递任意类型的实参给其他函数或构造函数,从而极大地增强了C++在泛型编程和资源管理方面的灵活性与效率。

      2025-05-14 10:03:05
      amp , 函数 , 右值 , 引用 , 模板 , 类型
      查看更多
      推荐标签

      作者介绍

      天翼云小翼
      天翼云用户

      文章

      33561

      阅读量

      5254266

      查看更多

      最新文章

      loki仿函数原理

      2025-05-19 09:04:22

      多源BFS问题(1)_01矩阵

      2025-05-16 09:15:17

      BFS解决拓扑排序(1)_课程表

      2025-05-16 09:15:17

      46. 全排列,78. 子集,17. 电话号码的字母组合

      2025-05-12 10:19:12

      课程表,实现 Trie (前缀树)

      2025-05-12 10:19:12

      岛屿数量

      2025-05-12 10:19:12

      查看更多

      热门文章

      zeebe 为微服务架构的工作流引擎

      2023-07-17 06:52:22

      XML语法快速入门

      2023-07-11 08:56:18

      pushpin 将web services 转换为realtime api 的反向代理工具

      2024-05-16 08:29:23

      在Linux中编译安装“apr-util“报错“xml/apr_xml.c:35:19: 错误:expat.h:没有那个文件或目录“

      2023-06-19 07:04:28

      获取为JS文件传递的参数

      2024-05-22 08:57:42

      linux 自动输入密码脚本避免密码确认

      2024-05-22 10:02:04

      查看更多

      热门标签

      linux java python javascript 数组 前端 docker Linux vue 函数 shell git 节点 容器 示例
      查看更多

      相关产品

      弹性云主机

      随时自助获取、弹性伸缩的云服务器资源

      天翼云电脑(公众版)

      便捷、安全、高效的云电脑服务

      对象存储

      高品质、低成本的云上存储服务

      云硬盘

      为云上计算资源提供持久性块存储

      查看更多

      随机文章

      二叉树的右视图

      回文数-66. 加一-172. 阶乘后的零-69. x 的平方根

      在Linux中编译安装“apr-util“报错“xml/apr_xml.c:35:19: 错误:expat.h:没有那个文件或目录“

      SDUT3145:Integer division 1(换零钱背包)

      加油站

      【二分查找】456:132 模式解法二枚举2

      • 7*24小时售后
      • 无忧退款
      • 免费备案
      • 专家服务
      售前咨询热线
      400-810-9889转1
      关注天翼云
      • 旗舰店
      • 天翼云APP
      • 天翼云微信公众号
      服务与支持
      • 备案中心
      • 售前咨询
      • 智能客服
      • 自助服务
      • 工单管理
      • 客户公告
      • 涉诈举报
      账户管理
      • 管理中心
      • 订单管理
      • 余额管理
      • 发票管理
      • 充值汇款
      • 续费管理
      快速入口
      • 天翼云旗舰店
      • 文档中心
      • 最新活动
      • 免费试用
      • 信任中心
      • 天翼云学堂
      云网生态
      • 甄选商城
      • 渠道合作
      • 云市场合作
      了解天翼云
      • 关于天翼云
      • 天翼云APP
      • 服务案例
      • 新闻资讯
      • 联系我们
      热门产品
      • 云电脑
      • 弹性云主机
      • 云电脑政企版
      • 天翼云手机
      • 云数据库
      • 对象存储
      • 云硬盘
      • Web应用防火墙
      • 服务器安全卫士
      • CDN加速
      热门推荐
      • 云服务备份
      • 边缘安全加速平台
      • 全站加速
      • 安全加速
      • 云服务器
      • 云主机
      • 智能边缘云
      • 应用编排服务
      • 微服务引擎
      • 共享流量包
      更多推荐
      • web应用防火墙
      • 密钥管理
      • 等保咨询
      • 安全专区
      • 应用运维管理
      • 云日志服务
      • 文档数据库服务
      • 云搜索服务
      • 数据湖探索
      • 数据仓库服务
      友情链接
      • 中国电信集团
      • 189邮箱
      • 天翼企业云盘
      • 天翼云盘
      ©2025 天翼云科技有限公司版权所有 增值电信业务经营许可证A2.B1.B2-20090001
      公司地址:北京市东城区青龙胡同甲1号、3号2幢2层205-32室
      • 用户协议
      • 隐私政策
      • 个人信息保护
      • 法律声明
      备案 京公网安备11010802043424号 京ICP备 2021034386号