object_error_obtrusive

andrea agostini's icon

Hi.

I have very good reason to use object_error_obtrusive(), but I can't get it working. It's in the (very simple) instance creation method of a MSP object. It prints the error to the Max window, but the yellow bar on top of the patcher window doesn't appear... any hints?

thank you

aa

Emmanuel Jourdan's icon

It works like a charm here:

object_error_obtrusive((t_object *)x, "toto");

tested by adding that somewhere in simplemax.

andrea agostini's icon

hi Emmanuel.
In fact, I have used it successfully in a non-MSP object.
I was wondering if perhaps it doesn't work in MSP objects...
Thank you!
aa

Emmanuel Jourdan's icon

You're not trying to trigger it from the perform method, are you?

andrea agostini's icon

of course not!!!
I'm calling it from the instance creation method
aa

Joshua Kit Clayton's icon

Hmmm...The object might need to have been instantiated first, and be valid in the patcher to actually work. So you might need to defer this (and/or actually create the object rather than returning NULL from your constructor).

andrea agostini's icon

Thank you, this definitely makes sense.
Cheers
aa