Click here to Skip to main content
15,880,956 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
A call to PInvoke function CopyMemory; has unbalanced the stack. This is likely because the managed PInvoke signature does not match the unmanaged target signature. Check that the calling convention and parameters of the PInvoke signature match the target unmanaged signature.

here is my code


Private Declare Sub CopyMemory Lib "Kernel32" Alias "RtlMoveMemory" (ByRef Destination As Object, ByRef Source As Object, ByVal numbytes As Long)

Public Function BytesToDouble(ByVal TheArray() As Byte) As Double
'This function combines array of 8 bytes to a Double number - Format Little Endian
Dim TempLong As Double

Call CopyMemory(TempLong, TheArray(LBound(TheArray)), 8)
BytesToDouble = TempLong

End Function
Posted

1 solution

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900