I would like to have an existing object all my attempts fail.
In the end i just want an object that will reflect an all ready
existing one in c++.
Much how the window object already exist in windows.
this is what i have now. Having gone through a 100 difference
combinations.(The lack of documentation is annoying)
(i looked here http://code.google.com/apis/v8/embed.html though the
example i thought what i want seems to stop halfway. I don't know i'm
tired and have a headache)

         v8::Handle<v8::FunctionTemplate> point_templ =
v8::FunctionTemplate::New();
         point_templ->SetClassName(v8::String::New("Point"));
         v8::Handle<v8::ObjectTemplate> point_inst = point_templ-
>InstanceTemplate();
         point_inst->SetInternalFieldCount(1);

         point_inst->SetAccessor(v8::String::New("x"), GetPointX, SetPointX);
         point_inst->SetAccessor(v8::String::New("y"), GetPointY,
SetPointY);
         point_inst->SetAccessor(v8::String::New("z"), GetPointZ, SetPointZ);

         Point* aPoint = new Point(0, 0, 0);
         v8::Local<v8::Object> obj = point_inst->NewInstance();
        obj->SetInternalField(0, External::New(aPoint ));

        global->Set(v8::String::New("aPoint "),obj);

--~--~---------~--~----~------------~-------~--~----~
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users
-~----------~----~----~----~------~----~------~--~---

Reply via email to