On Mon, 2009-03-09 at 18:18 +0000, Samuel Silva wrote:
> Hi!
> 
> Just a message to tell you that I seem to have partially solved the 
> problem.
> 
> After some debugging I found that the itkLoad function was not returning 
> a proper address to a factory. In fact, it was returning NULL, with the 
> inevitable disaster happening in

Hallo Samuel,

I don't have a working Windows compile for testing right now, but I
would like to check one thing. 

Could you please try to change a line in

src/CMake/ToolExtensionITKFactoryLoader.cpp.in

Just try to remove the static in line 67 where it says

static mitkToolExtensionITKFactoryLoader::Pointer factory  = 
mitkToolExtensionITKFactoryLoader::New();

and then try generate the DLL again.

And just to make sure, you have the CMake variables

BUILD_SHARED_LIBS
MITK_BUILD_SHARED_CORE

set to ON, right?

Regards,
Daniel

PS: please try to send mails to the mitk-users list if they are of
general interest.

> 
> void ObjectFactoryBase::LoadLibrariesInPath (const char* path).
> 
> Somehow it seemed to me (although not properly checked) that
> registering 
> the factories inside the mitkToolExtensionITKFactoryLoader() would 
> result in a new call to itkLoad (due to loading libraries in the 
> autoload path maybe?).
> 
> What I did was to register the factory for PlainExternalTool directly 
> inside itkLoad and returned its Pointer:
> 
> itk::ObjectFactoryBase* itkLoad()
> {
>   static mitk::PlainExternalToolFactory::Pointer factory = 
> mitk::PlainExternalToolFactory::New();
>   return factory;
> }
> 
> With this change a new button (External) now appears in the Tools
> group.
> 
> Probably I did something weird to provoke this behavior in the first 
> place, right? I say I solved it partially because an exception still 
> occurs on application exit.
> 
> Sorry for filling your mailbox. :)
> 
> Regards,
> Samuel
> 
> 
> 
> Samuel Silva wrote:
> > Hello Daniel,
> >
> > I hope that you have managed to successfully send your thesis for 
> > printing!
> > My moment will only come in a couple of years :).
> >
> > Regarding registering external Tools in MITK applications I
> followed 
> > the instructions present in the link you provided and all went well:
> I 
> > managed to compile the tool and set the autoload mechanism working 
> > with no major problems. Unfortunately I ran into an issue during
> the 
> > loading process. When loading the new tool the following exception 
> > occurs:
> >
> > Unhandled exception at 0x04cba09c (mitkExternalTools.dll) in 
> > MyApp_d.exe: 0xC0000005: Access violation writing location
> 0x00000034.
> >
> > when executing the first factory registration line (or in the next 
> > lines if this one is commented) in
> >
> > mitkToolExtensionITKFactoryLoader()
> >    {
> >                itk::ObjectFactoryBase::RegisterFactory( 
> > mitk::PlainExternalToolFactory::New() );           
> > itk::ObjectFactoryBase::RegisterFactory( 
> > mitk::ComplexExternalToolFactory::New() );
> >           itk::ObjectFactoryBase::RegisterFactory( 
> > QmitkComplexExternalToolGUIFactory::New() );
> >    }
> >
> > I already tried to run the MainApp (inside the MITK solution) just
> to 
> > rule out some possible issue in MyApp and the same exception
> occurs. 
> > Well this is not a clear error but I was wondering if you ever run 
> > into such an issue and if you have an idea of its causes. I supposed
> I 
> > don't have to link MyApp with any additional library or add any 
> > additional code as the autoload mechanism should be "self
> sufficient" 
> > right?
> >
> > Sorry for bothering and many thanks for your time and attention,
> > Samuel
> >
> >
> >
-- 
Dipl.-Inform. Med. Daniel Maleike          Phone: +49 6221 42 2326
Deutsches Krebsforschungszentrum           Im Neuenheimer Feld 280
Medical and Biological Informatics (E130)         69120 Heidelberg



------------------------------------------------------------------------------
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users

Reply via email to