LiveCode Builder: Passing buffer to foreign handler

Monte Goulding monte at appisle.net
Sun Apr 17 21:50:15 EDT 2016


http://forums.livecode.com/viewforum.php?f=93&sid=5991adc52943d11c938912419b77ad82

Sent from my iPhone

> On 18 Apr 2016, at 10:47 AM, Dar Scott <dsc at swcp.com> wrote:
> 
> LCB forum?
> 
>> On Apr 17, 2016, at 5:07 PM, Monte Goulding <monte at appisle.net> wrote:
>> 
>> Dar I think you are on the right track but it's not something I've not done yet. The most likely candidate for an example of this stuff is the browser widget. Otherwise someone on the LCB forum might have worked it out. 
>> 
>> Cheers
>> 
>> Monte
>> 
>> Sent from my iPhone
>> 
>>> On 18 Apr 2016, at 1:14 AM, Dar Scott <dsc at swcp.com> wrote:
>>> 
>>> I'm using LiveCode 8.0.0 RC 1 on the Mac.  I'm tinkering with LiveCode Builder to make library extensions.
>>> 
>>> I want to pass a buffer pointer to a foreign handler, in a hardware vendor supplied dynamic library  Then I want to access the bytes/words in that buffer.
>>> 
>>> What's the best way to do this?  
>>> 
>>> I thought about building up a value of type data of the right length.  Is the data value contiguous?  Does it stay in one place?  Is the value allowed to change?  I think breaking equality is OK.  How do I get the pointer to the underlying first byte?  (MCDataGetBytePtr()?)  Or is a data ref automatically converted to pointer as needed?  
>>> 
>>> Or do I need to allocate my own memory?  Are any <builtin> functions are available to do this?  How do I get to the bytes after I make the call to the foreign function?  (MCMemoryAllocate()?)  
>>> 
>>> Is this noise on this list?  Should this question be elsewhere?  
>>> 
>>> Dar
>>> 
>>> 
>>> 
>>> _______________________________________________
>>> use-livecode mailing list
>>> use-livecode at lists.runrev.com
>>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>> 
>> _______________________________________________
>> use-livecode mailing list
>> use-livecode at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
> 
> 
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode




More information about the Use-livecode mailing list