[flext] Basic question about ADDMETHOD
Martin Jaroszewicz
temporum at gmail.com
Thu Jan 14 05:02:38 UTC 2016
Dear forum,
I'm new to Flext, and haven't coded in C++ in a long time. I'm trying to
make the code below compile but get the following error:
error: reference to non-static member function must be called
FLEXT_ADDMETHOD_S(0,"read",m_read);
Also can someone clarify the difference between the two ways to register
methods (ADDMETHOD and CADDMETHOD) ? Does this have to do with passing
pointers as arguments (?). Code below
I'm trying to read a text file into a vector. This is the first step.
'''
#include <flext.h>
#if !defined(FLEXT_VERSION) || (FLEXT_VERSION < 400)
#error You need at least flext version 0.4.0
#endif
class hello:
public flext_base
{
FLEXT_HEADER(hello,flext_base)
public:
hello();
protected:
void m_read(t_symbol *argument);
private:
FLEXT_CALLBACK_S(m_read)
};
FLEXT_NEW("hello",hello)
hello::hello() {
AddInAnything();
FLEXT_ADDMETHOD_S(0,"read",m_read);
}
void hello::m_read(t_symbol *argument) {
post("reading argument: %s)",GetString(argument));
}
'''
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://grrrr.org/pipermail/flext/attachments/20160113/a3a0ecbe/attachment.html>
More information about the flext
mailing list