Add another Object into an object

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

Add another Object into an object

Postby nguyentuan » Mon May 15, 2017 3:58 am

Is there anyway to add another Object into an object??For example

Create two object , and add Object B into Object A
Code: Select all
       objectA = CefV8Value::CreateObject(nullptr);

       
       auto accessor = new MyAccessor();
       auto objectB= CefV8Value::CreateObject(accessor);

       objectA->SetValue("objectB", objectB->GetV8Value(), V8_PROPERTY_ATTRIBUTE_READONLY);


That's what I'am trying to do but don't know nothing about it. Anyone can help me? :( :( :(
nguyentuan
Newbie
 
Posts: 3
Joined: Mon Apr 24, 2017 2:34 am

Re: Add another Object into an object

Postby Czarek » Thu May 25, 2017 12:05 pm

There is no such method as GetV8Value(). Try:

Code: Select all
objectA->SetValue("objectB", objectB, V8_PROPERTY_ATTRIBUTE_READONLY);
Maintainer of the CEF Python, PHP Desktop and CEF C API projects. My LinkedIn.
User avatar
Czarek
Virtuoso
 
Posts: 1927
Joined: Sun Nov 06, 2011 2:12 am


Return to Support Forum

Who is online

Users browsing this forum: No registered users and 44 guests