
Module Globals
    Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Integer, ByVal hWndInsertAfter As Integer, ByVal X As Integer, ByVal Y As Integer, ByVal cx As Integer, ByVal cy As Integer, ByVal wFlags As Integer) As Integer

    Declare Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA" (ByVal lpbuffer As String, ByRef nSize As Integer) As Integer

    Declare Function GetLocaleInfo Lib "kernel32" Alias "GetLocaleInfoA" (ByVal Locale As Integer, ByVal LCType As Integer, ByVal lpLCData As String, ByVal cchData As Integer) As Integer

    Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Integer) '11/30/2005 ccprestr PR5342372

    Public Const LOCALE_SENGLANGUAGE As Short = &H1001S
    Public Const LOCALE_ENGLISH As Short = &H409S
    Public Const LOCALE_USER_DEFAULT As Short = &H400S

    ' window position constants
    Public Const HWND_TOPMOST As Short = -1
    Public Const SWP_NOACTIVATE As Short = &H10S
    Public Const SWP_SHOWWINDOW As Short = &H40S
    Public Const SWP_HIDEWINDOW As Short = &H80S
    Public Const SWP_NOZORDER As Short = &H4S
    Public Const SWP_NOMOVE As Short = &H2S
    Public Const SWP_NOREPOSITION As Short = &H200S
    Public Const SWP_NOSIZE As Short = &H1S

    ' global data structures and variables
    Public SEData() As SELibrary
    Public SECurrent As Current
    Public strDataFile As String
    Public intFirstTab As Short
    Public intCurrentTab As Short
    Public intTotalTabs As Short

    Public objApp As SolidEdgeFramework.Application
    Public objDoc As SolidEdgePart.PartDocument
    Public objVariables As SolidEdgeFramework.Variables
    'Public objParts As SolidEdgeAssembly.Occurrences
    Public objParts As Object
    ' Global objApp As Object
    'Dim WithEvents objFileUIEvents As SolidEdgeFramework.ISEFileUIEvents_Event

    Public intCurrentPartID As Short
    Public intTypeID As Short
    Public intLastTypeID As Short
    Public intParts As Short
    Public strGlobalPath As String
    Public intVersion As Short
    Public intTabArray() As Short
    Public strINIFile As String
    Public strAppPath As String


    ' error constants
    Public Const ER_NOERROR As Short = 0
    Public Const ER_FATALERROR As Short = 1
    Public Const ER_NEWPARTFAIL As Short = 2
    Public Const ER_MINORERROR As Short = 3
    Public Const ER_NOVARIABLES As Short = 4
    Public Const ER_FILENOTFOUND As Short = 5
    Public Const ER_NOSOURCEFILE As Short = 6
    Public Const ER_FILEEXISTS As Short = 7
    Public Const ER_COPYFAIL As Short = 8
    Public Const ER_NOOPEN As Short = 9
    Public Const ER_NOUPDATE As Short = 10
    Public Const ER_NOSAVE As Short = 11
    Public Const ER_FILEFOUND As Short = 12
    Public Const ER_ADDPARTERROR As Short = 13
    Public Const ER_BADFILENAME As Short = 14
    Public Const ER_VALIDFAIL As Short = 15
    Public Const ER_INVALIDDAT As Short = 16
    Public Const ER_NOASSEMBLY As Short = 17
    Public Const ER_REPLACED As Short = 18
    Public Const ER_ENGLISH As Short = 19
    Public Const ER_NONENGLISH As Short = 20

    Public Const NEED_VERSION As String = "102" ' for SE ST2 for this .Net 2.0 version

    ' locations constants
    Public Const LO_OPEN As Short = 1

    ' constant for controlling how many tabs based on characters
    Public Const MAX_TABWIDTH As Short = 60

    ' UDF data structure for the main data table (all records)

    'NOTE: MAke the Sizes array a Dictionary - this might work
    Structure SELibrary
        Dim PartID As Short
        Dim TypeID As Short
        Dim Type As String
        Dim PartClass As String
        Dim DraftName As String
        Dim BasePart As String
        Dim Found As Byte
        Dim Sizes As Dictionary(Of String, String)
        Dim Variables() As String
        Dim SizeCount As Short
        Dim VariableCount As Short
    End Structure

    ' global structure for a single set of data (one record)
    Structure Current
        Dim ParentName As String
        Dim ChildName As String
        Dim MemberName As String
        Dim Sizes() As String
        Dim Variables() As String
    End Structure
End Module
