I'm having problems calling functions and I'm currious if I a doing it the right way. I a writing the
external in c++. I make a class Test and I declare a function for example:
void Test::post_filepath(char* path) {post( "opening %s", path);}
Then within the externals typedef stucture I include a pointer to the class for example:
typedef struct _myexternal {
t_object x_obj;
Test *funct;
} t_myexternal;
When I call the function like this:
void capture_cap(t_myexternal *x, t_symbol *file) {x->funct->post_filepath(file->s_name);}
Pd crashes, I have to do it like this to avoid a crash:
void capture_cap(t_myexternal *x, t_symbol *file) {post( "opening %s", file->s_name);}
what am I doing wrong and what is the proper way to do it?
Thanks,
Alain