Re: Problem with instantiating thru bonobo_activation_query.



Hi Nickolay
Thanks for your reply. Made me realize my stupidity :). Here is the
final piece of code I have fixed upon.

The exception ac != NULL comes because
bonobo_activation_activation_get_context call fails -- the reason that
was happening was strange.

Where I am initializing bonobo, I should do activation_query
immediately afterwards [thats what gnopernicus, and test-speech do]
within that same function. I had actually put bonobo_init and
activation_query into 2 separate functions as I had seen that other
functions work just fine, like bonobo_activation_activate_from_id (it
could be put in a separate function).

On your suggestion, I have deleted the bonobo_activation_init calls.
And I think, checking if bonobo_is_initialized is good, specially if
the application is huge one is working on.

Lastly many thanks. :).

if (!bonobo_is_initialized())
if (!bonobo_init (NULL, NULL))
{
fprintf (stderr, "Could not setup Bonobo environment for speech
synthesis.\n");
IsAvailable = false;
return false;
}
if (BONOBO_EX (&ev)) {
fprintf (stderr, "Could not setup Bonobo environment for speech
synthesis. Related Exception %s\n", bonobo_exception_get_text (&ev));
IsAvailable = false;
return false;
}


/*[WORKS NOW] Query for speech servers  */
servers = bonobo_activation_query (OBJ_ID,NULL, &ev);
if (BONOBO_EX (&ev) || servers  == CORBA_OBJECT_NIL) {
fprintf (stderr, "Fetching Speech servers information failed.
Related Exception %s.\n", bonobo_exception_get_text (&ev));
return false;
}



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]