Results 1 to 4 of 4

Thread: Help: Using GetSystemTime API

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Oct 2000
    Posts
    137

    Angry Help: Using GetSystemTime API

    I need help using GetSystemTime under VB on a WinXP platform:

    When I Declare:
    Public Declare Sub GetSystemTime Lib "kernel32" (lpSystemTime As SYSTEMTIME)

    It gives me an error like:
    "User-defined type not defined", and I beleive that it's reffering to the "As SYSTEMTIME" area.

    Can someone please show me how I could show the current time in a lablel when I press a command button.


    Thanx,
    Mikelo2k

  2. #2
    You did define the type SYSTEMTIME in a module (or general declations section), right?

    Maybe this function is deprecated and XP doesn't support it anymore.

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Oct 2000
    Posts
    137

    Oops!

    No, i didn't know. Could you show me an example of it's use?
    And what to define SYSTEMTIME as, string?

  4. #4
    Megatron
    Guest
    No, SYSTEMTIME is a structure, so you should define it as:
    VB Code:
    1. Private Type SYSTEMTIME
    2.     wYear As Integer
    3.     wMonth As Integer
    4.     wDayOfWeek As Integer
    5.     wDay As Integer
    6.     wHour As Integer
    7.     wMinute As Integer
    8.     wSecond As Integer
    9.     wMilliseconds As Integer
    10. End Type

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width