> ...except that pd_findbyclassname doesn't exist in m_pd.h ;-)

What I meant is that this is a use case where such a public function would be handy.

Actually, if I understand the problem correctly, I don't think it's necessary. I think this should work:

char buf[MAXPDSTRING];
sprintf(buf, "_my_external_lib1234_%s", s->s_name);
if (buf->s_thing)
    t_send_test* sender = (t_send_test*)buf->s_thing;

Then in the pd_bind call for the sender, just make sure to use the same prefix "_my_external_lib1234_" on the front of the symbol.

class_getname is already a public function, so you can even use that to error-check for the edge-case where someone else tried to bind to that same name.

-Jonathan

Le mer. 20 janv. 2021 à 23:13, Antoine Rousseau <antoine@metalu.net> a écrit :
It's "pd_findbyclass" that wasn't working, because he was asking for a t_class* which had actually another value than the one he was really looking for.

He could have asked for the right t_class* value by calling "pd_findbyclassname" first.
Or he can share the variable, either using "extern" and ensuring the right order of loading of the 2 externals, or grouping both objects into the same binary file (i.e only one "external").



Le mer. 20 janv. 2021 à 22:46, Eric Lennartson <lennartsoneric@gmail.com> a écrit :
Millers and Antoine's solution were, what solved the problem.

On Wed, Jan 20, 2021, 1:39 PM Alexandre Torres Porres <porres@gmail.com> wrote:
Em ter., 19 de jan. de 2021 às 22:55, Jonathan Wilkes via Pd-dev <pd-dev@lists.iem.at> escreveu:
Sounds like a use case for pd_findbyclassname

I'm confused. I thought Eric said pd_findbyclassname didn't work for this in this case.  

Em qua., 20 de jan. de 2021 às 13:49, Eric Lennartson <lennartsoneric@gmail.com> escreveu:
Thanks all this solved the problem!

"this" what?
_______________________________________________
Pd-dev mailing list
Pd-dev@lists.iem.at
https://lists.puredata.info/listinfo/pd-dev
_______________________________________________
Pd-dev mailing list
Pd-dev@lists.iem.at
https://lists.puredata.info/listinfo/pd-dev