|
-
June 2nd, 1999, 03:01 AM
#1
how to use the winapi32 in VB
How to use the winapi32 function GetSystemTime in VB?
public Declare Sub GetSystemTime Lib "kernel32" (lpSystemTime as SYSTEMTIME)
public 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
Sub main()
Dim d as SYSTEMTIME
GetSystemTime (d)
MsgBox sp
End Sub
There is a compilation error when i run it
Compile error:
Variable required - can't assign to this expression
please help
Thanks!
-
June 2nd, 1999, 03:47 AM
#2
Re: how to use the winapi32 in VB
See my reply to your question in another thread.
This is because of the funny way in which VB interprets (). It means "evaluate this first"
The way out is
1. Use Call, like
Call GetSytemTime(d) ' Works fine
2.Or remove (). Just say
GetSytemTime d
Ravi
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|