调用GetsystemTime是参数出错,怎么解决?

baibo365 2002-11-07 12:07:41
调用GetSystemTime(lpsystemtime SYSTEMTIME)时用(SYSTEMTIME结构已定义无错)
dim timeVal As SYSTEMTIME
GetSystemTime(timeVal)提示参数timeVal错误,如何解决?
...全文
281 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
Sean918 2002-11-07
  • 打赏
  • 举报
回复
【函数】
GetSystemTime

【操作系统】
Win9X:Yes
WinNT:Yes

【声明】
GetSystemTime Lib "kernel32" Alias "GetSystemTime" (lpSystemTime As SYSTEMTIME)As Boolean

【说明】

在一个SYSTEMTIME中载入当前系统时间,这个时间采用的是“协同世界时间”(即UTC,也叫做GMT)格式

【返回值】


【其它】


【参数表】
lpSystemTime --- SYSTEMTIME,随同当前时间载入的结构



Private Declare Sub GetSystemTime Lib "kernel32" (lpSystemTime As SYSTEMTIME)
Private Type SYSTEMTIME
wYear As Integer
wMonth As Integer
wDayOfWeek As Integer
wDay As Integer
wHour As Integer
wMinute As Integer
wSecond As Integer
wMilliseconds As Integer
End Type
Private Sub Form_Load()
'KPDTeam@Allapi.net
Dim SysTime As SYSTEMTIME
'Set the graphical mode to persistent
Me.AutoRedraw = True
'Get the system time
GetSystemTime SysTime
'Print it to the form
Me.Print "The System Date is:" & SysTime.wMonth & "-" & SysTime.wDay & "-" & SysTime.wYear
Me.Print "The System Time is:" & SysTime.wHour & ":" & SysTime.wMinute & ":" & SysTime.wSecond
End Sub
holydiablo 2002-11-07
  • 打赏
  • 举报
回复
不是GetSystemTime(timeVal)
而是GetSystemTime timeVal,要么就是call GetSystemTime(timeVal)
GetSystemTime是没有返回值的,所以GetSystemTime(timeVal)语法错误

1,486

社区成员

发帖
与我相关
我的任务
社区描述
VB API
社区管理员
  • API
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧