Thanks Belgavor !
I succeeded in displaying logs inside a log windows.
As it could help other people, here is how :
- I added the compilation flag __WXDEBUG__ in my debug project build options. I had forgotten it. :oops:
- I added this code in the constructor of my main window :
#if defined(__WXDEBUG__) || !defined(__VISUALC__)
wxFrame* pLogFrame;
wxLogWindow* m_pLogWindow = new wxLogWindow(this, wxT("Log") );
pLogFrame = m_pLogWindow->GetFrame();
pLogFrame->SetWindowStyle(wxDEFAULT_FRAME_STYLE|wxSTAY_ON_TOP);
pLogFrame->SetSize( wxRect(0,50,400,250) );
wxLog::SetActiveTarget(m_pLogWindow);
#endif
This code permits to display a log frame always at the same position and always on top.
Hum sorry, first the compilation flag is wrong. It is not :
#if defined(__WXDEBUG__) || !defined(__VISUALC__)
but :
#if defined(__WXDEBUG__) && !defined(__VISUALC__)
And now, I have link errors when using __WXDEBUG__: 'undefined references to wxAppConsole::OnAssert(wchar_t const*, int, wchar_t const*, wchar_t const*)', for example.
I think I have to recompile wxWidgets with debug symbols...