--- In [email protected], "entropyreduction" <[EMAIL PROTECTED]> wrote:
>
> Hi Sean,
>
> "swzoh" <[EMAIL PROTECTED]> wrote:
>
> >> Are you passing POINTs in, or getting them out?
> >
> >I need to pass them in.
>
> Okay, that's not handled yet.
>
> >This is what actually confused me even if I was aware that there was
> >no dll.set_array_element yet.
>
> > What's not clear to me: the number and
> > the role of the handle, aPoint here. Just single one is enough?
>
> Yes, the service uses the struct handle to get the struct, works out
> how much memory each requires, and reserves (and zeros) memory.
I see. Thanks for explaing.
> When I get back I'll work on dll.set_array_element. Seems that must
> be the way to go. This OTOH:
Good! BTW, I sort of succeeded to create a region what I want. After
my previous post I just gave a go with instead
dll.create_struct("t t t t t",p1,p2,p3,p4,p5)
I don't know why but it worked. They definitely expect an array of
point structures. Is there a chance to confuse struct with array?
> aVertices = dll.create_array(5,"struct*",aPoint1, aPoint2, aPoint3,
> aPoint4...)
>
> is inherently limited cause sooner lor later someone's gonna want an
> array with more than 22 elements.
>
> Though I suppose I could make that an option.
>
> Maybe need (or be useful to have) dll.set_struct_element too.
I suppose it'll be also useful in some cases.
> dll.set_array_element has somehow gota deal with pointers too. Hmm.
>
> aPoint = dll.create_struct(.....)
> ; allocates memory for pointers, not the pointed-to-structs
> aVertices = dll.create_array(5,"struct*",aPoint)
> ; service will have to be smart enough to notice that array is of
> type struct*, and therefore
> ; just update pointer in array
> dll.set_array_element(aVertices, 1, aPoint)
I think I was careless then. I should've written struct, not struct*.
Apologies. Is there any frequently used API to need an array of t*?
> this will be tricky:
>
> dwpArray = dll.create_array(5,"dword*")
> dll.set_array_element(dwpArray, 1, 23)
>
> Where does the pointed-to DWORD live? Now I gotta allocate memory for
> that. OTOH does as array of pointers to scalars ever happen in any
> api? I bet not, no advantage over simply passing a pointer to an
> array of scalars.
>
> Another possiblity:
>
> aVec = vec.create(5)
> aVec[0] = dll.create_struct(.....)
> aVec[1] = dll.create_struct(.....)
> aVec[2] = dll.create_struct(.....)
> ......
>
> aVertices = dll.create_array(aVec,"struct*",aPoint)
>
> Then array would be set from vector. I can figure out how big to make
> the array from vec.length
>
> You would then do
>
> dll.refresh_array(aVertices)
>
> after you called dll. I might be able to refresh vector automatically
> the moment after a dll.call was made using the array, have to check
> into that.
>
> That interesting?
Yeh, sounds like interesting.
> Offline from now for a week or so. Skiing. Yippee!
Have a nice ski trip.
Sean
Attention: PowerPro's Web site has moved: http://www.ppro.org
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/power-pro/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/