X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src%2FcreaWx.h;h=7b63c86b6192140728790bc58e03872c5b8bf0c2;hb=2f22ba400246a1a3841fd1ac1de6b461dc01a022;hp=3a7d6bbd3edccfdbc0da4516c41deac232c8fc70;hpb=596488a9529ffbedea2e6693e32e9b19f042b7e7;p=crea.git diff --git a/src/creaWx.h b/src/creaWx.h index 3a7d6bb..7b63c86 100644 --- a/src/creaWx.h +++ b/src/creaWx.h @@ -37,11 +37,37 @@ typedef void wxWindow; //=========================================================================== #ifdef USE_WXWIDGETS + + +#if defined(_WIN32) + +// How to have a Console and wxWidgets +// http://www.wxwidgets.org/wiki/index.php/MSVC_Setup_Guide +// In Visual C++ 6 (7 should be similar), to create an application that is both a console application +// (cout's to the console are visible) and has a wxWidgets GUI, +// you need to use the linker option "/subsystem:console" and the following code: +#define CREA_WXMAIN_WITH_CONSOLE \ + int main(int argc, char* argv[]) \ + { \ + return WinMain(::GetModuleHandle(NULL), NULL, \ + ::GetCommandLine(), SW_SHOWNORMAL); \ + } + +#else // defined(_WIN32) + +#define CREA_WXMAIN_WITH_CONSOLE + +#endif // defined(_WIN32) + + +#include + + namespace crea { //================================================================== /// Conversion std::string to wxString - inline wxString std2wx(const std::string& s){ + inline wxString std2wx(const std::string& s) { wxString wx; const char* my_string=s.c_str(); wxMBConvUTF8 *wxconv= new wxMBConvUTF8();