diff --git a/examples/proto_debuger/base_form.cpp b/examples/proto_debuger/base_form.cpp index 1ac23b40..9e8bf92c 100644 --- a/examples/proto_debuger/base_form.cpp +++ b/examples/proto_debuger/base_form.cpp @@ -174,11 +174,20 @@ LRESULT BasicForm::HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam) } if (uMsg == WM_ADD_UDP_MONITOR) { + printf("add udp monitor"); + wchar_t pdata[100] = L"\0"; + TcpServerInfo* p = (TcpServerInfo*)wParam; + wsprintf(pdata,L"%s:%d", p->ip.c_str(),p->port); + ui::TreeNode* node = new ui::TreeNode; + node->SetText(pdata); + node->SetClass(L"listitem"); + mMonitor->GetRootNode()->GetChildNode(0)->AddChildNode(node); + return WindowImplBase::HandleMessage(uMsg, wParam, lParam); } if (uMsg == WM_ADD_UART_MONITOR) { - printf("add monitor"); + printf("add uart monitor"); UartInfo* p = (UartInfo*)wParam; wprintf(L"%s", p->name.c_str()); diff --git a/examples/proto_debuger/new_monitor_form.cpp b/examples/proto_debuger/new_monitor_form.cpp index 74ec9156..2d4f43af 100644 --- a/examples/proto_debuger/new_monitor_form.cpp +++ b/examples/proto_debuger/new_monitor_form.cpp @@ -135,11 +135,7 @@ void NewMonitorForm::InitWindow() } } - if (m_combo_type->GetText() == L"udp") { - wprintf(L"%s\r\n", m_ip_select->GetText().c_str()); - wprintf(L"%s\r\n", m_port_select->GetText().c_str()); - } if (m_combo_type->GetText() == L"tcp client") { wprintf(L"%s\r\n", m_ip_select->GetText().c_str()); wprintf(L"%s\r\n", m_port_select->GetText().c_str()); @@ -157,8 +153,6 @@ void NewMonitorForm::InitWindow() } } - - if (m_combo_type->GetText() == L"tcp server") { wprintf(L"%s\r\n", m_ip_select->GetText().c_str()); wprintf(L"%s\r\n", m_port_select->GetText().c_str()); @@ -179,8 +173,6 @@ void NewMonitorForm::InitWindow() } } - - if (m_combo_type->GetText() == L"udp") { wprintf(L"%s\r\n", m_ip_select->GetText().c_str()); wprintf(L"%s\r\n", m_port_select->GetText().c_str()); @@ -190,7 +182,6 @@ void NewMonitorForm::InitWindow() p->ip = m_ip_select->GetText(); p->port = port; p->socket_fd = m_tcp_server->SocketFd(); - printf("¿ªÆô·þÎñ¶Ë %d \r\n", p->socket_fd); auto succ = ::PostMessage(m_parent->GetHWND(),