[Insight-users] How to update an exeption to a GUI?

Luis Ibanez luis . ibanez at kitware . com
Wed, 07 May 2003 12:02:36 -0400


Hi Joris,

ITK exceptions are more than simple strings, they can not
be directly assigned to a string.

However they provide the following methods

   1)  const char * GetDescription()
   2)  const char * GetLocation()
   3)  const char * what()
   4)  unsigned int GetLine()
   5)  const char * GetFile()

http://www.itk.org/Insight/Doxygen/html/classitk_1_1ExceptionObject.html

Use them at your discretion in order to compose
a message that you can display in your GUI.


Regards,


   Luis


------------------
J Mst wrote:
> Hi all,
> 
> I am making a program with MFC and the building / linking process is 
> going well. But when I run the program ( loading 2 images, adjust some 
> registration parameters, then starting the registration process ), it 
> throws me an exeption.
> 
> The problem is now, that I am not able to catch this exeption by using a 
> try/catch structure. When working in the command line, I simply use the 
> following code:
> 
>         catch( itk::Exception & err)
>              {
>                   std::cout << err << std::endl;
>              }
> 
> But when I am working within MFC, I want to upload the error to an edit 
> box in the GUI. I declare an CString variable to this box. Now I hoped 
> to upload the error to the edit box by using the following code:
> 
>          catch( itk::Exception & err )
>               {
>                    variable = err;
>               }
> 
> This doesnt work, and I am sure that there is a simple solution to my 
> problem but I cant find it :S. I just want the same funtionality as the 
> "cout << err <<". When I can do that, I would also like to use the edit 
> box to update the GUI with the current iteration etc.
> 
> Does anyone know how to do this?
> 
> ps: I have checked out the MutualInformationEuler2D example, and I see 
> that they are using an fl_browser to update the current iteration etc. I 
> would like to know if there is something simple like that is available 
> in MFC.
> 
> Joris
> 
> _________________________________________________________________
> Chatten met je online vrienden via MSN Messenger. http://messenger.msn.nl/
> 
> _______________________________________________
> Insight-users mailing list
> Insight-users@public.kitware.com
> http://public.kitware.com/mailman/listinfo/insight-users
>