IRC Log Viewer » #firebreath » 2013-04-15

IRC Nick Time (GMT-7) Message
mjsrs 06:04 hi, everyone. anyone experienced problems with VS Express 2012?
dast 20:04 hi, i can't figure out how to call JSAPI method from Plugin class instance. can anybody help, pls?
taxilian 20:04 getRootJSAPI()
and then FB:ptr_cast<PluginAPIPtr>(getRootJSAPI()) if you need to get it to the specific type
dast 20:04 thanks. i will try
if i try FB::JSAPIPtr myAPI = getRootJSAPI();
i'll get the same error: 'testEvent' : is not a member of 'FB::JSAPI'
taxilian 20:04 that's because it isn't
you need to access it as the specific type
so you need the second half of my instructions
dast 20:04 but the second part makes me 10 errors
'boost::shared_ptr<X> boost::make_shared(A1 &&,A2 &&,A3 &&,A4 &&,A5 &&,A6 &&,A7 &&,A8 &&,A9 &&)' : expects 9 arguments - 2 provided
the same errors as if i tried:
boost::shared_ptr<PluginTestAPI> myAPI(boost::make_shared<PluginTestAPI>(FB::ptr_cast<PluginTest>(shared_ptr()), m_host));
taxilian 20:04 was is the exact line you're using to ptr_cast right now?
without the other
… also what is shared_ptr() supposed to be? is that something you added? If you're doing what I think you are you need to do shared_from_this()
dast 20:04 myAPI = FB:ptr_cast<PluginAPIPtr>(getRootJSAPI());
taxilian 20:04 and what is myAPI?
dast_ 20:04 i use FB PluginTest with PluginTest API
taxilian 20:04 all I need is the line you declare it
for example, is it PluginAPIPtr myAPI;
dast_ 20:04 i'm probably disconnected again
i tried FB::JSAPIPtr myAPI
taxilian 20:04 looks like it should be PluginAPIPtr myAPI = FB::ptr_cast<PluginAPI>(getRootJSAPI())
dast_ 20:04 error C2065: 'PluginAPIPtr' : undeclared identifier
taxilian 20:04 is your class called PluginaPI?
dast_ 20:04 PluginTestAPI
taxilian 20:04 then it should be PluginTestAPI instead of PluginAPI
dast_ 20:04 ouu, this is it
but PluginTestAPIPtr is undefined as well
taxilian 20:04 was this class created by fbgen?
dast_ 20:04 PluginTestAPI
taxilian 20:04 was this class created by fbgen?
or did you create it yourself?
sounds like you're missing the FB_FORWARD_PTR line, though fbgen should add it for you if you created it that way. see
look at FBTestPlugin for examples; most things you'll want to do there are examples in there somewhere
gotta run
good luck