{
if ( !CORBA::is_nil(myGeomEngine) )
return;
- // get GEOM_Gen engine
- ///*
- SALOME_LifeCycleCORBA* lcc = new SALOME_LifeCycleCORBA( name_service );
- Engines::Component_var comp = lcc->FindOrLoad_Component( "FactoryServer", "GEOM" );
- //*/
- /*
+ // get GEOM_Gen engine
Engines::Container_var cont=GetContainerRef();
- cont->load_component_Library("GEOM");
- Engines::Component_var comp=cont->create_component_instance("GEOM",0);
- */
+ CORBA::String_var container_name=cont->name();
+ std::string shortName=container_name.in();
+ shortName=shortName.substr(12); // substract "/Containers/"
+ SALOME_LifeCycleCORBA* lcc = new SALOME_LifeCycleCORBA( name_service );
+ Engines::Component_var comp = lcc->FindOrLoad_Component( shortName.c_str(), "GEOM" );
+ delete lcc;
myGeomEngine = GEOM::GEOM_Gen::_narrow(comp);
}