Re: [Gambas-user] Memory Stream Help

2011-11-25 Thread Randall Morgan
Thanks Benoit, This should help. Randy 2011/11/25 Benoît Minisini > > > > Hi, > > > > In revision #4257, I have added support for extern functions that return > > a pointer to a C structure. > > > > ... > > Note that passing or receiving structures by value is not supported. > > -- > Benoît M

Re: [Gambas-user] Memory Stream Help

2011-11-25 Thread Benoît Minisini
> > Hi, > > In revision #4257, I have added support for extern functions that return > a pointer to a C structure. > > ... Note that passing or receiving structures by value is not supported. -- Benoît Minisini -- All

Re: [Gambas-user] Memory Stream Help

2011-11-25 Thread Benoît Minisini
Le 22/11/2011 18:56, Randall Morgan a écrit : > I do the C structures defined. But the functions return pointers to the > structures created by Tidy. So I have to Read the data into my local copy > using the pointer returned. Which I feel is very inefficient. I have just > started to play around wi

Re: [Gambas-user] Memory Stream Help

2011-11-22 Thread Randall Morgan
I do the C structures defined. But the functions return pointers to the structures created by Tidy. So I have to Read the data into my local copy using the pointer returned. Which I feel is very inefficient. I have just started to play around with defining offset values for each location in the str

Re: [Gambas-user] Memory Stream Help

2011-11-21 Thread Benoît Minisini
Le 20/11/2011 05:42, Randall Morgan a écrit : > Hi All, > > Can someone give me a sample of using memory streams to read and write data > to/from memory. > > I am needing to read data from a C structure allocated by the external > library (tidy) with the pointer returned to Gambas. > > I read the p

Re: [Gambas-user] Memory Stream Help

2011-11-20 Thread Randall Morgan
Thanks, I worked out my issue was I was passing a null pointer to the memory function and then calling my external function. The error I kept getting was a type mismatch and did not make sense to me as the docs led me to believe that the Memory steam was a declaration, not a function on an actual p

Re: [Gambas-user] Memory Stream Help

2011-11-20 Thread Jussi Lahtinen
Sorry, hStream = Memory pPointer For Read Jussi On Sun, Nov 20, 2011 at 16:17, Jussi Lahtinen wrote: > I don't have any simple runnable example right now, so I hope this helps: > > Dim pPointer As Pointer > Dim hStream As Stream > Dim iYourData As Integer > Dim ii As Integer > Dim iNumberOfDat

Re: [Gambas-user] Memory Stream Help

2011-11-20 Thread Jussi Lahtinen
I don't have any simple runnable example right now, so I hope this helps: Dim pPointer As Pointer Dim hStream As Stream Dim iYourData As Integer Dim ii As Integer Dim iNumberOfDataPoints As Integer = x Dim itmp As Integer pPointer = Alloc(SizeOf(gb.Integer), iNumberOfDataPoints) ExternalFunction

[Gambas-user] Memory Stream Help

2011-11-19 Thread Randall Morgan
Hi All, Can someone give me a sample of using memory streams to read and write data to/from memory. I am needing to read data from a C structure allocated by the external library (tidy) with the pointer returned to Gambas. I read the page on external libraries many times before learning the Gamb