From: Su Zhang Date: 2011-05-18T05:00:51+09:00 Subject: Re: Sharing data between ruby and a custom dll with Win32API Hi Futar, I suppose you are using 'p' as the return type specifier of Win32API; this is interpreted as a pointer to a null-terminated string.Therefore, any null byte in your array of floats will mark the end of the "string" buffer. In this case, I think you can simply reference the same buffer you pass to @getkaplamatrix. matrix2 = matrix.pack("f*") @getKaplaMatrix.call(index, matrix2) matrix3 = matrix2.unpack("f*") And if you really do need to return a reference to something, you will often have to return it as an integer address and manipulate (reference and dereference) it through native interfaces such as RtlMoveMemory. Su -- Posted via http://www.ruby-forum.com/.