Pulic Declare Function Float_Hex Lib "YourDll.dll"(Byval fFloat as Single) As String
Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (Destination As Any, Source As Any, ByVal Length As Long) declare function Float_hex(byval fFloat as single) as longdim lpBuf as long dim s as string * 8 lpBuf=Float_hex(123.32423) copymemory byval s,byval lpBuf,8 debug.print s
TO supergreenbean(超级绿豆(MS MVP - VB) - 暑去冬来,该吃补药了……) 你的方法我试过了 但是结果一些乱码 我该在哪里处理一下呢??
1 必须标准调用:char * __stdcall Float_Hex(float fFloat) 2 声明: Public Declare Function Float_Hex(Byval fFloat As Single) As String3 Dim strHex As String * 16strHex = Float_Hex(1234)不过,一般的调用规范是: int __stdcall Float_Hex(float fFloat, char * cHex) Public Declare Function Float_Hex(Byval fFloat As Single, cHex As String) As LongDim Ret As Long, strHex As String * 16Ret = Float_Hex(12345, strHex)
declare function Float_hex(byval fFloat as single) as longdim lpBuf as long
dim s as string * 8
lpBuf=Float_hex(123.32423)
copymemory byval s,byval lpBuf,8
debug.print s
你的方法我试过了 但是结果一些乱码 我该在哪里处理一下呢??
Public Declare Function Float_Hex(Byval fFloat As Single) As String3
Dim strHex As String * 16strHex = Float_Hex(1234)不过,一般的调用规范是:
int __stdcall Float_Hex(float fFloat, char * cHex)
Public Declare Function Float_Hex(Byval fFloat As Single, cHex As String) As LongDim Ret As Long, strHex As String * 16Ret = Float_Hex(12345, strHex)