When the data was stored the code created a safearray of bytes and the raw data is copied from the C array of double. If you fetch the value and get a pointer to the raw byte safearray data, then you can convert that to a array of double values and operate on this version of the data.
Some VB code might look like this:
Private Function ConvertByteData(RawData As Variant, vtToType As eDataTypes) As Variant
Dim i As Integer
Dim offset As Integer
Dim upperBound As Long
Dim Size As Integer
Dim b(8) As Byte
Dim dDouble() As Double
Dim fFloat() As Single
Dim sShort() As Integer
Dim lLong() As Long
Dim vtData As Variant
upperBound = UBound(RawData)
'upperBound is zero based, so add 1 before doing calc
're-dim to actual number of elements
Select Case vtToType
Case kInt
Size = 2
ReDim sShort((upperBound + 1) \ Size - 1)
Case kLong
Size = 4
ReDim lLong((upperBound + 1) \ Size - 1)
Case kFloat
Size = 4
ReDim fFloat((upperBound + 1) \ Size - 1)
Case kDouble
Size = 8
ReDim dDouble((upperBound + 1) \ Size - 1)
End Select
'copy data from source to destination
For offset = 0 To upperBound Step Size
'move each btye to local variable, cannot do memcpy from variant
For i = 0 To Size - 1
b(i) = RawData(offset + i)
Next i
Select Case vtToType
Case kInt
CopyMemory sShort(offset \ Size), b(0), Size
Case kLong
CopyMemory lLong(offset \ Size), b(0), Size
Case kFloat
CopyMemory fFloat(offset \ Size), b(0), Size
Case kDouble
CopyMemory dDouble(offset \ Size), b(0), Size
End Select
Next offset
Select Case vtToType
Case kInt
ConvertByteData = sShort
Case kLong
ConvertByteData = lLong
Case kFloat
ConvertByteData = fFloat
Case kDouble
ConvertByteData = dDouble
End Select
End Function
Scott Richardson