I hope this is a stupid question (because I already stared at all this
code for too long): how do I access the return value of a
object_method() call in an obex external?
The pattr SDK docs state: "If the receiver object can respond to the
message, object_method returns the result. Otherwise, the function will
The function I'm calling is supposed to return a double, the code I got
to compile look slike this:
double *retval = NULL;
retval = (double *)object_method(x->x_childobj, gensym("doit"), array);
if (*retval != NULL)
post("do something with it");
But as soon as I try to access the retval (even checking whether it's ==
NULL) Max crashes. (Windows XP, latest Max, latest SDK, VC++ 6.0.)
I can't use object_method_typed() here because I have to pass my
function a float** array that won't fit into a t_atom. On a similar
function call (that also crashed) the use of object_method_typed()
solved the problem of getting the return value.
And a related question: would it hurt if I call the function directly
(without using the object_method... call)? At least it doesn't crash
this way. - I really don't like the idea of putting my float** into a
hughe amount of t_atoms...