TutWinSetOutputListBox set Windows output function
list_box_hwnd
HWND
of a list box for program output
max_num_lines
number of history lines to maintain
None
None
TutWinSetOutputListBox is used to set program output in a Windows environment. The HWND
of a list box control is passed to the function. All subsequent program output is displayed in the list box. Without this function, printf
is used for all program output. printf
works for Windows console applications but does not display anything in a Windows GUI application. max_num_lines
is used to specify the number of history lines to maintain in the list box.
list_box_hwnd
must be the HWND
of a list box control.
max_num_lines
must be greater than 0
.
TutWinSetOutputListBox calls TutSetOutputFunc to set the function used by TutOut.
This example sets program output in the Windows environment:
class CRTclientDlg : public CDialog { public: CRTclientDlg(CWnd* pParent = NULL); CListBox m_programOutput; }; BOOL CRTclientApp::InitInstance() {//-------------------------------------------------------------
//create and display the dialog (our main window)
//-------------------------------------------------------------
m_dlg = new CRTclientDlg; m_pMainWnd = m_dlg; m_dlg->Create(IDD_RTCLIENT_DIALOG);//-------------------------------------------------------------
// redirect TutOut
// This redirects any TutOut output into the list box of
// the program dialog box. We pass the HWND of the list box
// along with the number of lines of history we want to store.
//-------------------------------------------------------------
TutWinSetOutputListBox(m_dlg->m_programOutput.GetSafeHwnd(), 100);
TIBCO SmartSockets™ Utilities Software Release 6.8, July 2006 Copyright © TIBCO Software Inc. All rights reserved www.tibco.com |