X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;ds=sidebyside;f=vv%2Fvv.cxx;h=0bfc01ef97084ea2bc695dc0eaee10421ada610c;hb=c4663d678e8b23c79ab640ad01dbf15b8bee520d;hp=2a68f3384e3e330c39fcc7dd4b171addb9d9478f;hpb=4bca63581f0e2e0ab2f4b90f0e81fef8b08c3841;p=clitk.git diff --git a/vv/vv.cxx b/vv/vv.cxx index 2a68f33..0bfc01e 100644 --- a/vv/vv.cxx +++ b/vv/vv.cxx @@ -38,7 +38,7 @@ #include #include -#include +#include void load_image_first_error() { @@ -61,8 +61,16 @@ std::string create_timed_string() } //------------------------------------------------------------------------------ +#ifdef _WIN32 +int CALLBACK WinMain(HINSTANCE hInstance, HINSTANCE prevInstance, LPSTR lpCmdLine, int nShowCmd) +{ + int argc = __argc; + char **argv = __argv; +#else int main( int argc, char** argv ) { +#endif + CLITK_INIT; QApplication app( argc, argv ); @@ -129,9 +137,11 @@ int main( int argc, char** argv ) if(itksys::SystemTools::FileExists(log_dir.c_str()) && !itksys::SystemTools::FileIsDirectory(log_dir.c_str())) { - itkGenericExceptionMacro(<< "Error creating log directory, file exists and is not a directory."); + std::cerr << "Error creating log directory, file exists and is not a directory." << std::endl; + exit(1); } else if(!itksys::SystemTools::MakeDirectory(log_dir.c_str())) { - itkGenericExceptionMacro(<< "Error creating log directory."); + std::cerr << "Error creating log directory." << std::endl; + exit(1); } std::string log_file = log_dir + "/" + create_timed_string() + ".log";