-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_config_Application.bas
More file actions
129 lines (101 loc) · 4.07 KB
/
_config_Application.bas
File metadata and controls
129 lines (101 loc) · 4.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
Attribute VB_Name = "_config_Application"
'---------------------------------------------------------------------------------------
' Modul: _initApplication
'---------------------------------------------------------------------------------------
'
' Application configuration
'
' Author:
' Josef Poetzl
'
'---------------------------------------------------------------------------------------
Option Compare Database
Option Explicit
'Versionsnummer
Private Const APPLICATION_VERSION As String = "1.4.0"
#Const USE_CLASS_ApplicationHandler_AppFile = 1
#Const USE_CLASS_ApplicationHandler_DirTextbox = 1
Public Const APPLICATION_NAME As String = "ACLib Import Wizard"
Private Const APPLICATION_FULLNAME As String = "Access Code Library - Import Wizard"
Private Const APPLICATION_TITLE As String = APPLICATION_FULLNAME
Private Const APPLICATION_ICONFILE As String = "ACLib.ico"
Private Const APPLICATION_STARTFORMNAME As String = "ACLibImportWizardForm"
Private Const DEFAULT_ERRORHANDLERMODE As Long = ACLibErrorHandlerMode.aclibErrMsgBox
Private m_Extensions As ApplicationHandler_ExtensionCollection
'---------------------------------------------------------------------------------------
' Sub: InitConfig
'---------------------------------------------------------------------------------------
'
' Init application configuration
'
' Parameters:
' CurrentAppHandlerRef - Possibility of a reference transfer so that CurrentApplication does not have to be used</param>
'
'---------------------------------------------------------------------------------------
Public Sub InitConfig(Optional ByRef CurrentAppHandlerRef As ApplicationHandler = Nothing)
On Error GoTo HandleErr
'----------------------------------------------------------------------------
' Error handler
'
modErrorHandler.DefaultErrorHandlerMode = DEFAULT_ERRORHANDLERMODE
'----------------------------------------------------------------------------
' Set global variables
'
defGlobal_ACLibImportWizard.ACLibIconFileName = APPLICATION_ICONFILE
'----------------------------------------------------------------------------
' Application instance
'
If CurrentAppHandlerRef Is Nothing Then
Set CurrentAppHandlerRef = CurrentApplication
End If
With CurrentAppHandlerRef
'To be on the safe side, set AccDb
Set .AppDb = CodeDb 'must point to CodeDb,
'as this application is used as an add-in
''Application name
.ApplicationName = APPLICATION_NAME
.ApplicationFullName = APPLICATION_FULLNAME
.ApplicationTitle = APPLICATION_TITLE
'Version
.Version = APPLICATION_VERSION
'Form called at the end of CurrentApplication.Start
.ApplicationStartFormName = APPLICATION_STARTFORMNAME
End With
'----------------------------------------------------------------------------
' Extensions:
'
Set m_Extensions = New ApplicationHandler_ExtensionCollection
With m_Extensions
Set .ApplicationHandler = CurrentAppHandlerRef
#If USE_CLASS_ApplicationHandler_AppFile = 1 Then
.Add New ApplicationHandler_AppFile
#End If
#If USE_CLASS_ApplicationHandler_DirTextbox = 1 Then
.Add New ApplicationHandler_DirTextbox
#End If
.Add New ACLibConfiguration
.Add New ACLibFileManager
End With
ExitHere:
Exit Sub
HandleErr:
Select Case HandleError(Err.Number, "InitConfig", Err.Description, ACLibErrorHandlerMode.aclibErrRaise)
Case ACLibErrorResumeMode.aclibErrResume
Resume
Case ACLibErrorResumeMode.aclibErrResumeNext
Resume Next
Case Else
Resume ExitHere
End Select
End Sub
'############################################################################
'
' Functions for application maintenance
' (only needed in the application design)
'
'----------------------------------------------------------------------------
' Auxiliary function for saving files to the local AppFile table
'----------------------------------------------------------------------------
Private Sub SetAppFiles()
Call CurrentApplication.Extensions("AppFile").SaveAppFile("AppIcon", CodeProject.Path & "\" & APPLICATION_ICONFILE)
End Sub