BDG Scenario 3

Global.bas

Attribute VB_Name = "Global"
Option Explicit

'**********************************
'**  Constant Definitions:

Public Const TIME_NOSECONDS& = &H2
Public Const TIME_NOTIMEMARKER& = &H4
Public Const TIME_FORCE24HOURFORMAT& = &H8

Public Const DATE_LONGDATE& = &H2
Public Const DATE_SHORTDATE& = &H1

Public Const ERROR_INSUFFICIENT_BUFFER& = 122
Public Const ERROR_INVALID_FLAGS& = 1004&
Public Const ERROR_INVALID_PARAMETER& = 87

Public Const FORMAT_MESSAGE_ALLOCATE_BUFFER& = &H100
Public Const FORMAT_MESSAGE_ARGUMENT_ARRAY& = &H2000
Public Const FORMAT_MESSAGE_FROM_HMODULE& = &H800
Public Const FORMAT_MESSAGE_FROM_STRING& = &H400
Public Const FORMAT_MESSAGE_FROM_SYSTEM& = &H1000
Public Const FORMAT_MESSAGE_IGNORE_INSERTS& = &H200
Public Const FORMAT_MESSAGE_MAX_WIDTH_MASK& = &HFF

'**********************************
'**  Type Definitions:

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

Public Type TIME_ZONE_INFORMATION
        Bias As Long
        StandardName As String * 64
        StandardDate As SYSTEMTIME
        StandardBias As Long
        DaylightName As String * 64
        DaylightDate As SYSTEMTIME
        DaylightBias As Long
End Type

Public Type NUMBERFMT
    NumDigits As Long
    LeadingZero As Long
    Grouping As Long
    lpDecimalSep As String
    lpThousandSep As String
    NegativeOrder As Long
End Type

Public Type CURRENCYFMT
    NumDigits As Long
    LeadingZero As Long
    Grouping As Long
    lpDecimalSep As String
    lpThousandSep As String
    NegativeOrder As Long
    PositiveOrder As Long
    lpCurrencySymbol As String
End Type


'**********************************
'**  Function Declarations:

Public Declare Function GetTimeZoneInformation& Lib "kernel32" (lpTimeZoneInformation As TIME_ZONE_INFORMATION)
Public Declare Function GetTimeFormat& Lib "kernel32" Alias "GetTimeFormatA" _
        (ByVal Locale As Long, ByVal dwFlags As Long, lpTime As SYSTEMTIME, _
        ByVal lpFormat As Long, ByVal lpTimeStr As String, ByVal cchTime As Long)
Public Declare Function GetDateFormat& Lib "kernel32" Alias "GetDateFormatA" (ByVal Locale As Long, ByVal dwFlags As Long, lpDate As SYSTEMTIME, ByVal lpFormat As String, ByVal lpDateStr As String, ByVal cchDate As Long)
Public Declare Function GetNumberFormat& Lib "kernel32" Alias "GetNumberFormatA" (ByVal Locale As Long, ByVal dwFlags As Long, ByVal lpValue As String, lpFormat As NUMBERFMT, ByVal lpNumberStr As String, ByVal cchNumber As Long)
Public Declare Function GetCurrencyFormat& Lib "kernel32" Alias "GetCurrencyFormatA" (ByVal Locale As Long, ByVal dwFlags As Long, ByVal lpValue As String, lpFormat As CURRENCYFMT, ByVal lpCurrencyStr As String, ByVal cchCurrency As Long)
Public Declare Function GetLastError& Lib "kernel32" ()

Public Declare Function ntFormatMessage& Lib "kernel32" Alias "FormatMessageA" (ByVal dwFlags As Long, lpSource As Any, ByVal dwMessageId As Long, ByVal dwLanguageId As Long, ByVal lpBuffer As String, ByVal nSize As Long, Arguments As Long)
Public Declare Function ntGetLocaleInfo& Lib "kernel32" Alias "GetLocaleInfoA" (ByVal Locale As Long, ByVal LCType As Long, ByVal lpLCData As String, ByVal cchData As Long)
Public Declare Function ntIsValidCodePage& Lib "kernel32" Alias "IsValidCodePage" (ByVal CodePage As Long)
Public Declare Function ntIsValidLocale& Lib "kernel32" Alias "IsValidLocale" (ByVal Locale As Long, ByVal dwFlags As Long)
Public Declare Function ntGetACP& Lib "kernel32" Alias "GetACP" ()
Public Declare Function ntConvertDefaultLocale& Lib "kernel32" Alias "ConvertDefaultLocale" (ByVal Locale As Long)
Public Declare Function ntGetSystemDefaultLangID% Lib "kernel32" Alias "GetSystemDefaultLangID" ()
Public Declare Function ntGetSystemDefaultLCID& Lib "kernel32" Alias "GetSystemDefaultLCID" ()
Public Declare Sub ntGetSystemTime Lib "kernel32" Alias "GetSystemTime" (lpSystemTime As SYSTEMTIME)