[PD-dev] getting the classname in an class

Hans-Christoph Steiner hans at eds.org
Fri Oct 26 18:36:01 CEST 2007


Ok, I've seen a number of different ideas for how to get the complete  
classname an object was instantiated with from within that class, but  
I haven't been able to get one working.

Krzysztof did this in externals/miXed/cyclone/hammer/universal.c:

     t_gobj *g;
     for (g = glist->gl_list; g; g = g->g_next)
	if (pd_class(&g->g_pd)->c_name == cname)  /* LATER rethink */
	    pd_bang(&g->g_pd);


I tried this in my code, but got an error:

     binbuf_addv(b, "ssiisiiss", gensym("#X"),gensym("obj"),
                 x->x_obj.te_xpix, x->x_obj.te_ypix, pd_class(&z- 
 >g_pd)->c_name,
                 x->x_width, x->x_height, x->x_bgcolour, x->x_fgcolour);

     entry.c:504: error: dereferencing pointer to incomplete type


I think IOhannes recommended this, but I get the same error:

     binbuf_addv(b, "ssiisiiss", gensym("#X"),gensym("obj"),
                 x->x_obj.te_xpix, x->x_obj.te_ypix, (*(t_pd *)x)- 
 >c_name->s_name,
                 x->x_width, x->x_height, x->x_bgcolour, x->x_fgcolour);

     entry.c:504: error: dereferencing pointer to incomplete type

Any suggestions?

.hc


------------------------------------------------------------------------ 
----

The arc of history bends towards justice.     - Dr. Martin Luther  
King, Jr.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puredata.info/pipermail/pd-dev/attachments/20071026/0ea959e2/attachment.htm>


More information about the Pd-dev mailing list