I have the following class:
class PluginManager
{
public:
Handle<Value> Register(const Arguments& args);
Handle<ObjectTemplate> GetObjectTemplate();
};
I want the Register method to be accessible from JavaScript. I add it to the global object like this:
PluginManager pluginManagerInstance;
global->Set(String::New("register"), FunctionTemplate::New(pluginManagerInstance.Register));
It throws the following error:
'PluginManager::Register': function call missing argument list; use '&PluginManager::Register' to create a pointer to member
I tried to do that, but it doesn't work either. And it's not correct, because I want it to call the Register method of the pluginManagerInstance.
Except for making the Register method static or global, any ideas?
Thanks.