TIME_ZONE_INFORMATION

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
I have following problem in my VB6 project:
Im trying to read certain Time Zone information from Registry (HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindows NTCurrentVersionTime Zones<the zone>).

I use WMI to create objRegistry object and I am executing objRegistry.GetBinaryValue to get "TZI" value:
iRet=objRegistry.GetBinaryValue(HKEY_LOCAL_MACHINE, "SOFTWAREMicrosoftWindows NTCurrentVersionTime Zones<the zone>", "TZI", aTZI). aTZI variant becomes an array of 44 bytes.

I also have defined a user types and a variable:
Public Type SYSTEMTIME<br/>
wYear As Integer<br/>
wMonth As Integer<br/>
wDayOfWeek As Integer<br/>
wDay As Integer<br/>
wHour As Integer<br/>
wMinute As Integer<br/>
wSecond As Integer<br/>
wMilliseconds As Integer<br/>
End Type
Public Type TIME_ZONE_INFORMATION<br/>
Bias As Long<br/>
StandardName(0 To 63) As Byte <br/>
StandardDate As SYSTEMTIME<br/>
StandardBias As Long<br/>
DaylightName(0 To 63) As Byte <br/>
DaylightDate As SYSTEMTIME<br/>
DaylightBias As Long<br/>
End Type

Public zoneTZI As TIME_ZONE_INFORMATION

How can I get aTZI into zoneTZI, so that I can read each element of the zone?
Whatever I try to do gets me an error "Only user-defined in public object modues can be coerced to or from a variant pr passed to late-bound functions"
Every suggestion will be appreciated.
Thanks!
<br/>

View the full article
 
Back
Top