Private Function DELtime() '------------------------- 删除 ------------------------
Dim fb() As Byte
Dim fl As Long
Dim pkc As Long
Dim OLDBT As Long
Dim OLDBT1 As Long
Dim fs() As Byte
Dim fe() As Byte
Dim EPD1 As Byte '结束点的位置1(十六进制)
Dim EPD2 As Byte '结束点的位置2(十六进制)
Dim SPD1 As Byte '开始点的位置1(十六进制)
Dim SPD2 As Byte '开始点的位置2(十六进制)
Dim sp As Long
Dim ep As Long
Dim SpTime As Long
SpTime = CLng(DelStarTime)
Dim EpTime As Long
EpTime = CLng(DelEndTime)
fl = FileLen(FileNameText)
pkc = (fl - 52) / 528
ReDim fb(fl - 1)
'读取文件数据
Open FileNameText For Binary As #1
Get #1, , fb
Close #1
For L = 0 To pkc - 1
If SpTime = fb(L * 528 + 53) * &H100 + fb(L * 528 + 52) Then
sp = (L + 1) * 528 + 51
Exit For
End If
Next L
For L = 0 To pkc - 1
If EpTime = fb(L * 528 + 53) * &H100 + fb(L * 528 + 52) Then
ep = L * 528 + 52
Exit For
End If
Next L
ReDim fs(sp)
ReDim fe(fl - ep - 1)
CopyMemory fs(0), fb(0), sp '用COPY内存方法将FB()内容转到FS
CopyMemory fe(0), fb(ep), fl - 1 - ep '用COPY内存方法将FB()内容转到FE
For I = L To pkc - 1
OLDBT1 = fb(I * 528 + 53) * &H100 + fb(I * 528 + 52) - (EpTime - SpTime)
fe(I * 528 + 52 - ep) = OLDBT1 Mod &H100
fe(I * 528 + 53 - ep) = OLDBT1 \ &H100
Next I
Open FileNameText + ".zz" For Binary As #1
Put #1, , fs
Put #1, , fe
Close #1
DeleteFile FileNameText
CopyFile FileNameText + ".zz", FileNameText, False
DeleteFile FileNameText + ".zz"
Erase fb
Erase fs
Erase fe
MsgBox "OK"
End Function
Private Sub Command3_Click()
DelStarTime = 29284
DelEndTime = 31404
DELtime
End Sub
VB 使用CopyMemory 时,提示子程序或函数未定义.代码如下
答案:1 悬赏:80 手机版
解决时间 2021-02-28 01:52
- 提问者网友:末路
- 2021-02-27 03:24
最佳答案
- 五星知识达人网友:鸠书
- 2021-02-27 03:58
CopyMemory是一个WindowsAPI函数,并非VB内置函数,使用前要进行声明.声明语句如下:
Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (Destination As Any, Source As Any, ByVal Length As Long)
Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (Destination As Any, Source As Any, ByVal Length As Long)
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯