In the fs.readFile function we need to specify a callback.
I gave it a c++ function by giving 
        v8::FunctionTemplate::New(MyClass::*ReadFileCallBackFunction*
)->GetFunction();

and then calling the readFile function with the parameters.

I get the callback as expected with two arguments, first is null for err 
and another is data object.

But now i want to invoke *data.toString() *from the c++, but at later time 
in future.

How can i do that ?

I tried storing this pointer that i get in "ReadFileCallBackFunction". 

from the Arguments parameter as 
*            storing_this_pointer *= *args.This()* 

and then using it to call data.toString() from the c++, where i have a 
persistent handle to this function as
    
         v8::Local<v8::Value> funcRetVal = data_toString_persistent_handle*.
**As<v8::Function>*()->Call(*storing_this_pointer *, argv.size(), 
argv.data());

But this gives me an error 
                        Error: Uncaught TypeError: Cannot call method 
'utf8Slice' of undefined 

The code of toString is 

       --> this.parent.utf8Slice(...

*Is it not getting this or this.parent* ?

What should i do ?

-- 
-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to