Re: GGV 1.1.96



Sergey,

	Carry on chopping out code until it works, slowly add it back in; you
will find the bug; then poke at that; repeat the process on the method
you added, eventually you will find the bug.

	This is what most of us have to do with bugs we don't understand; there
is no short-cut to understanding something. If binary chop fails you can
read the code you wrote, and the code it uses, and so on until you have
a better understanding of the entire system.

On Wed, 2002-07-31 at 20:39, Sergey V. Udaltsov wrote:
> newChild = bonobo_widget_new_control( psFileMoniker, CORBA_OBJECT_NIL );

	So bin all of this:

> if( newChild != NULL )        // some error?
... but not this ...
>   gtk_container_add( GTK_CONTAINER( frame ), newChild );
... and bin this ...
>   if( zoomable != CORBA_OBJECT_NIL )
... but not this ...
>   gtk_widget_show_all( newChild );
...
>   Bonobo_Control_activate( control, True, NULL );

	A few points: you cannot pass NULL as an exception parameter to a CORBA
method, use:

void bonobo_control_frame_control_activate
		(BonoboControlFrame *control_frame);

	instead.

	Secondly; you cannot trust the return value of a CORBA method without
first checking the environment eg.:

	control = Bonobo_Unknown_queryInterface (o, "IDL:Foo:1.0", &ev);
	/* it is not valid to use 'control' until we've checked ev */
	g_assert (!BONOBO_EX (&ev));
	/* now we can use control */

	If you pass some uninitialized memory into Bonobo_Control_activate,
that you happened to get from a failed method, it might work to the
extent that you get odd errors like you are seeing.

	Regards,

		Michael.

-- 
 mmeeks gnu org  <><, Pseudo Engineer, itinerant idiot




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