"byref参数类型不符"是哪错了,该如何解决
"byref参数类型不符"是哪错了
dim i as long
For i = j * 256 To SectionNumbers - 1
New_Section (i)
New_Data_Desc (i)
'最后块
' If (j < Sub_Table_Num) Then
Ts_Data(i).Last_Section_Number = SectionNumbers
Ts_Data(i).Section_Number = i
' Else
' Ts_Data(i).Last_Section_Number = SectionNumbers Mod 256
' End If
'描述符长度
Ts_Soft_Desc(i).Descriptor_Length = 11 'byte
Ts_Soft_Desc(i).Last_Table_Id = Sub_Table_Num '最后的表的ID
Ts_Soft_Desc(i).Software_Size = FileLength '文件长度
Ts_Soft_Desc(i).Software_CRC = fCRC32 '文件CRC32
Ts_Data(i).TS_Descriptor = Ts_Soft_Desc(i)
'下载符长度
Ts_Data(i).Descriptor_Loop_Length = 13
'字段长度
Ts_Data(i).Section_Length = 7 + 13 + Payload_Data_Length + 4 '24byte+数据长度
Ts_Data(i).Sub_Table_ID = 0
For k = ilen To (Payload_Data_Length * (i + 1)) - 1
DoEvents
Seek #1, k + 1
Get #1, , sbyte
Ts_Data(i).Payload_Data(k - Payload_Data_Length * i) = sbyte
Next
SectionCRC i, lCRC32 '这里提示"byref参数类型不符",如何改正?
Ts_Data(i).TS_Descriptor.Software_CRC = lCRC32
ilen = ilen + Payload_Data_Length
Next
'得到Section的CRC值
Public Sub SectionCRC(k As long, Optional rResult As Long)
Dim myByte(0 To 3094) As Byte
myByte(0) = FristByte(Ts_Data(k).Table_Id)
myByte(1) = SecondByte(Ts_Data(k).Section_Syntax_Indicator, Ts_Data(k).Reserved_Feature_Use3, Ts_Data(k).Section_Length)
myByte(2) = ThirdByte(Ts_Data(k).Section_Length)
myByte(3) = FourthByte(Ts_Data(k).Reserved_Feature_Use11)
myByte(4) = FifthByte(Ts_Data(k).Reserved_Feature_Use11, Ts_Data(k).Sub_Table_ID)
myByte(5) = SixthByte(Ts_Data(k).Reserved_Feature_Use2, Ts_Data(k).Version_Number, Ts_Data(k).Current_Next_Indicator)
myByte(6) = SeventhByte(Ts_Data(k).Section_Number)
myByte(7) = EighthByte(Ts_Data(k).Last_Section_Number)
myByte(8) = NinthByte(Ts_Data(k).Reserved_Feature_Use4, Ts_Data(k).Descriptor_Loop_Length)
myByte(9) = TenthByte(Ts_Data(k).Descriptor_Loop_Length)
myByte(10) = Desc_1Byte(Ts_Data(k).TS_Descriptor.Descriptor_Tag)
myByte(11) = Desc_2Byte(Ts_Data(k).TS_Descriptor.Descriptor_Length)
myByte(12) = Desc_3Byte(Ts_Data(k).TS_Descriptor.Software_Version)
myByte(13) = Desc_4Byte(Ts_Data(k).TS_Descriptor.Software_Version)
myByte(14) = Desc_5Byte(Ts_Data(k).TS_Descriptor.Software_Size)
myByte(15) = Desc_6Byte(Ts_Data(k).TS_Descriptor.Software_Size)
myByte(16) = Desc_7Byte(Ts_Data(k).TS_Descriptor.Software_Size)
myByte(17) = Desc_8Byte(Ts_Data(k).TS_Descriptor.Software_Size)
myByte(18) = Desc_9Byte(Ts_Data(k).TS_Descriptor.Software_CRC)
dim i as long
For i = j * 256 To SectionNumbers - 1
New_Section (i)
New_Data_Desc (i)
'最后块
' If (j < Sub_Table_Num) Then
Ts_Data(i).Last_Section_Number = SectionNumbers
Ts_Data(i).Section_Number = i
' Else
' Ts_Data(i).Last_Section_Number = SectionNumbers Mod 256
' End If
'描述符长度
Ts_Soft_Desc(i).Descriptor_Length = 11 'byte
Ts_Soft_Desc(i).Last_Table_Id = Sub_Table_Num '最后的表的ID
Ts_Soft_Desc(i).Software_Size = FileLength '文件长度
Ts_Soft_Desc(i).Software_CRC = fCRC32 '文件CRC32
Ts_Data(i).TS_Descriptor = Ts_Soft_Desc(i)
'下载符长度
Ts_Data(i).Descriptor_Loop_Length = 13
'字段长度
Ts_Data(i).Section_Length = 7 + 13 + Payload_Data_Length + 4 '24byte+数据长度
Ts_Data(i).Sub_Table_ID = 0
For k = ilen To (Payload_Data_Length * (i + 1)) - 1
DoEvents
Seek #1, k + 1
Get #1, , sbyte
Ts_Data(i).Payload_Data(k - Payload_Data_Length * i) = sbyte
Next
SectionCRC i, lCRC32 '这里提示"byref参数类型不符",如何改正?
Ts_Data(i).TS_Descriptor.Software_CRC = lCRC32
ilen = ilen + Payload_Data_Length
Next
'得到Section的CRC值
Public Sub SectionCRC(k As long, Optional rResult As Long)
Dim myByte(0 To 3094) As Byte
myByte(0) = FristByte(Ts_Data(k).Table_Id)
myByte(1) = SecondByte(Ts_Data(k).Section_Syntax_Indicator, Ts_Data(k).Reserved_Feature_Use3, Ts_Data(k).Section_Length)
myByte(2) = ThirdByte(Ts_Data(k).Section_Length)
myByte(3) = FourthByte(Ts_Data(k).Reserved_Feature_Use11)
myByte(4) = FifthByte(Ts_Data(k).Reserved_Feature_Use11, Ts_Data(k).Sub_Table_ID)
myByte(5) = SixthByte(Ts_Data(k).Reserved_Feature_Use2, Ts_Data(k).Version_Number, Ts_Data(k).Current_Next_Indicator)
myByte(6) = SeventhByte(Ts_Data(k).Section_Number)
myByte(7) = EighthByte(Ts_Data(k).Last_Section_Number)
myByte(8) = NinthByte(Ts_Data(k).Reserved_Feature_Use4, Ts_Data(k).Descriptor_Loop_Length)
myByte(9) = TenthByte(Ts_Data(k).Descriptor_Loop_Length)
myByte(10) = Desc_1Byte(Ts_Data(k).TS_Descriptor.Descriptor_Tag)
myByte(11) = Desc_2Byte(Ts_Data(k).TS_Descriptor.Descriptor_Length)
myByte(12) = Desc_3Byte(Ts_Data(k).TS_Descriptor.Software_Version)
myByte(13) = Desc_4Byte(Ts_Data(k).TS_Descriptor.Software_Version)
myByte(14) = Desc_5Byte(Ts_Data(k).TS_Descriptor.Software_Size)
myByte(15) = Desc_6Byte(Ts_Data(k).TS_Descriptor.Software_Size)
myByte(16) = Desc_7Byte(Ts_Data(k).TS_Descriptor.Software_Size)
myByte(17) = Desc_8Byte(Ts_Data(k).TS_Descriptor.Software_Size)
myByte(18) = Desc_9Byte(Ts_Data(k).TS_Descriptor.Software_CRC)