namespace Siger.ApiQMS.Utility
{
    internal enum vbErrors
    {
        AccessViolation = -2147467261, // -0x7FFFBFFD
        None = 0,
        ReturnWOGoSub = 3,
        IllegalFuncCall = 5,
        Overflow = 6,
        OutOfMemory = 7,
        OutOfBounds = 9,
        ArrayLocked = 10, // 0x0000000A
        DivByZero = 11, // 0x0000000B
        TypeMismatch = 13, // 0x0000000D
        OutOfStrSpace = 14, // 0x0000000E
        ExprTooComplex = 16, // 0x00000010
        CantContinue = 17, // 0x00000011
        UserInterrupt = 18, // 0x00000012
        ResumeWOErr = 20, // 0x00000014
        OutOfStack = 28, // 0x0000001C
        UNDONE = 29, // 0x0000001D
        UndefinedProc = 35, // 0x00000023
        TooManyClients = 47, // 0x0000002F
        DLLLoadErr = 48, // 0x00000030
        DLLBadCallingConv = 49, // 0x00000031
        InternalError = 51, // 0x00000033
        BadFileNameOrNumber = 52, // 0x00000034
        FileNotFound = 53, // 0x00000035
        BadFileMode = 54, // 0x00000036
        FileAlreadyOpen = 55, // 0x00000037
        IOError = 57, // 0x00000039
        FileAlreadyExists = 58, // 0x0000003A
        BadRecordLen = 59, // 0x0000003B
        DiskFull = 61, // 0x0000003D
        EndOfFile = 62, // 0x0000003E
        BadRecordNum = 63, // 0x0000003F
        TooManyFiles = 67, // 0x00000043
        DevUnavailable = 68, // 0x00000044
        PermissionDenied = 70, // 0x00000046
        DiskNotReady = 71, // 0x00000047
        DifferentDrive = 74, // 0x0000004A
        PathFileAccess = 75, // 0x0000004B
        PathNotFound = 76, // 0x0000004C
        ObjNotSet = 91, // 0x0000005B
        IllegalFor = 92, // 0x0000005C
        BadPatStr = 93, // 0x0000005D
        CantUseNull = 94, // 0x0000005E
        UserDefined = 95, // 0x0000005F
        AdviseLimit = 96, // 0x00000060
        BadCallToFriendFunction = 97, // 0x00000061
        CantPassPrivateObject = 98, // 0x00000062
        DLLCallException = 99, // 0x00000063
        DoesntImplementICollection = 100, // 0x00000064
        Abort = 287, // 0x0000011F
        InvalidFileFormat = 321, // 0x00000141
        CantCreateTmpFile = 322, // 0x00000142
        InvalidResourceFormat = 325, // 0x00000145
        InvalidPropertyValue = 380, // 0x0000017C
        InvalidPropertyArrayIndex = 381, // 0x0000017D
        SetNotSupportedAtRuntime = 382, // 0x0000017E
        SetNotSupported = 383, // 0x0000017F
        NeedPropertyArrayIndex = 385, // 0x00000181
        SetNotPermitted = 387, // 0x00000183
        GetNotSupportedAtRuntime = 393, // 0x00000189
        GetNotSupported = 394, // 0x0000018A
        PropertyNotFound = 422, // 0x000001A6
        NoSuchControlOrProperty = 423, // 0x000001A7
        NotObject = 424, // 0x000001A8
        CantCreateObject = 429, // 0x000001AD
        OLENotSupported = 430, // 0x000001AE
        OLEFileNotFound = 432, // 0x000001B0
        OLENoPropOrMethod = 438, // 0x000001B6
        OLEAutomationError = 440, // 0x000001B8
        LostTLB = 442, // 0x000001BA
        OLENoDefault = 443, // 0x000001BB
        ActionNotSupported = 445, // 0x000001BD
        NamedArgsNotSupported = 446, // 0x000001BE
        LocaleSettingNotSupported = 447, // 0x000001BF
        NamedParamNotFound = 448, // 0x000001C0
        ParameterNotOptional = 449, // 0x000001C1
        FuncArityMismatch = 450, // 0x000001C2
        NotEnum = 451, // 0x000001C3
        InvalidOrdinal = 452, // 0x000001C4
        InvalidDllFunctionName = 453, // 0x000001C5
        CodeResourceNotFound = 454, // 0x000001C6
        CodeResourceLockError = 455, // 0x000001C7
        DuplicateKey = 457, // 0x000001C9
        InvalidTypeLibVariable = 458, // 0x000001CA
        ObjDoesNotSupportEvents = 459, // 0x000001CB
        InvalidClipboardFormat = 460, // 0x000001CC
        IdentNotMember = 461, // 0x000001CD
        ServerNotFound = 462, // 0x000001CE
        ObjNotRegistered = 463, // 0x000001CF
        InvalidPicture = 481, // 0x000001E1
        PrinterError = 482, // 0x000001E2
        CantSaveFileToTemp = 735, // 0x000002DF
        SearchTextNotFound = 744, // 0x000002E8
        LastTrappable = 746, // 0x000002EA
        ReplacementsTooLong = 746, // 0x000002EA
        NotYetImplemented = 32768, // 0x00008000
        SeekErr = 32771, // 0x00008003
        ReadFault = 32772, // 0x00008004
        WriteFault = 32773, // 0x00008005
        BadFunctionId = 32774, // 0x00008006
        FileLockViolation = 32775, // 0x00008007
        ShareRequired = 32789, // 0x00008015
        BufferTooSmall = 32790, // 0x00008016
        InvDataRead = 32792, // 0x00008018
        UnsupFormat = 32793, // 0x00008019
        RegistryAccess = 32796, // 0x0000801C
        LibNotRegistered = 32797, // 0x0000801D
        Usage = 32799, // 0x0000801F
        UndefinedType = 32807, // 0x00008027
        QualifiedNameDisallowed = 32808, // 0x00008028
        InvalidState = 32809, // 0x00008029
        WrongTypeKind = 32810, // 0x0000802A
        ElementNotFound = 32811, // 0x0000802B
        AmbiguousName = 32812, // 0x0000802C
        ModNameConflict = 32813, // 0x0000802D
        UnknownLcid = 32814, // 0x0000802E
        BadModuleKind = 35005, // 0x000088BD
        NoContainingLib = 35009, // 0x000088C1
        BadTypeId = 35010, // 0x000088C2
        BadLibId = 35011, // 0x000088C3
        Eof = 35012, // 0x000088C4
        SizeTooBig = 35013, // 0x000088C5
        ExpectedFuncNotModule = 35015, // 0x000088C7
        ExpectedFuncNotRecord = 35016, // 0x000088C8
        ExpectedFuncNotProject = 35017, // 0x000088C9
        ExpectedFuncNotVar = 35018, // 0x000088CA
        ExpectedTypeNotProj = 35019, // 0x000088CB
        UnsuitableFuncPropMatch = 35020, // 0x000088CC
        BrokenLibRef = 35021, // 0x000088CD
        UnsupportedTypeLibFeature = 35022, // 0x000088CE
        ModuleAsType = 35024, // 0x000088D0
        InvalidTypeInfoKind = 35025, // 0x000088D1
        InvalidTypeLibFunction = 35026, // 0x000088D2
        OperationNotAllowedInDll = 40035, // 0x00009C63
        CompileError = 40036, // 0x00009C64
        CantEvalWatch = 40037, // 0x00009C65
        MissingVbaTypeLib = 40038, // 0x00009C66
        UserReset = 40040, // 0x00009C68
        MissingEndBrack = 40041, // 0x00009C69
        IncorrectTypeChar = 40042, // 0x00009C6A
        InvalidNumLit = 40043, // 0x00009C6B
        IllegalChar = 40044, // 0x00009C6C
        IdTooLong = 40045, // 0x00009C6D
        StatementTooComplex = 40046, // 0x00009C6E
        ExpectedTokens = 40047, // 0x00009C6F
        InconsistentPropFuncs = 40067, // 0x00009C83
        CircularType = 40068, // 0x00009C84
        FileNotFoundWithName = 40243, // 0x00009D33
        CantFindDllEntryPoint = 59201, // 0x0000E741
    }

    public enum CompareMethod
    {
        Binary,
        Text,
    }

    /// <summary>指示由 <see langword="VarType" /> 函数返回的变量对象的类型。</summary>
    public enum VariantType
    {
        Empty = 0,
        Null = 1,
        Short = 2,
        Integer = 3,
        Single = 4,
        Double = 5,
        Currency = 6,
        Date = 7,
        String = 8,
        Object = 9,
        Error = 10, // 0x0000000A
        Boolean = 11, // 0x0000000B
        Variant = 12, // 0x0000000C
        DataObject = 13, // 0x0000000D
        Decimal = 14, // 0x0000000E
        Byte = 17, // 0x00000011
        Char = 18, // 0x00000012
        Long = 20, // 0x00000014
        UserDefinedType = 36, // 0x00000024
        Array = 8192, // 0x00002000
    }
}
