求将2个VB函数转成VC代码 接口不能改动
VB代码,需要改成VC代码DLL供VB调用,去掉中间简单的剩下的关键代码, 接口不能改动。
'打印函数 二进制打印到流文件
Public Sub WriteEntry1(ByRef BW As BinaryWriter, ByVal StartSample As UInt32, ByVal EndSample As UInt32, ByRef TextString As String)
BW.Write(StartSample)
BW.Write(EndSample)
Dim tStrLen As UInt32 '长度包括字符串末尾的0
tStrLen = CUInt(TextString.Length + 1)
BW.Write(tStrLen)
For x As Integer = 0 To CInt(tStrLen - 2)
BW.Write(CByte(Asc(TextString.Chars(x))))
Next
BW.Write(CByte(0))
End Sub
'创建流文件和打印
Public Sub DecodeCustom1(ByVal OutFilename As String, ByVal NumberOfSamples As Integer, ByVal RateIndex As Byte, ByVal Parameters As String)
'流文件
Dim FS As New FileStream(OutFilename, FileMode.Append, FileAccess.Write)
Dim BW As New BinaryWriter(FS)
Dim va As ULong’测试
Dim str As String
va = 100
str = "hello"
WriteEntry(BW, 3000, 3500, CStr(va))
WriteEntry(BW, 7000, 7500, str)
End Sub