OutputDebugString的用法

来源:互联网 发布:计算机算法流程图 编辑:程序博客网 时间:2024/05/01 14:32

OutputDebugString is a API function, it is used to help programmer debug the program, which is like
TRACE or afxDump, it is work with Dbgview. in Debug mode it performance as TRACE. But in Release mode
it can be monitor in DbgView.


OutputDebugString is explained in MSDN

The OutputDebugString function sends a string to the debugger for the current application.

VOID OutputDebugString(
  LPCTSTR lpOutputString   // pointer to string to be displayed
);
 
Parameters:

lpOutputString parameters Pointer to the null-terminated string to be displayed.

Return Values
This function does not return a value.

Remarks
If the application has no debugger, the system debugger displays the string.
If the application has no debugger and the system debugger is not active,
OutputDebugString does nothing.


Example:


void CSdfghfgView::OnRButtonDown(UINT nFlags, CPoint point)
{
 // TODO: Add your message handler code here and/or call default
 OutputDebugString("right button is pressed");
}

 

原创粉丝点击