5.5.1.2 Obtaining a Reference to a FactoryFinder Object Using the CosLifeCycle::FactoryFinder Interface

The following code snippet shows how to use of the CORBA-compliant interface to obtain one or more references to factory objects.

// Client Application: Obtaining the object reference
// to factory objects.
CosLifeCycle::Key_var factory_key = new CosLifeCycle::Key( );
factory_key ->length(1);
factory_key[0].id = string_dupalloc( “strlen(“TellerFactory”) +1 );
factory_key[0].kind = string_dupalloc(
strlen(““FactoryInterface”) + 1);
strcpy( factory_key[0].id, “”TellerFactory” );
strcpy( facory_key[0].kind, “FactoryInterface” );
CosLifeCycle::Factories_var * flp = ff_np ->
find_factories( factory_key.in( ) );