亿联网络 招股说明书:在运行vb程序失败后,总提示:无法在 dll kernle32 中找到名为 gettickcount 的 入口点, 该怎么办呢?

来源:百度文库 编辑:高校问答 时间:2024/04/29 03:44:40
目的是得到windows 运行的时间,用的是API函数 gettickcount.代码如下:
private declare function gettickcount lib"kernel32"()_
as long
Public Sub getruntime()
Dim runtime As Integer
Dim hour As Integer
Dim minute As Integer
Dim second As Integer
runtime = gettickcount() \ 1000
hour = runtime \ 3600
runtime = runtime - 3600 * hour
minute = runtime \ 60
second = runtime - 60 * minute
MsgBox("windows运行的时间是:" & Str(hour) & "小时" & Str(minute) & "分钟" & Str(second) & "秒")
End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
getruntime()
End Sub
End Class

你的调用语句写得有问题
正确为:
Declare Function GetTickCount Lib "kernel32" Alias "GetTickCount" () As Long