Hello,

I use this Type declaration for SYSTEMTIME. As you can see I use SmallInt in
stead of Integer. Maybe the Integers might cause some problem

Type SYSTEMTIME
        wYear           As SmallInt
        wMonth          As SmallInt
        wDayOfWeek      As SmallInt
        wDay            As SmallInt
        wHour           As SmallInt
        wMinute As SmallInt
        wSecond As SmallInt
        wMilliSeconds   As SmallInt
End Type

Peter Horsb�ll M�ller
GIS Developer
Geographical Information & IT
 
COWI A/S
Rug�rdsvej 55
DK-5000 Odense
Denmark
 
Tel     +45 6313 5013
Direct  +45 6313 5008
Mob     +45 5156 1045
Fax     +45 6313 5090
E-mail  [EMAIL PROTECTED]
http://www.cowi.dk


> -----Original Message-----
> From: Jorge Cordero [mailto:[EMAIL PROTECTED] 
> Sent: Friday, October 10, 2003 1:06 AM
> To: [EMAIL PROTECTED]
> 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: 8696

Reply via email to