From: Aaron Patterson Date: 2009-08-15T02:32:07+09:00 Subject: Re: Ruby/DL question On Fri, Aug 14, 2009 at 01:43:24PM +0900, Gin Mendi wrote: > Aaron Patterson wrote: > > On Thu, Aug 13, 2009 at 07:06:51PM +0900, Gin Mendi wrote: > >> { > >> MY_CALLBACK = DL.callback('0PL') { |result_list, count| > >> next record? > > Result list should always be a pointer to a pointer, right? If that is > > the case, you need to create a struct of size count that contains that > > array. > > > > From the new list struct, you should be able to access each MyStruct. > > I'm not so sure how I should exactly implement this. Been researching > online and trying out stuff with the code but haven't gotten any luck. > > I first tried creating a structure that just contains an array: > > ResultList = struct [ > "PVOID list[]" > ] > > and then using this with resultList > > rl = ResultList.new(resultList) > > but this doesn't seem to work for me. > > How should I exactly use resultList to get the array of records (I'm > assuming it's always an array of records). Right now the previous code i > posted just captures the first record and puts it in my structure > properly. Still can't get the other records. Hmmm. You wouldn't happen to have some sample C code I could compile and try accessing with DL? > Thanks for reply! :) No problem! I'm happy to help solve this, but I want to make sure we're on the same page. :-) -- Aaron Patterson http://tenderlovemaking.com/