Cannot set id on a live.object

Lee's icon

Hi, trying to set the id of a live.object using the following code but get an error message saying that live.object doesn't understand id. Anyone any ideas? thx

t_atom rv;
long id_long = id;

t_object *p_obj = newobject_sprintf( p_patcher, "@maxclass newobj @text \"live.object\" @patching_position %d %d", 100, 100 );

object_method_long( p_obj, gensym( "id" ), id_long, &rv );

Lee's icon

I've also tried sending a typed message in but get the same error:

t_atom args[ 1 ];
atom_setlong( args, id );
object_method_typed( p_obj, gensym( "id" ), 1, args, &rv );

Lee's icon

Doh, forgot that I was sending a message:

t_atom args[ 2 ];
atom_setsym( args, gensym( "id" ) );
atom_setlong( args + 1, id );
object_method_typed( m_p_live_obj, gensym( "message" ), 2, args, &rv );