IRC Log Viewer » #firebreath » 2012-09-04

IRC Nick Time (GMT-7) Message
davidk 04:09 Hello
I have a question
Guest37764 04:09 How I can pass MyPLuginAPI pointer to another object?
basicly access to API methods from other objects
reichi 04:09 second
gotta look that up ;)
shared_from_this()
well
wait
it depends what you're going to do
shared_from_this() creates a JSAPIImplPtr
to pass into javascript functions for example
for use in c++ you could use boost::shared_ptr<MyPLuginAPI>
could/should/usually want to
Guest37764 04:09 ok i try...
Ok seems that works correctly
Now I can call JS API
Problema
Problem, I try to use js->Invoke an I have an error
Guest37764 05:09 Exactly
js->Invoke("accept", FB::variant_list_of());
reichi 05:09 what's the error? ;)
Guest37764 05:09 In browser Error: Error calling method on NPObject, when i call method that do something an calls other agin jsapi
Guest37764 05:09 and in terminal: shared_ptr.hpp:418: T* boost::shared_ptr<T>::operator->() const [with T = FB::JSAPI]: The declaration `px != 0' not met
reichi 05:09 nullpointer?
use shared_from_this()
for your case
Guest37764 05:09 using shared_from_this(), the plugin crash
at start
using boost::share_ptr ... is OK, but I can use nothing?
reichi 05:09 what i wrote above is only a typedef
shared_from_this() should not crash
iirc you can't use that in the constructor
jupp
don't call it from the constructor
what i did is give ma API class a "onPluginReady"
and in the Plugin class (the one derived from PluginCore) do: (FB::ptr_cast<MyPluginAPI>(getRootJSAPI()))->onPluginReady();
in it's onPluginReady Method
because if you do it in the constructor of your API class, the Plugin itself has not finished initializing
which supposedly causes the crash
Guest37764 05:09 Good!
The problem is constructor
reichi 05:09 yeah
what i described above is how i did it
Guest37764 05:09 All the time I was passing this in contructor
reichi 05:09 and it hink it's ok :)
Guest37764 05:09 Wow I am very stupid
I think that it is documented
But where?
reichi 05:09 I'm not sure it's documented
if you add some debug you'll see why that has to fail ;)
(or if you know how things are being initialized)
Guest37764 05:09 Ok
I think that I have similar problem creating two JSAPIAuto objects
reichi 06:09 never do that in the constructor ;)
but
for JSAPIAuto Objects
Guest37764 06:09 But in this case i need registerMethods
in constructor
reichi 06:09 just pass "this"
registerMethod("createApplication", make_method(this, &OipfApplication::createApplication));
like that
Guest37764 06:09 ok
But when i try do something with this objects i cant registermethods or use FB_EVENT
do nothing
and i use similar templeta that come with FB
reichi 06:09 reigsterProperty/Method has to be done in the Constructor
i guess
I'm not sure about that
but it definitely works fine :)
Guest37764 07:09 I'm trying to trigger js events with an object but it is impossible. Compile, and then crash
reichi 07:09 well that's no information to work with
taxilian 09:09 Guest37764 we need a bit more details on what you're doing
you're trying to fire an event; you using the firebreath event macro? then how are you calling it?
Greenlove 19:09 woops, prep scripts are doesn't detect installed wix toolset...
Greenlove 19:09 is anybody there?
hello~~
GreenLove 20:09 hi taxilian
taxilian 20:09 hello
GreenLove 20:09 did you know update for WIX?
taxilian 20:09 where did you install WiX?
GreenLove 20:09 i downloaded from codeplex?
i re-running prep script after install WIX.
but, script doesn't detect wix.
taxilian 20:09 where did you install WiX
where on your hard drive
GreenLove 20:09 root drive
taxilian 20:09 WHERE did you install Wix?
I figured it was probably on your hard drive
that isn't very helpful
GreenLove 20:09 c:\program files\wix toolset v3.6
taxilian 20:09 let me check
ok; they've changed the install path
GreenLove 20:09 oh so how to fix this problem?
taxilian 20:09 try setting a system env variable WIX=c:\program files\wix toolset v3.6