Hi Jorge,

Note that the VB type Integer maps to the MapBasic type SmallInt, not
Integer.

Best regards / Med venlig hilsen
Lars V. Nielsen
--------------------------------------------------------
Hvenegaard & Meklenborg
Rugaardsvej 55, DK-5000 Odense C
Denmark
http://www.hvm.dk
----- Original Message -----
From: "Jorge Cordero" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, October 10, 2003 1:06 AM
Subject: MI-L GetLocalTime




I am using the API of Windows: GetLocalTime  in MapBasic, the problem that I
have when I use east tool the values that return, are not are expected,
returns a series of rare numbers. Somebody knows as it is the reason


Attach source in MapBasic and source in VB where GetLocalTime works
correctly

MapBasic Code:
Include "MapBasic.Def"

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
Declare Sub GetLocalTime Lib "Kernel32" (lpSystemTime As SYSTEMTIME)
Declare Sub Main

'*************************************
Sub Main
 Dim MyTime AS SYSTEMTIME
 Call GetLocalTime(MyTime)
 Print "Date Is " + MyTime.WDay
 Print "Month Is " + MyTime.WMonth
 Print "Year Is " + MyTime.wYear

End Sub

This Source Returns:        Date: 36044834
                                     Month: 524291
                                     Year: 657363
That they are these numbers  !!!!!!!!!!!!!!!!


VB Code

Private Declare Sub GetLocalTime 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()
    Dim MyTime As SYSTEMTIME
    'Set the graphical mode to persistent
    Me.AutoRedraw = True
    'Get the local time
    GetLocalTime MyTime
    'Print it to the form
    Me.Print "The Local Date is:" & MyTime.wMonth & "-" & MyTime.wDay & "-"
& MyTime.wYear

End Sub

This Source Returns: The Local Date is: 10 - 8 - 2003



T.S.U.I Jorge Eduardo Cordero Rodriguez
Desarrollador GIS
Sistemas de Imagenes y Datos S.A. de C.V.
(01 55) 56 61 10 88
M�xico DF
www.mapdata.com.mx; www.geovoto.com.mx; www.gobtec.com.mx
[EMAIL PROTECTED]


---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Message number: 8704

Reply via email to