diff --git a/.azure-pipelines/azure-pipelines-build.yml b/.azure-pipelines/azure-pipelines-build.yml
index 554acc1..3c6bbff 100644
--- a/.azure-pipelines/azure-pipelines-build.yml
+++ b/.azure-pipelines/azure-pipelines-build.yml
@@ -52,8 +52,11 @@ steps:
Write-Host "Version: $version"
$version | Out-File "$(Build.ArtifactStagingDirectory)\version.txt"
Get-ChildItem -Path "$(Build.SourcesDirectory)\source\AccUnit\bin\$(buildConfiguration)"
- Compress-Archive -Path "$(Build.SourcesDirectory)\source\AccUnit\bin\$(buildConfiguration)\AccessCodeLib.*.dll" -DestinationPath "$(Build.ArtifactStagingDirectory)\AccUnit.$($version).bin.zip"
- Compress-Archive -Path "$(Build.SourcesDirectory)\source\AccUnit\bin\$(buildConfiguration)\AccessCodeLib.*.tlb" -DestinationPath "$(Build.ArtifactStagingDirectory)\AccUnit.$($version).bin.zip" -Update
+ Compress-Archive -Path "$(Build.SourcesDirectory)\source\AccUnit\bin\$(buildConfiguration)\AccUnit.dll*" -DestinationPath "$(Build.ArtifactStagingDirectory)\AccUnit.$($version).bin.zip"
+ Compress-Archive -Path "$(Build.SourcesDirectory)\source\AccUnit\bin\$(buildConfiguration)\AccUnit.tlb" -DestinationPath "$(Build.ArtifactStagingDirectory)\AccUnit.$($version).bin.zip" -Update
+ Compress-Archive -Path "$(Build.SourcesDirectory)\source\AccUnit\bin\$(buildConfiguration)\AccessCodeLib.*.dll" -DestinationPath "$(Build.ArtifactStagingDirectory)\AccUnit.$($version).bin.zip" -Update
+ Compress-Archive -Path "$(Build.SourcesDirectory)\vbe-add-In\AccUnit.VbeAddIn\bin\$(buildConfiguration)\AccUnit.VbeAddIn.dll*" -DestinationPath "$(Build.ArtifactStagingDirectory)\AccUnit.$($version).bin.zip" -Update
+ Compress-Archive -Path "$(Build.SourcesDirectory)\vbe-add-In\AccUnit.VbeAddIn\bin\$(buildConfiguration)\AccessCodeLib.Common.VbeUserControlHost.dll" -DestinationPath "$(Build.ArtifactStagingDirectory)\AccUnit.$($version).bin.zip" -Update
displayName: 'Read Version and create zip file'
- task: PublishBuildArtifacts@1
diff --git a/access-add-in/AccUnitLoader.accda b/access-add-in/AccUnitLoader.accda
index bc1832a..445e9f9 100644
Binary files a/access-add-in/AccUnitLoader.accda and b/access-add-in/AccUnitLoader.accda differ
diff --git a/access-add-in/_CopyAccUnitLibFilesFromRelease.cmd b/access-add-in/_CopyAccUnitLibFilesFromRelease.cmd
index 097ca5b..eb9cfd5 100644
--- a/access-add-in/_CopyAccUnitLibFilesFromRelease.cmd
+++ b/access-add-in/_CopyAccUnitLibFilesFromRelease.cmd
@@ -3,7 +3,14 @@ if exist .\lib\ (
) else (
mkdir .\lib\
)
-copy .\..\source\AccUnit\bin\Release\AccessCodeLib.*.tlb .\lib\
+
+:: Framework:
+copy .\..\source\AccUnit\bin\Release\AccUnit.dll* .\lib\
+copy .\..\source\AccUnit\bin\Release\AccUnit.tlb .\lib\
copy .\..\source\AccUnit\bin\Release\AccessCodeLib.*.dll .\lib\
+:: VBE Add-in:
+copy .\..\vbe-add-In\AccUnit.VbeAddIn\bin\Release\AccUnit.VbeAddIn.dll* .\lib\
+copy .\..\vbe-add-In\AccUnit.VbeAddIn\bin\Release\AccessCodeLib.Common.VbeUserControlHost.dll .\lib\
+
timeout 3
\ No newline at end of file
diff --git a/access-add-in/source/forms/AccUnitLoaderForm.bas b/access-add-in/source/forms/AccUnitLoaderForm.bas
index 5997fc3..4ec128f 100644
--- a/access-add-in/source/forms/AccUnitLoaderForm.bas
+++ b/access-add-in/source/forms/AccUnitLoaderForm.bas
@@ -16,10 +16,10 @@ Begin Form
GridY =10
Width =10604
DatasheetFontHeight =11
- ItemSuffix =128
- Left =3713
+ ItemSuffix =154
+ Left =6285
Top =3915
- Right =20010
+ Right =14978
Bottom =12750
OnUnload ="[Event Procedure]"
RecSrcDt = Begin
@@ -102,7 +102,7 @@ Begin Form
GridlineShade =65.0
End
Begin Section
- Height =4025
+ Height =5142
Name ="Detail"
Begin
Begin CommandButton
@@ -157,6 +157,10 @@ Begin Form
ControlTipText ="Select AccUnit directory of the dll files"
GroupTable =2
BottomPadding =150
+ GridlineWidthLeft =0
+ GridlineWidthTop =0
+ GridlineWidthRight =0
+ GridlineWidthBottom =0
LayoutCachedLeft =9908
LayoutCachedTop =120
@@ -188,6 +192,10 @@ Begin Form
AfterUpdate ="[Event Procedure]"
GroupTable =2
BottomPadding =150
+ GridlineWidthLeft =0
+ GridlineWidthTop =0
+ GridlineWidthRight =0
+ GridlineWidthBottom =0
LayoutCachedLeft =2805
LayoutCachedTop =120
@@ -213,6 +221,10 @@ Begin Form
Caption ="Location of AccUnit dll files:"
GroupTable =2
BottomPadding =150
+ GridlineWidthLeft =0
+ GridlineWidthTop =0
+ GridlineWidthRight =0
+ GridlineWidthBottom =0
LayoutCachedLeft =120
LayoutCachedTop =120
LayoutCachedWidth =2738
@@ -263,6 +275,10 @@ Begin Form
OnClick ="[Event Procedure]"
GroupTable =2
BottomPadding =150
+ GridlineWidthLeft =0
+ GridlineWidthTop =0
+ GridlineWidthRight =0
+ GridlineWidthBottom =0
LayoutCachedLeft =2805
LayoutCachedTop =1395
@@ -291,7 +307,12 @@ Begin Form
Caption ="Remove reference to AccUnit.tlb"
OnClick ="[Event Procedure]"
GroupTable =2
- BottomPadding =150
+ BottomPadding =86
+ GridlineStyleBottom =1
+ GridlineWidthLeft =0
+ GridlineWidthTop =0
+ GridlineWidthRight =0
+ GridlineWidthBottom =0
LayoutCachedLeft =2805
LayoutCachedTop =1988
@@ -307,6 +328,7 @@ Begin Form
GridlineShade =65.0
ThemeFontIndex =1
GroupTable =2
+ Overlaps =1
End
Begin CommandButton
TabStop = NotDefault
@@ -321,6 +343,10 @@ Begin Form
OnClick ="[Event Procedure]"
GroupTable =2
BottomPadding =150
+ GridlineWidthLeft =0
+ GridlineWidthTop =0
+ GridlineWidthRight =0
+ GridlineWidthBottom =0
LayoutCachedLeft =2805
LayoutCachedTop =803
@@ -337,24 +363,6 @@ Begin Form
ThemeFontIndex =1
GroupTable =2
End
- Begin EmptyCell
- Left =120
- Top =803
- Width =2618
- Height =405
- Name ="EmptyCell71"
- GroupTable =2
- BottomPadding =150
- LayoutCachedLeft =120
- LayoutCachedTop =803
- LayoutCachedWidth =2738
- LayoutCachedHeight =1208
- RowStart =1
- RowEnd =1
- ColumnEnd =1
- LayoutGroup =1
- GroupTable =2
- End
Begin EmptyCell
Left =7845
Top =803
@@ -363,6 +371,10 @@ Begin Form
Name ="EmptyCell73"
GroupTable =2
BottomPadding =150
+ GridlineWidthLeft =0
+ GridlineWidthTop =0
+ GridlineWidthRight =0
+ GridlineWidthBottom =0
LayoutCachedLeft =7845
LayoutCachedTop =803
LayoutCachedWidth =9840
@@ -374,24 +386,6 @@ Begin Form
LayoutGroup =1
GroupTable =2
End
- Begin EmptyCell
- Left =120
- Top =1395
- Width =2618
- Height =405
- Name ="EmptyCell76"
- GroupTable =2
- BottomPadding =150
- LayoutCachedLeft =120
- LayoutCachedTop =1395
- LayoutCachedWidth =2738
- LayoutCachedHeight =1800
- RowStart =2
- RowEnd =2
- ColumnEnd =1
- LayoutGroup =1
- GroupTable =2
- End
Begin EmptyCell
Left =7845
Top =1395
@@ -400,6 +394,10 @@ Begin Form
Name ="EmptyCell78"
GroupTable =2
BottomPadding =150
+ GridlineWidthLeft =0
+ GridlineWidthTop =0
+ GridlineWidthRight =0
+ GridlineWidthBottom =0
LayoutCachedLeft =7845
LayoutCachedTop =1395
LayoutCachedWidth =10478
@@ -411,24 +409,6 @@ Begin Form
LayoutGroup =1
GroupTable =2
End
- Begin EmptyCell
- Left =120
- Top =1988
- Width =2618
- Height =405
- Name ="EmptyCell81"
- GroupTable =2
- BottomPadding =150
- LayoutCachedLeft =120
- LayoutCachedTop =1988
- LayoutCachedWidth =2738
- LayoutCachedHeight =2393
- RowStart =3
- RowEnd =3
- ColumnEnd =1
- LayoutGroup =1
- GroupTable =2
- End
Begin EmptyCell
Left =7845
Top =1988
@@ -436,7 +416,12 @@ Begin Form
Height =405
Name ="EmptyCell83"
GroupTable =2
- BottomPadding =150
+ BottomPadding =86
+ GridlineStyleBottom =1
+ GridlineWidthLeft =0
+ GridlineWidthTop =0
+ GridlineWidthRight =0
+ GridlineWidthBottom =0
LayoutCachedLeft =7845
LayoutCachedTop =1988
LayoutCachedWidth =9840
@@ -452,23 +437,27 @@ Begin Form
TabStop = NotDefault
OverlapFlags =85
Left =120
- Top =3338
+ Top =4508
Width =5175
Height =465
- TabIndex =8
+ TabIndex =10
Name ="cmdInsertFactoryModule"
Caption ="Insert/update AccUnit Factory module in application"
OnClick ="[Event Procedure]"
GroupTable =2
BottomPadding =150
+ GridlineWidthLeft =0
+ GridlineWidthTop =0
+ GridlineWidthRight =0
+ GridlineWidthBottom =0
LayoutCachedLeft =120
- LayoutCachedTop =3338
+ LayoutCachedTop =4508
LayoutCachedWidth =5295
- LayoutCachedHeight =3803
+ LayoutCachedHeight =4973
PictureCaptionArrangement =5
- RowStart =5
- RowEnd =5
+ RowStart =7
+ RowEnd =7
ColumnEnd =2
LayoutGroup =1
GridlineThemeColorIndex =1
@@ -484,6 +473,10 @@ Begin Form
Name ="EmptyCell93"
GroupTable =2
BottomPadding =150
+ GridlineWidthLeft =0
+ GridlineWidthTop =0
+ GridlineWidthRight =0
+ GridlineWidthBottom =0
LayoutCachedLeft =9908
LayoutCachedTop =803
LayoutCachedWidth =10478
@@ -502,7 +495,11 @@ Begin Form
Height =405
Name ="EmptyCell95"
GroupTable =2
- BottomPadding =150
+ BottomPadding =86
+ GridlineWidthLeft =0
+ GridlineWidthTop =0
+ GridlineWidthRight =0
+ GridlineWidthBottom =0
LayoutCachedLeft =9908
LayoutCachedTop =1988
LayoutCachedWidth =10478
@@ -518,24 +515,28 @@ Begin Form
TabStop = NotDefault
OverlapFlags =85
Left =9908
- Top =3338
+ Top =4508
Width =570
Height =465
- TabIndex =9
+ TabIndex =11
Name ="cmdOpenMenu"
Caption ="..."
OnClick ="[Event Procedure]"
ControlTipText ="More commands ..."
GroupTable =2
BottomPadding =150
+ GridlineWidthLeft =0
+ GridlineWidthTop =0
+ GridlineWidthRight =0
+ GridlineWidthBottom =0
LayoutCachedLeft =9908
- LayoutCachedTop =3338
+ LayoutCachedTop =4508
LayoutCachedWidth =10478
- LayoutCachedHeight =3803
+ LayoutCachedHeight =4973
PictureCaptionArrangement =5
- RowStart =5
- RowEnd =5
+ RowStart =7
+ RowEnd =7
ColumnStart =6
ColumnEnd =6
LayoutGroup =1
@@ -548,10 +549,10 @@ Begin Form
TabStop = NotDefault
OverlapFlags =85
Left =9908
- Top =2580
+ Top =3750
Width =570
Height =570
- TabIndex =7
+ TabIndex =9
Name ="cmdUserSettings"
OnClick ="[Event Procedure]"
ObjectPalette = Begin
@@ -559,7 +560,12 @@ Begin Form
End
ControlTipText ="AccUnit Settings"
GroupTable =2
+ TopPadding =86
BottomPadding =150
+ GridlineWidthLeft =0
+ GridlineWidthTop =0
+ GridlineWidthRight =0
+ GridlineWidthBottom =0
ImageData = Begin
0x2800000010000000100000000100200000000000000000000000000000000000 ,
0x000000000000000000000000000000000000000072727287727272f3727272f3 ,
@@ -598,11 +604,11 @@ Begin Form
End
LayoutCachedLeft =9908
- LayoutCachedTop =2580
+ LayoutCachedTop =3750
LayoutCachedWidth =10478
- LayoutCachedHeight =3150
- RowStart =4
- RowEnd =4
+ LayoutCachedHeight =4320
+ RowStart =6
+ RowEnd =6
ColumnStart =6
ColumnEnd =6
LayoutGroup =1
@@ -612,35 +618,44 @@ Begin Form
End
Begin EmptyCell
Left =120
- Top =2580
+ Top =3750
Width =562
Height =570
Name ="EmptyCell113"
GroupTable =2
+ TopPadding =86
BottomPadding =150
+ GridlineWidthLeft =0
+ GridlineWidthTop =0
+ GridlineWidthRight =0
+ GridlineWidthBottom =0
LayoutCachedLeft =120
- LayoutCachedTop =2580
+ LayoutCachedTop =3750
LayoutCachedWidth =682
- LayoutCachedHeight =3150
- RowStart =4
- RowEnd =4
+ LayoutCachedHeight =4320
+ RowStart =6
+ RowEnd =6
LayoutGroup =1
GroupTable =2
End
Begin EmptyCell
Left =7845
- Top =3338
+ Top =4508
Width =1995
Height =465
Name ="EmptyCell119"
GroupTable =2
BottomPadding =150
+ GridlineWidthLeft =0
+ GridlineWidthTop =0
+ GridlineWidthRight =0
+ GridlineWidthBottom =0
LayoutCachedLeft =7845
- LayoutCachedTop =3338
+ LayoutCachedTop =4508
LayoutCachedWidth =9840
- LayoutCachedHeight =3803
- RowStart =5
- RowEnd =5
+ LayoutCachedHeight =4973
+ RowStart =7
+ RowEnd =7
ColumnStart =4
ColumnEnd =5
LayoutGroup =1
@@ -648,18 +663,22 @@ Begin Form
End
Begin EmptyCell
Left =5355
- Top =3338
+ Top =4508
Width =2430
Height =465
Name ="EmptyCell121"
GroupTable =2
BottomPadding =150
+ GridlineWidthLeft =0
+ GridlineWidthTop =0
+ GridlineWidthRight =0
+ GridlineWidthBottom =0
LayoutCachedLeft =5355
- LayoutCachedTop =3338
+ LayoutCachedTop =4508
LayoutCachedWidth =7785
- LayoutCachedHeight =3803
- RowStart =5
- RowEnd =5
+ LayoutCachedHeight =4973
+ RowStart =7
+ RowEnd =7
ColumnStart =3
ColumnEnd =3
LayoutGroup =1
@@ -669,18 +688,23 @@ Begin Form
OverlapFlags =85
TextAlign =2
Left =743
- Top =2580
+ Top =3750
Width =8887
Height =570
Name ="labInfo"
GroupTable =2
+ TopPadding =86
BottomPadding =150
+ GridlineWidthLeft =0
+ GridlineWidthTop =0
+ GridlineWidthRight =0
+ GridlineWidthBottom =0
LayoutCachedLeft =743
- LayoutCachedTop =2580
+ LayoutCachedTop =3750
LayoutCachedWidth =9630
- LayoutCachedHeight =3150
- RowStart =4
- RowEnd =4
+ LayoutCachedHeight =4320
+ RowStart =6
+ RowEnd =6
ColumnStart =1
ColumnEnd =4
LayoutGroup =1
@@ -692,16 +716,79 @@ Begin Form
End
Begin EmptyCell
Left =9690
- Top =2580
+ Top =3750
Width =150
Height =570
Name ="EmptyCell127"
GroupTable =2
+ TopPadding =86
BottomPadding =150
+ GridlineWidthLeft =0
+ GridlineWidthTop =0
+ GridlineWidthRight =0
+ GridlineWidthBottom =0
LayoutCachedLeft =9690
- LayoutCachedTop =2580
+ LayoutCachedTop =3750
LayoutCachedWidth =9840
- LayoutCachedHeight =3150
+ LayoutCachedHeight =4320
+ RowStart =6
+ RowEnd =6
+ ColumnStart =5
+ ColumnEnd =5
+ LayoutGroup =1
+ GroupTable =2
+ End
+ Begin CommandButton
+ TabStop = NotDefault
+ OverlapFlags =85
+ Left =2805
+ Top =2573
+ Width =4980
+ Height =405
+ TabIndex =7
+ Name ="cmdInstallVbeAddIn"
+ Caption ="Install VBE Add-in"
+ OnClick ="[Event Procedure]"
+ GroupTable =2
+ TopPadding =86
+ BottomPadding =150
+ GridlineWidthLeft =0
+ GridlineWidthTop =0
+ GridlineWidthRight =0
+ GridlineWidthBottom =0
+
+ LayoutCachedLeft =2805
+ LayoutCachedTop =2573
+ LayoutCachedWidth =7785
+ LayoutCachedHeight =2978
+ PictureCaptionArrangement =5
+ RowStart =4
+ RowEnd =4
+ ColumnStart =2
+ ColumnEnd =3
+ LayoutGroup =1
+ GridlineThemeColorIndex =1
+ GridlineShade =65.0
+ ThemeFontIndex =1
+ GroupTable =2
+ End
+ Begin EmptyCell
+ Left =9690
+ Top =2573
+ Width =150
+ Height =405
+ Name ="EmptyCell135"
+ GroupTable =2
+ TopPadding =86
+ BottomPadding =150
+ GridlineWidthLeft =0
+ GridlineWidthTop =0
+ GridlineWidthRight =0
+ GridlineWidthBottom =0
+ LayoutCachedLeft =9690
+ LayoutCachedTop =2573
+ LayoutCachedWidth =9840
+ LayoutCachedHeight =2978
RowStart =4
RowEnd =4
ColumnStart =5
@@ -709,6 +796,262 @@ Begin Form
LayoutGroup =1
GroupTable =2
End
+ Begin EmptyCell
+ Left =9908
+ Top =2573
+ Width =570
+ Height =405
+ Name ="EmptyCell136"
+ GroupTable =2
+ TopPadding =86
+ BottomPadding =150
+ GridlineWidthLeft =0
+ GridlineWidthTop =0
+ GridlineWidthRight =0
+ GridlineWidthBottom =0
+ LayoutCachedLeft =9908
+ LayoutCachedTop =2573
+ LayoutCachedWidth =10478
+ LayoutCachedHeight =2978
+ RowStart =4
+ RowEnd =4
+ ColumnStart =6
+ ColumnEnd =6
+ LayoutGroup =1
+ GroupTable =2
+ End
+ Begin EmptyCell
+ Left =7845
+ Top =2573
+ Width =1785
+ Height =405
+ Name ="EmptyCell137"
+ GroupTable =2
+ TopPadding =86
+ BottomPadding =150
+ GridlineWidthLeft =0
+ GridlineWidthTop =0
+ GridlineWidthRight =0
+ GridlineWidthBottom =0
+ LayoutCachedLeft =7845
+ LayoutCachedTop =2573
+ LayoutCachedWidth =9630
+ LayoutCachedHeight =2978
+ RowStart =4
+ RowEnd =4
+ ColumnStart =4
+ ColumnEnd =4
+ LayoutGroup =1
+ GroupTable =2
+ End
+ Begin CommandButton
+ TabStop = NotDefault
+ OverlapFlags =85
+ Left =2805
+ Top =3165
+ Width =4980
+ Height =405
+ TabIndex =8
+ Name ="cmdLoadVbeAddIn"
+ Caption ="Load VBE Add-in"
+ OnClick ="[Event Procedure]"
+ GroupTable =2
+ BottomPadding =86
+ GridlineStyleBottom =1
+ GridlineWidthLeft =0
+ GridlineWidthTop =0
+ GridlineWidthRight =0
+ GridlineWidthBottom =0
+
+ LayoutCachedLeft =2805
+ LayoutCachedTop =3165
+ LayoutCachedWidth =7785
+ LayoutCachedHeight =3570
+ PictureCaptionArrangement =5
+ RowStart =5
+ RowEnd =5
+ ColumnStart =2
+ ColumnEnd =3
+ LayoutGroup =1
+ GridlineThemeColorIndex =1
+ GridlineShade =65.0
+ ThemeFontIndex =1
+ GroupTable =2
+ Overlaps =1
+ End
+ Begin EmptyCell
+ Left =9690
+ Top =3165
+ Width =150
+ Height =405
+ Name ="EmptyCell145"
+ GroupTable =2
+ BottomPadding =86
+ GridlineStyleBottom =1
+ GridlineWidthLeft =0
+ GridlineWidthTop =0
+ GridlineWidthRight =0
+ GridlineWidthBottom =0
+ LayoutCachedLeft =9690
+ LayoutCachedTop =3165
+ LayoutCachedWidth =9840
+ LayoutCachedHeight =3570
+ RowStart =5
+ RowEnd =5
+ ColumnStart =5
+ ColumnEnd =5
+ LayoutGroup =1
+ GroupTable =2
+ End
+ Begin EmptyCell
+ Left =9908
+ Top =3165
+ Width =570
+ Height =405
+ Name ="EmptyCell146"
+ GroupTable =2
+ BottomPadding =86
+ GridlineWidthLeft =0
+ GridlineWidthTop =0
+ GridlineWidthRight =0
+ GridlineWidthBottom =0
+ LayoutCachedLeft =9908
+ LayoutCachedTop =3165
+ LayoutCachedWidth =10478
+ LayoutCachedHeight =3570
+ RowStart =5
+ RowEnd =5
+ ColumnStart =6
+ ColumnEnd =6
+ LayoutGroup =1
+ GroupTable =2
+ End
+ Begin EmptyCell
+ Left =7845
+ Top =3165
+ Width =1785
+ Height =405
+ Name ="EmptyCell147"
+ GroupTable =2
+ BottomPadding =86
+ GridlineStyleBottom =1
+ GridlineWidthLeft =0
+ GridlineWidthTop =0
+ GridlineWidthRight =0
+ GridlineWidthBottom =0
+ LayoutCachedLeft =7845
+ LayoutCachedTop =3165
+ LayoutCachedWidth =9630
+ LayoutCachedHeight =3570
+ RowStart =5
+ RowEnd =5
+ ColumnStart =4
+ ColumnEnd =4
+ LayoutGroup =1
+ GroupTable =2
+ End
+ Begin Label
+ OverlapFlags =85
+ TextAlign =3
+ Left =743
+ Top =803
+ Width =1995
+ Height =1590
+ Name ="Label148"
+ Caption ="AccUnit (Framework)"
+ GroupTable =2
+ BottomPadding =86
+ GridlineStyleBottom =1
+ GridlineWidthLeft =0
+ GridlineWidthTop =0
+ GridlineWidthRight =0
+ GridlineWidthBottom =0
+ LayoutCachedLeft =743
+ LayoutCachedTop =803
+ LayoutCachedWidth =2738
+ LayoutCachedHeight =2393
+ RowStart =1
+ RowEnd =3
+ ColumnStart =1
+ ColumnEnd =1
+ LayoutGroup =1
+ GridlineThemeColorIndex =1
+ GridlineShade =65.0
+ GroupTable =2
+ End
+ Begin Label
+ OverlapFlags =85
+ TextAlign =3
+ Left =743
+ Top =2573
+ Width =1995
+ Height =997
+ Name ="Label149"
+ Caption ="AccUnit VBE Add-in"
+ GroupTable =2
+ TopPadding =86
+ BottomPadding =86
+ GridlineStyleBottom =1
+ GridlineWidthLeft =0
+ GridlineWidthTop =0
+ GridlineWidthRight =0
+ GridlineWidthBottom =0
+ LayoutCachedLeft =743
+ LayoutCachedTop =2573
+ LayoutCachedWidth =2738
+ LayoutCachedHeight =3570
+ RowStart =4
+ RowEnd =5
+ ColumnStart =1
+ ColumnEnd =1
+ LayoutGroup =1
+ GridlineThemeColorIndex =1
+ GridlineShade =65.0
+ GroupTable =2
+ End
+ Begin EmptyCell
+ Left =120
+ Top =2573
+ Width =562
+ Height =997
+ Name ="EmptyCell151"
+ GroupTable =2
+ TopPadding =86
+ BottomPadding =86
+ GridlineWidthLeft =0
+ GridlineWidthTop =0
+ GridlineWidthRight =0
+ GridlineWidthBottom =0
+ LayoutCachedLeft =120
+ LayoutCachedTop =2573
+ LayoutCachedWidth =682
+ LayoutCachedHeight =3570
+ RowStart =4
+ RowEnd =5
+ LayoutGroup =1
+ GroupTable =2
+ End
+ Begin EmptyCell
+ Left =120
+ Top =803
+ Width =562
+ Height =1590
+ Name ="EmptyCell153"
+ GroupTable =2
+ BottomPadding =86
+ GridlineWidthLeft =0
+ GridlineWidthTop =0
+ GridlineWidthRight =0
+ GridlineWidthBottom =0
+ LayoutCachedLeft =120
+ LayoutCachedTop =803
+ LayoutCachedWidth =682
+ LayoutCachedHeight =2393
+ RowStart =1
+ RowEnd =3
+ LayoutGroup =1
+ GroupTable =2
+ End
End
End
End
diff --git a/access-add-in/source/forms/AccUnitLoaderForm.cls b/access-add-in/source/forms/AccUnitLoaderForm.cls
index f4e3602..d11e4a3 100644
--- a/access-add-in/source/forms/AccUnitLoaderForm.cls
+++ b/access-add-in/source/forms/AccUnitLoaderForm.cls
@@ -26,6 +26,8 @@ Private Const APPFILE_PROPNAME_APPICON As String = "AppIcon"
Private Const ShowSuccessInfoTimerInterval As Long = 4000
+Private RunLoadAfterAddInInstalledTimer As Boolean
+
Private Sub ShowErrorHandlerInfo(ByVal ProcName As String)
Me.labInfo.Caption = "Error " & Err.Number & " (" & Err.Description & ") in procedure " & ProcName
End Sub
@@ -68,6 +70,172 @@ HandleErr:
End Sub
+Private Sub cmdInstallVbeAddIn_Click()
+
+On Error GoTo HandleErr
+
+ If Me.cmdInstallVbeAddIn.Tag <> "Installed" Then
+ OpenVbeInstallShortcutMenu
+ Exit Sub
+ End If
+
+ With New VbeAddInInstaller
+ .UnRegisterAccUnitVbeAddIn
+ VBE.Addins.Update
+ SetInstallVbeAddInCaption False
+ Me.cmdLoadVbeAddIn.Enabled = False
+ SetLoadVbeAddInCaption False
+
+ End With
+
+ Me.labInfo.Caption = "AccUnit VBE Add-in has been unregistered"
+ Me.TimerInterval = ShowSuccessInfoTimerInterval
+
+ExitHere:
+ Exit Sub
+
+HandleErr:
+ ShowErrorHandlerInfo "cmdInstallVbeAddIn_Click"
+ Resume ExitHere
+
+End Sub
+
+Private Function OpenVbeInstallShortcutMenu() As Long
+
+ Dim mnu As WinApiShortcutMenu
+ Dim SuccessMessage As String
+ Dim Installed As Boolean
+
+On Error GoTo HandleErr
+
+ Set mnu = New WinApiShortcutMenu
+
+ With mnu
+ Set .MenuControl = Me.cmdInstallVbeAddIn
+ Set .AccessForm = Me
+ .ControlSection = acDetail
+
+ .AddMenuItem 1, "Install Add-In (Load on Startup)"
+ .AddMenuItem 2, "Install Add-In (don't load)"
+
+ End With
+
+ With New VbeAddInInstaller
+ Select Case mnu.OpenMenu
+ Case 1
+ .RegisterAccUnitVbeAddIn CurrentAccUnitConfiguration.AccUnitDllPath, 3
+ Installed = True
+ RunLoadAfterAddInInstalledTimer = True
+ Case 2
+ .RegisterAccUnitVbeAddIn CurrentAccUnitConfiguration.AccUnitDllPath, 0
+ Installed = True
+ Case Else
+ '
+ End Select
+ End With
+
+ SetInstallVbeAddInCaption Installed
+ If Installed Then
+ SuccessMessage = "AccUnit VBE Add-in installed"
+ Me.cmdLoadVbeAddIn.Enabled = True
+ Else
+ SuccessMessage = "Canceled"
+ End If
+
+ Me.labInfo.Caption = SuccessMessage
+ If RunLoadAfterAddInInstalledTimer Then
+ Me.TimerInterval = 250
+ Else
+ Me.TimerInterval = ShowSuccessInfoTimerInterval
+ End If
+ Set mnu = Nothing
+
+ExitHere:
+ Exit Function
+
+HandleErr:
+ ShowErrorHandlerInfo "OpenVbeInstallShortcutMenu"
+ Resume ExitHere
+
+End Function
+
+Private Sub LoadAddInAfterInstall()
+ VBE.Addins.Update
+ With New VbeAddInInstaller
+ .LoadAccUnitAddIn True
+ SetLoadVbeAddInCaption .AddInIsLoaded
+ End With
+ Me.TimerInterval = ShowSuccessInfoTimerInterval
+
+ Me.labInfo.Caption = "AccUnit VBE Add-in has been unregistered"
+ Me.TimerInterval = ShowSuccessInfoTimerInterval
+
+End Sub
+
+Private Sub cmdLoadVbeAddIn_Click()
+
+ Dim IsLoaded As Boolean
+
+On Error GoTo HandleErr
+
+ VBE.Addins.Update
+
+ With New VbeAddInInstaller
+ .LoadAccUnitAddIn Not .AddInIsLoaded
+ IsLoaded = .AddInIsLoaded
+ SetLoadVbeAddInCaption IsLoaded
+ End With
+
+ If IsLoaded Then
+ Me.labInfo.Caption = "AccUnit VBE Add-in loaded"
+ Else
+ Me.labInfo.Caption = "AccUnit VBE Add-in unloaded"
+ End If
+ Me.TimerInterval = ShowSuccessInfoTimerInterval
+
+ExitHere:
+ Exit Sub
+
+HandleErr:
+ ShowErrorHandlerInfo "cmdLoadVbeAddIn_Click"
+ Resume ExitHere
+
+End Sub
+
+Private Sub SetInstallVbeAddInCaption(ByVal IsInstalled As Boolean)
+
+ Dim ButtonCaption As String
+ Dim ButtonTag As String
+
+ If IsInstalled Then
+ ButtonCaption = "Uninstall AccUnit VBE Add-in"
+ ButtonTag = "Installed"
+ Else
+ ButtonCaption = "Install AccUnit VBE Add-in"
+ ButtonTag = vbNullString
+ End If
+
+ With Me.cmdInstallVbeAddIn
+ .Caption = ButtonCaption
+ .Tag = ButtonTag
+ End With
+
+End Sub
+
+Private Sub SetLoadVbeAddInCaption(ByVal IsLoaded As Boolean)
+
+ Dim ButtonCaption As String
+
+ If IsLoaded Then
+ ButtonCaption = "Unload AccUnit VBE Add-in"
+ Else
+ ButtonCaption = "Load AccUnit VBE Add-in"
+ End If
+
+ Me.cmdLoadVbeAddIn.Caption = ButtonCaption
+
+End Sub
+
Private Sub cmdOpenMenu_Click()
OpenImportFileShortcutMenu
End Sub
@@ -182,7 +350,7 @@ Private Sub cmdSetAccUnitTlbReferenz_Click()
On Error GoTo HandleErr
AddAccUnitTlbReference
- Me.labInfo.Caption = "AccUnit.tlb reference inserted"
+ Me.labInfo.Caption = ACCUNIT_TYPELIB_FILE & " reference inserted"
Me.TimerInterval = ShowSuccessInfoTimerInterval
ExitHere:
@@ -199,7 +367,7 @@ Private Sub cmdRemoveAccUnitTlbReferenz_Click()
On Error GoTo HandleErr
RemoveAccUnitTlbReference
- Me.labInfo.Caption = "AccUnit.tlb reference removed"
+ Me.labInfo.Caption = ACCUNIT_TYPELIB_FILE & " reference removed"
Me.TimerInterval = ShowSuccessInfoTimerInterval
ExitHere:
@@ -229,6 +397,14 @@ On Error GoTo ErrMissingPath
Me.txtAccUnitDllPath.Value = .AccUnitDllPath
End With
+ Dim VbeAddInIsInstalled As Boolean
+ With New VbeAddInInstaller
+ VbeAddInIsInstalled = .AddInIsInstalled
+ SetInstallVbeAddInCaption VbeAddInIsInstalled
+ Me.cmdLoadVbeAddIn.Enabled = VbeAddInIsInstalled
+ SetLoadVbeAddInCaption .AddInIsLoaded
+ End With
+
SetEnableMode
Exit Sub
@@ -252,6 +428,13 @@ Private Sub Form_Open(Cancel As Integer)
End Sub
Private Sub Form_Timer()
+
+ If RunLoadAfterAddInInstalledTimer Then
+ RunLoadAfterAddInInstalledTimer = False
+ LoadAddInAfterInstall
+ Exit Sub
+ End If
+
Me.TimerInterval = 0
Me.labInfo.Caption = vbNullString
End Sub
diff --git a/access-add-in/source/modules/AccUnitLoaderConfigProcedures.bas b/access-add-in/source/modules/AccUnitLoaderConfigProcedures.bas
index 9ac518e..5015c6d 100644
--- a/access-add-in/source/modules/AccUnitLoaderConfigProcedures.bas
+++ b/access-add-in/source/modules/AccUnitLoaderConfigProcedures.bas
@@ -14,7 +14,7 @@ End Property
Public Sub AddAccUnitTlbReference()
RemoveAccUnitTlbReference
- modVbProject.CurrentVbProject.References.AddFromFile CurrentAccUnitConfiguration.AccUnitDllPath & "\AccessCodeLib.AccUnit.tlb"
+ modVbProject.CurrentVbProject.References.AddFromFile CurrentAccUnitConfiguration.AccUnitDllPath & "\" & ACCUNIT_TYPELIB_FILE
End Sub
Public Sub RemoveAccUnitTlbReference()
@@ -145,7 +145,9 @@ Public Property Get AccUnitFileNames() As Variant()
ACCUNIT_TYPELIB_FILE, _
ACCUNIT_DLL_FILE, _
"AccessCodeLib.Common.Tools.dll", _
- "AccessCodeLib.Common.VBIDETools.dll")
+ "AccessCodeLib.Common.VBIDETools.dll", _
+ "AccessCodeLib.AccUnit.VbeAddIn.dll", _
+ "AccessCodeLib.Common.VbeUserControlHost.dll")
End Property
@@ -168,7 +170,7 @@ ExitHere:
Exit Sub
HandleErr:
- If AccUnitFileName = "AccessCodeLib.AccUnit.tlb" Then
+ If AccUnitFileName = ACCUNIT_TYPELIB_FILE Then
Resume Next
End If
Err.Raise Err.Number, Err.Source, Err.Description, Err.HelpFile, Err.HelpContext
diff --git a/access-add-in/source/modules/ApplicationHandler.cls b/access-add-in/source/modules/ApplicationHandler.cls
index ceea911..6c664cf 100644
--- a/access-add-in/source/modules/ApplicationHandler.cls
+++ b/access-add-in/source/modules/ApplicationHandler.cls
@@ -65,10 +65,10 @@ Private Declare PtrSafe Function FindWindowEx Lib "user32.dll" Alias "FindWindow
Private Declare PtrSafe Function CreateSolidBrush Lib "gdi32.dll" (ByVal CrColor As Long) As Long
Private Declare PtrSafe Function SetClassLong Lib "user32" Alias "SetClassLongA" ( _
- ByVal Hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
+ ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Declare PtrSafe Function RedrawWindow Lib "user32" ( _
- ByVal Hwnd As Long, LprcUpdate As Any, _
+ ByVal hwnd As Long, LprcUpdate As Any, _
ByVal HrgnUpdate As Long, ByVal FuRedraw As Long) As Long
Private Declare PtrSafe Function GetSysColor Lib "user32" (ByVal NumIndex As Long) As Long
@@ -82,10 +82,10 @@ Private Declare Function FindWindowEx Lib "user32.dll" Alias "FindWindowExA" ( _
Private Declare Function CreateSolidBrush Lib "gdi32.dll" (ByVal CrColor As Long) As Long
Private Declare Function SetClassLong Lib "user32" Alias "SetClassLongA" ( _
- ByVal Hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
+ ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Declare Function RedrawWindow Lib "user32" ( _
- ByVal Hwnd As Long, LprcUpdate As Any, _
+ ByVal hwnd As Long, LprcUpdate As Any, _
ByVal HrgnUpdate As Long, ByVal FuRedraw As Long) As Long
Private Declare Function GetSysColor Lib "user32" (ByVal Index As Long) As Long
diff --git a/access-add-in/source/modules/DebugPrintTestResultReporter.cls b/access-add-in/source/modules/DebugPrintTestResultReporter.cls
index 36ea3a7..6061c24 100644
--- a/access-add-in/source/modules/DebugPrintTestResultReporter.cls
+++ b/access-add-in/source/modules/DebugPrintTestResultReporter.cls
@@ -19,6 +19,8 @@ Option Explicit
Implements AccUnit.ITestResultReporter
+#Const ShowEventDebugLine = False
+
Private WithEvents m_TestResultCollector As AccUnit.TestResultCollector
Attribute m_TestResultCollector.VB_VarHelpID = -1
@@ -31,18 +33,52 @@ Private Property Set ITestResultReporter_TestResultCollector(ByVal TestResultCol
End Property
Private Sub m_TestResultCollector_NewTestResult(ByVal Result As AccUnit.ITestResult)
-'
+#If ShowEventDebugLine Then
+ Debug.Print "m_TestResultCollector_NewTestResult"
+#End If
+End Sub '
+
+Private Sub m_TestResultCollector_TestStarted(ByVal Test As AccUnit.ITest, ByVal IgnoreInfo As AccUnit.IgnoreInfo)
+#If ShowEventDebugLine Then
+ Debug.Print "m_TestResultCollector_TestStarted", Test.FullName
+#End If
+End Sub
+
+Private Sub m_TestResultCollector_TestFinished(ByVal Result As AccUnit.ITestResult)
+#If ShowEventDebugLine Then
+ Debug.Print "m_TestResultCollector_TestFinished"
+#End If
+End Sub
+
+Private Sub m_TestResultCollector_TestFixtureFinished(ByVal Result As AccUnit.ITestResult)
+#If ShowEventDebugLine Then
+ Debug.Print "m_TestResultCollector_TestFixtureFinished"
+#End If
+End Sub
+
+Private Sub m_TestResultCollector_TestFixtureStarted(ByVal TestFixture As AccUnit.ITestFixture)
+#If ShowEventDebugLine Then
+ Debug.Print "m_TestResultCollector_TestFixtureStarted"
+#End If
End Sub
Private Sub m_TestResultCollector_TestSuiteFinished(ByVal Summary As AccUnit.ITestSummary)
-'
+#If ShowEventDebugLine Then
+ Debug.Print "m_TestResultCollector_TestSuiteFinished"
+#End If
+End Sub
+
+Private Sub m_TestResultCollector_TestSuiteReset(ByVal Summary As AccUnit.ITestSummary)
+ Debug.Print "m_TestResultCollector_TestSuiteReset"
End Sub
Private Sub m_TestResultCollector_TestSuiteStarted(ByVal TestSuite As AccUnit.ITestSuite)
-'
+#If ShowEventDebugLine Then
+ Debug.Print "m_TestResultCollector_TestSuiteStarted"
+#End If
End Sub
-Private Sub m_TestResultCollector_TestTraceMessage(ByVal Message As String, ByVal CodeCoverageTracker As CodeCoverageTracker)
+Private Sub m_TestResultCollector_TestTraceMessage(ByVal Message As String, ByVal CodeCoverageTracker As ICodeCoverageTracker)
If Message Like "* [*][*][*]*" Then
Message = Replace(Message, vbNewLine, vbTab)
ElseIf Message Like "* ~~~*" Then
diff --git a/access-add-in/source/modules/FileTools.bas b/access-add-in/source/modules/FileTools.bas
index 9d6fa7b..8be8962 100644
--- a/access-add-in/source/modules/FileTools.bas
+++ b/access-add-in/source/modules/FileTools.bas
@@ -59,7 +59,7 @@ Private Declare PtrSafe Function API_GetTempFilename Lib "kernel32" Alias "GetTe
ByVal lpTempFileName As String) As Long
Private Declare PtrSafe Function API_ShellExecuteA Lib "shell32.dll" ( _
- ByVal Hwnd As LongPtr, _
+ ByVal hwnd As LongPtr, _
ByVal lOperation As String, _
ByVal lpFile As String, _
ByVal lpParameters As String, _
@@ -82,7 +82,7 @@ Private Declare Function API_GetTempFilename Lib "kernel32" Alias "GetTempFileNa
ByVal lpTempFileName As String) As Long
Private Declare Function API_ShellExecuteA Lib "shell32.dll" ( _
- ByVal Hwnd As Long, _
+ ByVal hwnd As Long, _
ByVal lOperation As String, _
ByVal lpFile As String, _
ByVal lpParameters As String, _
diff --git a/access-add-in/source/modules/LogFileTestResultReporter.cls b/access-add-in/source/modules/LogFileTestResultReporter.cls
index ab20ee2..e6b11f6 100644
--- a/access-add-in/source/modules/LogFileTestResultReporter.cls
+++ b/access-add-in/source/modules/LogFileTestResultReporter.cls
@@ -41,6 +41,26 @@ Private Property Set TestResultCollector(ByVal TestResultCollectorToListen As Te
Set m_TestResultCollector = TestResultCollectorToListen
End Property
+Private Sub m_TestResultCollector_TestFinished(ByVal Result As AccUnit.ITestResult)
+'
+End Sub
+
+Private Sub m_TestResultCollector_TestFixtureFinished(ByVal Result As AccUnit.ITestResult)
+'
+End Sub
+
+Private Sub m_TestResultCollector_TestFixtureStarted(ByVal TestFixture As AccUnit.ITestFixture)
+'
+End Sub
+
+Private Sub m_TestResultCollector_TestStarted(ByVal Test As AccUnit.ITest, ByVal IgnoreInfo As AccUnit.IgnoreInfo)
+'
+End Sub
+
+Private Sub m_TestResultCollector_TestSuiteReset(ByVal Summary As AccUnit.ITestSummary)
+'
+End Sub
+
Private Sub m_TestResultCollector_TestSuiteStarted(ByVal TestSuite As AccUnit.ITestSuite)
PrintToFile String(LineSeperatorLen, "#")
PrintToFile Format(Now(), "yyyy-mm-dd hh:nn:ss")
@@ -88,7 +108,7 @@ Private Sub PrintSummary(ByVal TestSummary As AccUnit.ITestSummary, ByVal PrintT
End Sub
-Private Sub PrintTestDetailSummary(ByRef TestResults() As AccUnit.ITestResult)
+Private Sub PrintTestDetailSummary(ByRef TestResults() As AccUnit.TestResult)
Dim i As Long
Dim r As Variant 'AccUnit.ITestResult
diff --git a/access-add-in/source/modules/MsAccessVcsTestResultReporter.cls b/access-add-in/source/modules/MsAccessVcsTestResultReporter.cls
index 263e67a..faa9109 100644
--- a/access-add-in/source/modules/MsAccessVcsTestResultReporter.cls
+++ b/access-add-in/source/modules/MsAccessVcsTestResultReporter.cls
@@ -42,6 +42,26 @@ Private Property Set TestResultCollector(ByVal TestResultCollectorToListen As Te
Set m_TestResultCollector = TestResultCollectorToListen
End Property
+Private Sub m_TestResultCollector_TestFinished(ByVal Result As AccUnit.ITestResult)
+'
+End Sub
+
+Private Sub m_TestResultCollector_TestFixtureFinished(ByVal Result As AccUnit.ITestResult)
+'
+End Sub
+
+Private Sub m_TestResultCollector_TestFixtureStarted(ByVal TestFixture As AccUnit.ITestFixture)
+'
+End Sub
+
+Private Sub m_TestResultCollector_TestStarted(ByVal Test As AccUnit.ITest, ByVal IgnoreInfo As AccUnit.IgnoreInfo)
+'
+End Sub
+
+Private Sub m_TestResultCollector_TestSuiteReset(ByVal Summary As AccUnit.ITestSummary)
+'
+End Sub
+
Private Sub m_TestResultCollector_TestSuiteStarted(ByVal TestSuite As AccUnit.ITestSuite)
PrintToFile String(LineSeperatorLen, "#")
PrintToFile Format(Now(), "yyyy-mm-dd hh:nn:ss")
diff --git a/access-add-in/source/modules/SqlTools.cls b/access-add-in/source/modules/SqlTools.cls
index de347ff..2e80fdd 100644
--- a/access-add-in/source/modules/SqlTools.cls
+++ b/access-add-in/source/modules/SqlTools.cls
@@ -702,11 +702,11 @@ End Function
Private Property Get DecimalMarker() As String
Static DecChar As String
- Dim X As String
+ Dim x As String
If Len(DecChar) = 0 Then
- X = Trim(CStr(1.2))
- DecChar = Mid(X, 2, 1)
+ x = Trim(CStr(1.2))
+ DecChar = Mid(x, 2, 1)
End If
DecimalMarker = DecChar
diff --git a/access-add-in/source/modules/TestSuite.cls b/access-add-in/source/modules/TestSuite.cls
index 707e174..3c7a1d1 100644
--- a/access-add-in/source/modules/TestSuite.cls
+++ b/access-add-in/source/modules/TestSuite.cls
@@ -44,13 +44,15 @@ Public Property Set CodeCoverageTracker(ByVal NewRef As Object)
Set m_CodeCoverageTracker = NewRef
End Property
-'####################################
-' AccessTestSuite event handler
-'
Private Sub m_TestSuite_TestSuiteStarted(ByVal TestSuite As AccUnit.ITestSuite)
'
End Sub
+'####################################
+' AccessTestSuite event handler
+'
+
+
Private Sub m_TestSuite_TestTraceMessage(ByVal Message As String, ByVal CodeCoverageTracker As AccUnit.ICodeCoverageTracker)
'
End Sub
diff --git a/access-add-in/source/modules/VbeAddInInstaller.cls b/access-add-in/source/modules/VbeAddInInstaller.cls
new file mode 100644
index 0000000..82b9f4d
--- /dev/null
+++ b/access-add-in/source/modules/VbeAddInInstaller.cls
@@ -0,0 +1,287 @@
+VERSION 1.0 CLASS
+BEGIN
+ MultiUse = -1 'True
+END
+Attribute VB_Name = "VbeAddInInstaller"
+Attribute VB_GlobalNameSpace = False
+Attribute VB_Creatable = False
+Attribute VB_PredeclaredId = False
+Attribute VB_Exposed = False
+Option Compare Database
+Option Explicit
+
+Private Declare PtrSafe Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" ( _
+ ByVal hwnd As LongPtr, _
+ ByVal lpOperation As String, _
+ ByVal lpFile As String, _
+ ByVal lpParameters As String, _
+ ByVal lpDirectory As String, _
+ ByVal nShowCmd As Long) As Long
+
+Private Const SW_HIDE = 0
+
+Private Const AddInProgId As String = "AccUnit.VbeAddIn.Connect"
+Private Const AddInClassGuid As String = "{F15F18C3-CA43-421E-9585-6A04F51C5786}"
+
+Private Const VbeUserControlHostProgId As String = "AccLib.VbeUserControlHost"
+Private Const VbeUserControlHostClassGuid As String = "{030A1F2F-4E0B-4041-A7F5-C4C0B94BAF07}"
+
+Public Enum VbeAddInLoadBehavior
+ LoadBehavior_Disabled = 0
+ LoadBehavior_LoadOnStartup = 1
+ LoadBehavior_Loaded = 2
+End Enum
+
+Public Sub RegisterAccUnitVbeAddIn(ByVal DllPath As String, ByVal LoadBehavior As Long)
+
+ Const FullClassName As String = "AccessCodeLib.AccUnit.VbeAddIn.Connect"
+ Const AssemblyName As String = "AccUnit.VbeAddIn"
+ Const TargetRuntimeVersion As String = "v4.0.30319"
+ Const AssemblyFile As String = AssemblyName & ".dll"
+ Const AddInFriendlyName As String = "AccUnit VBE Add-in"
+ Const AddInDescription As String = "VBE Add-in for AccUnit Framework"
+
+#If Win64 Then
+ Const Bitness As Long = 64
+ Const AddInsFolder As String = "Addins64"
+#Else
+ Const Bitness As Long = 32
+ Const AddInsFolder As String = "Addins"
+#End If
+
+ Dim AssemblyVersion As String
+ With New ApplicationHandler_AppFile
+ AssemblyVersion = .GetStoredAppFileVersion("AccUnit.VbeAddIn.dll")
+ End With
+
+ If Right(DllPath, 1) <> "\" Then
+ DllPath = DllPath & "\"
+ End If
+
+' Add-in COM dll
+ RegisterNetComDll FullClassName, AddInClassGuid, AddInProgId, _
+ AssemblyName, DllPath & AssemblyFile, AssemblyVersion, Bitness, _
+ TargetRuntimeVersion
+
+' Host
+ RegisterVbeUserControlHost DllPath, Bitness
+
+' VBE Add-in
+ RegisterVbeAddIn AddInProgId, LoadBehavior, AddInFriendlyName, AddInDescription
+
+End Sub
+
+Private Sub RegisterVbeUserControlHost(ByVal DllPath As String, ByVal Bitness As Long)
+
+ Const FullClassName As String = "AccessCodeLib.Common.VBIDETools.VbeUserControlHost"
+ Const AssemblyName As String = "AccessCodeLib.Common.VbeUserControlHost"
+ Const TargetRuntimeVersion As String = "v4.0.30319"
+ Const AssemblyFile As String = AssemblyName & ".dll"
+
+ Dim AssemblyVersion As String
+ With New ApplicationHandler_AppFile
+ AssemblyVersion = .GetStoredAppFileVersion("AccessCodeLib.Common.VbeUserControlHost.dll")
+ End With
+
+' COM dll
+ RegisterNetComDll FullClassName, VbeUserControlHostClassGuid, VbeUserControlHostProgId, _
+ AssemblyName, DllPath & AssemblyFile, AssemblyVersion, Bitness, _
+ TargetRuntimeVersion
+
+End Sub
+
+Private Sub RegisterVbeAddIn(ByVal ProgId As String, _
+ ByVal LoadBehavior As Long, ByVal FriendlyName As String, ByVal Description As String)
+
+#If Win64 Then
+ Const AddInsFolder As String = "Addins64"
+#Else
+ Const AddInsFolder As String = "Addins"
+#End If
+
+ AddRegItem "HKCU\Software\Microsoft\VBA\VBE\6.0\" & AddInsFolder & "\" & ProgId, "LoadBehavior", "REG_DWORD", "0x0000000" & LoadBehavior
+ AddRegItem "HKCU\Software\Microsoft\VBA\VBE\6.0\" & AddInsFolder & "\" & ProgId, "FriendlyName", "REG_SZ", FriendlyName
+ AddRegItem "HKCU\Software\Microsoft\VBA\VBE\6.0\" & AddInsFolder & "\" & ProgId, "Description", "REG_SZ", Description
+
+
+'%windir%\system32\REG ADD "HKCU\Software\Microsoft\VBA\VBE\6.0\%AddInsFolder%\%ProgId%" /v "LoadBehavior" /t REG_DWORD /d "0x00000003" /f
+'%windir%\system32\REG ADD "HKCU\Software\Microsoft\VBA\VBE\6.0\%AddInsFolder%\%ProgId%" /v "FriendlyName" /t REG_SZ /d "AccUnit VBE Add-in" /f
+'%windir%\system32\REG ADD "HKCU\Software\Microsoft\VBA\VBE\6.0\%AddInsFolder%\%ProgId%" /v "Description" /t REG_SZ /d "AccUnit VBE Add-in" /f
+
+End Sub
+
+Private Sub RegisterNetComDll(ByVal FullClassName As String, ByVal ClassGuid As String, ByVal ProgId As String, _
+ ByVal AssemblyName As String, ByVal AssemblyPath As String, ByVal AssemblyVersion As String, ByVal Bitness As Long, _
+ ByVal TargetRuntimeVersion As String)
+
+ AddRegItem "HKCU\Software\Classes\" & ProgId, vbNullString, "REG_SZ", FullClassName
+ AddRegItem "HKCU\Software\Classes\" & ProgId & "\CLSID", vbNullString, "REG_SZ", ClassGuid
+ AddRegItem "HKCU\Software\Classes\CLSID\" & ClassGuid, vbNullString, "REG_SZ", FullClassName, Bitness
+ AddRegItem "HKCU\Software\Classes\CLSID\" & ClassGuid & "\ProgId", vbNullString, "REG_SZ", ProgId, Bitness
+ AddRegItem "HKCU\Software\Classes\CLSID\" & ClassGuid & "\InprocServer32", vbNullString, "REG_SZ", "mscoree.dll", Bitness
+ AddRegItem "HKCU\Software\Classes\CLSID\" & ClassGuid & "\InprocServer32", "ThreadingModel", "REG_SZ", "Both", Bitness
+ AddRegItem "HKCU\Software\Classes\CLSID\" & ClassGuid & "\InprocServer32", "Class", "REG_SZ", FullClassName, Bitness
+ AddRegItem "HKCU\Software\Classes\CLSID\" & ClassGuid & "\InprocServer32", "Assembly", "REG_SZ", AssemblyName & ", Version=" & AssemblyVersion & ", Culture=neutral, PublicKeyToken=null", Bitness
+ AddRegItem "HKCU\Software\Classes\CLSID\" & ClassGuid & "\InprocServer32", "RuntimeVersion", "REG_SZ", TargetRuntimeVersion, Bitness
+ AddRegItem "HKCU\Software\Classes\CLSID\" & ClassGuid & "\InprocServer32", "CodeBase", "REG_SZ", "file:///" & Replace(AssemblyPath, "\", "/"), Bitness
+
+End Sub
+
+Private Sub AddRegItem(ByVal RegPath As String, _
+ ByVal RegValue As String, ByVal RegDataType As String, ByVal RegData As String, _
+ Optional ByVal Bitness As Long = 0)
+
+ Const ParamStringTemplate As String = "ADD ""{RegPath}"" /v ""{RegValue}"" /t {RegDataType} /d ""{RegData}"" /reg:{Bitness} /f"
+
+ Dim ParamString As String
+
+ ParamString = ParamStringTemplate
+ ParamString = Replace(ParamString, "{RegPath}", RegPath)
+
+ If Len(RegValue) = 0 Then
+ ParamString = Replace(ParamString, "/v ""{RegValue}""", "/ve")
+ Else
+ ParamString = Replace(ParamString, "{RegValue}", RegValue)
+ End If
+
+ ParamString = Replace(ParamString, "{RegDataType}", RegDataType)
+ ParamString = Replace(ParamString, "{RegData}", RegData)
+
+ If Bitness = 0 Then
+ ParamString = Replace(ParamString, "/reg:{Bitness} ", vbNullString)
+ Else
+ ParamString = Replace(ParamString, "{Bitness}", Bitness)
+ End If
+
+ RunRegExe ParamString
+
+End Sub
+
+Private Sub RunRegExe(ByVal Params As String)
+
+ Dim RegExeFilePath As String
+ RegExeFilePath = Environ("windir") & "\System32\REG.exe"
+ ShellExecute Application.hWndAccessApp, "open", RegExeFilePath, Params, vbNullString, SW_HIDE
+
+End Sub
+
+Public Sub UnRegisterAccUnitVbeAddIn()
+
+#If Win64 Then
+ Const Bitness As Long = 64
+ Const AddInsFolder As String = "Addins64"
+#Else
+ Const Bitness As Long = 32
+ Const AddInsFolder As String = "Addins"
+#End If
+
+ If Me.AddInIsInstalled Then
+ Me.LoadAccUnitAddIn False
+ End If
+
+ UnRegisterVbeAddIn AddInProgId, Bitness
+ UnRegisterComDll AddInClassGuid, AddInProgId, Bitness
+ UnRegisterComDll VbeUserControlHostClassGuid, VbeUserControlHostProgId, Bitness
+
+End Sub
+
+Private Sub UnRegisterComDll(ByVal ClassGuid As String, ByVal ProgId As String, Bitness As Long)
+
+ DelRegItem "HKCU\Software\Classes\" & ProgId
+ DelRegItem "HKCU\Software\Classes\CLSID\" & ClassGuid, Bitness
+
+End Sub
+
+Private Sub UnRegisterVbeAddIn(ByVal ProgId As String, Bitness As Long)
+
+ Dim AddInsFolder As String
+
+ If Bitness = 64 Then
+ AddInsFolder = "Addins64"
+ Else
+ AddInsFolder = "Addins"
+ End If
+
+ DelRegItem "HKCU\Software\Microsoft\VBA\VBE\6.0\" & AddInsFolder & "\" & ProgId
+
+End Sub
+
+Private Sub DelRegItem(ByVal RegPath As String, _
+ Optional ByVal Bitness As Long = 0)
+
+ Const ParamStringTemplate As String = "DELETE ""{RegPath}"" /reg:{Bitness} /f"
+
+ Dim ParamString As String
+
+ ParamString = ParamStringTemplate
+ ParamString = Replace(ParamString, "{RegPath}", RegPath)
+
+ If Bitness = 0 Then
+ ParamString = Replace(ParamString, "/reg:{Bitness} ", vbNullString)
+ Else
+ ParamString = Replace(ParamString, "{Bitness}", Bitness)
+ End If
+
+ RunRegExe ParamString
+
+End Sub
+
+
+Public Property Get AddInIsInstalled() As Boolean
+ AddInIsInstalled = FindAccUnitAddIn()
+End Property
+
+Public Property Get AddInIsLoaded() As Boolean
+
+ Dim VbeAddIn As VBIDE.AddIn
+
+ If Not FindAccUnitAddIn(VbeAddIn) Then
+ AddInIsLoaded = False
+ Exit Property
+ End If
+
+ AddInIsLoaded = VbeAddIn.Connect
+
+End Property
+
+Public Sub LoadAccUnitAddIn(ByVal LoadAddIn As Boolean)
+
+ Dim VbeAddIn As VBIDE.AddIn
+
+ If Not FindAccUnitAddIn(VbeAddIn) Then
+ Exit Sub
+ End If
+
+ If LoadAddIn Then
+ SetFocusToImmediateWindow
+ End If
+
+ VbeAddIn.Connect = LoadAddIn
+
+End Sub
+
+Private Sub SetFocusToImmediateWindow()
+ Dim VbeWin As VBIDE.Window
+ For Each VbeWin In Application.VBE.Windows
+ If VbeWin.Type = VBIDE.vbext_WindowType.vbext_wt_Immediate Then
+ If Not VbeWin.Visible Then
+ VbeWin.Visible = True
+ End If
+ VbeWin.SetFocus
+ Exit Sub
+ End If
+ Next
+End Sub
+
+Private Function FindAccUnitAddIn(Optional ByRef AddInRef As VBIDE.AddIn) As Boolean
+
+ Dim VbeAddIn As VBIDE.AddIn
+
+ For Each VbeAddIn In VBE.Addins
+ If VbeAddIn.ProgId = AddInProgId Then
+ Set AddInRef = VbeAddIn
+ FindAccUnitAddIn = True
+ End If
+ Next
+
+End Function
diff --git a/access-add-in/source/modules/WinApiImageTools.cls b/access-add-in/source/modules/WinApiImageTools.cls
index 813645c..d384c88 100644
--- a/access-add-in/source/modules/WinApiImageTools.cls
+++ b/access-add-in/source/modules/WinApiImageTools.cls
@@ -37,7 +37,7 @@ Private Const LR_LOADFROMFILE As Long = &H10
#If VBA7 Then
Private Declare PtrSafe Function SendMessage Lib "user32" Alias "SendMessageA" ( _
- ByVal Hwnd As Long, _
+ ByVal hwnd As Long, _
ByVal wMsg As Long, _
ByVal wParam As Long, _
lParam As Any) As Long
@@ -53,7 +53,7 @@ Private Declare PtrSafe Function LoadImage Lib "user32" Alias "LoadImageA" ( _
#Else
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" ( _
- ByVal Hwnd As Long, _
+ ByVal hwnd As Long, _
ByVal wMsg As Long, _
ByVal wParam As Long, _
lParam As Any) As Long
@@ -90,7 +90,7 @@ On Error Resume Next ' ... Error message would only interfere with this "unimpor
ImageHandle = LoadImage(0, IconFilePath, IMAGE_ICON, _
ICONPIXELSIZE, ICONPIXELSIZE, LR_LOADFROMFILE)
If ImageHandle <> 0 Then
- SendMessage FormRef.Hwnd, WM_MSG_SETICON, WM_PARAM_ICON_SMALL, ByVal ImageHandle
+ SendMessage FormRef.hwnd, WM_MSG_SETICON, WM_PARAM_ICON_SMALL, ByVal ImageHandle
End If
End Sub
diff --git a/access-add-in/source/modules/WinApiLayoutTools.cls b/access-add-in/source/modules/WinApiLayoutTools.cls
index 3647fdb..f93cd34 100644
--- a/access-add-in/source/modules/WinApiLayoutTools.cls
+++ b/access-add-in/source/modules/WinApiLayoutTools.cls
@@ -47,7 +47,7 @@ Private Declare PtrSafe Function CreateSolidBrush _
Private Declare PtrSafe Function RedrawWindow _
Lib "user32" ( _
- ByVal Hwnd As LongPtr, _
+ ByVal hwnd As LongPtr, _
LprcUpdate As Any, _
ByVal HrgnUpdate As Long, _
ByVal FuRedraw As Long _
@@ -56,15 +56,15 @@ Private Declare PtrSafe Function RedrawWindow _
Private Declare PtrSafe Function SetClassLong _
Lib "user32.dll" _
Alias "SetClassLongA" ( _
- ByVal Hwnd As LongPtr, _
+ ByVal hwnd As LongPtr, _
ByVal nIndex As Long, _
ByVal dwNewLong As LongPtr _
) As Long
Private Declare PtrSafe Function GetSystemMetrics Lib "user32" (ByVal Index As Long) As Long
-Private Declare PtrSafe Function GetDC Lib "user32" (ByVal Hwnd As LongPtr) As LongPtr
-Private Declare PtrSafe Function ReleaseDC Lib "user32" (ByVal Hwnd As LongPtr, ByVal DC As LongPtr) As Long
+Private Declare PtrSafe Function GetDC Lib "user32" (ByVal hwnd As LongPtr) As LongPtr
+Private Declare PtrSafe Function ReleaseDC Lib "user32" (ByVal hwnd As LongPtr, ByVal DC As LongPtr) As Long
Private Declare PtrSafe Function GetDeviceCaps Lib "gdi32" (ByVal DC As LongPtr, ByVal Index As Long) As LongPtr
#Else
@@ -76,7 +76,7 @@ Private Declare Function CreateSolidBrush _
Private Declare Function RedrawWindow _
Lib "user32" ( _
- ByVal Hwnd As Long, _
+ ByVal hwnd As Long, _
LprcUpdate As Any, _
ByVal HrgnUpdate As Long, _
ByVal FuRedraw As Long _
@@ -85,15 +85,15 @@ Private Declare Function RedrawWindow _
Private Declare Function SetClassLong _
Lib "user32.dll" _
Alias "SetClassLongA" ( _
- ByVal Hwnd As Long, _
+ ByVal hwnd As Long, _
ByVal nIndex As Long, _
ByVal dwNewLong As Long _
) As Long
Private Declare Function GetSystemMetrics Lib "user32" (ByVal Index As Long) As Long
-Private Declare Function GetDC Lib "user32" (ByVal Hwnd As Long) As Long
-Private Declare Function ReleaseDC Lib "user32" (ByVal Hwnd As Long, ByVal DC As Long) As Long
+Private Declare Function GetDC Lib "user32" (ByVal hwnd As Long) As Long
+Private Declare Function ReleaseDC Lib "user32" (ByVal hwnd As Long, ByVal DC As Long) As Long
Private Declare Function GetDeviceCaps Lib "gdi32" (ByVal DC As Long, ByVal Index As Long) As Long
#End If
@@ -109,16 +109,16 @@ Private Declare Function GetDeviceCaps Lib "gdi32" (ByVal DC As Long, ByVal Inde
' Color - Color number
'
'---------------------------------------------------------------------------------------
-Public Sub SetBackColor(ByVal Hwnd As LongPtr, ByVal Color As Long)
+Public Sub SetBackColor(ByVal hwnd As LongPtr, ByVal Color As Long)
Dim NewBrush As LongPtr
'Create Brush
NewBrush = CreateSolidBrush(Color)
'Assign Brush
- SetClassLong Hwnd, GCL_HBRBACKGROUND, NewBrush
+ SetClassLong hwnd, GCL_HBRBACKGROUND, NewBrush
'Redraw window (entire window incl. background)
- RedrawWindow Hwnd, ByVal 0&, ByVal 0&, RDW_INVALIDATE Or RDW_ERASE
+ RedrawWindow hwnd, ByVal 0&, ByVal 0&, RDW_INVALIDATE Or RDW_ERASE
End Sub
diff --git a/access-add-in/source/modules/WinApiShellTools.cls b/access-add-in/source/modules/WinApiShellTools.cls
index 4efabcd..d9c7b9f 100644
--- a/access-add-in/source/modules/WinApiShellTools.cls
+++ b/access-add-in/source/modules/WinApiShellTools.cls
@@ -67,14 +67,14 @@ Private Const WAIT_TIMEOUT As Long = &H102&
#If VBA7 Then
Private Declare PtrSafe Function ShellExecuteA Lib "shell32.dll" ( _
- ByVal Hwnd As Long, _
+ ByVal hwnd As LongPtr, _
ByVal lOperation As String, _
ByVal lpFile As String, _
ByVal lpParameters As String, _
ByVal lpDirectory As String, _
ByVal nShowCmd As Long) As Long
-Private Declare PtrSafe Function GetDesktopWindow Lib "user32" () As Long
+Private Declare PtrSafe Function GetDesktopWindow Lib "user32" () As LongPtr
Private Declare PtrSafe Function GetSystemDirectory Lib "kernel32" Alias "GetSystemDirectoryA" ( _
ByVal lpBuffer As String, _
@@ -96,7 +96,7 @@ Private Declare PtrSafe Sub Sleep Lib "kernel32" (ByVal DwMilliseconds As Long)
#Else
Private Declare Function ShellExecuteA Lib "shell32.dll" ( _
- ByVal Hwnd As Long, _
+ ByVal hwnd As Long, _
ByVal lOperation As String, _
ByVal lpFile As String, _
ByVal lpParameters As String, _
diff --git a/access-add-in/source/modules/WinApiShortcutMenu.cls b/access-add-in/source/modules/WinApiShortcutMenu.cls
index 6e1963a..007b0d2 100644
--- a/access-add-in/source/modules/WinApiShortcutMenu.cls
+++ b/access-add-in/source/modules/WinApiShortcutMenu.cls
@@ -39,7 +39,7 @@ Option Compare Text
Option Explicit
Private Type POINTAPI
- X As Long
+ x As Long
Y As Long
End Type
@@ -55,7 +55,7 @@ End Type
Private m_Helper As LongPtr 'Auxiliary window handle
Private Type APIMSG
- Hwnd As LongPtr
+ hwnd As LongPtr
Message As LongPtr
wParam As Long
lParam As Long
@@ -71,7 +71,7 @@ Private Declare PtrSafe Function CreateWindowEx _
ByVal lpClassname As String, _
ByVal lpWindowName As String, _
ByVal dwStyle As Long, _
- ByVal X As Long, _
+ ByVal x As Long, _
ByVal Y As Long, _
ByVal nWidth As Long, _
ByVal nHeight As Long, _
@@ -97,10 +97,10 @@ Private Declare PtrSafe Function TrackPopupMenu _
Lib "user32.dll" ( _
ByVal hMenu As LongPtr, _
ByVal wFlags As Long, _
- ByVal X As Long, _
+ ByVal x As Long, _
ByVal Y As Long, _
ByVal nReserved As Long, _
- ByVal Hwnd As LongPtr, _
+ ByVal hwnd As LongPtr, _
lprc As Any _
) As LongPtr 'lprc As RECT
@@ -114,7 +114,7 @@ Private Declare PtrSafe Function GetMessage _
Lib "user32.dll" _
Alias "GetMessageA" ( _
ByRef lpMsg As APIMSG, _
- ByVal Hwnd As LongPtr, _
+ ByVal hwnd As LongPtr, _
ByVal wMsgFilterMin As Long, _
ByVal wMsgFilterMax As Long _
) As Long
@@ -130,7 +130,7 @@ Private Declare PtrSafe Function TranslateMessage _
Private Declare PtrSafe Function GetWindowRect _
Lib "user32.dll" ( _
- ByVal Hwnd As LongPtr, _
+ ByVal hwnd As LongPtr, _
ByRef lpRect As RECT _
) As LongPtr
@@ -146,7 +146,7 @@ Private Declare PtrSafe Function SetMenuDefaultItem _
Private m_Helper As Long 'Auxiliary window handle
Private Type APIMSG
- Hwnd As Long
+ hwnd As Long
Message As Long
wParam As Long
lParam As Long
@@ -162,7 +162,7 @@ Private Declare Function CreateWindowEx _
ByVal lpClassname As String, _
ByVal lpWindowName As String, _
ByVal dwStyle As Long, _
- ByVal X As Long, _
+ ByVal x As Long, _
ByVal Y As Long, _
ByVal nWidth As Long, _
ByVal nHeight As Long, _
@@ -188,10 +188,10 @@ Private Declare Function TrackPopupMenu _
Lib "user32.dll" ( _
ByVal hMenu As Long, _
ByVal wFlags As Long, _
- ByVal X As Long, _
+ ByVal x As Long, _
ByVal Y As Long, _
ByVal nReserved As Long, _
- ByVal Hwnd As Long, _
+ ByVal hwnd As Long, _
lprc As Any _
) As Long 'lprc As RECT
@@ -205,7 +205,7 @@ Private Declare Function GetMessage _
Lib "user32.dll" _
Alias "GetMessageA" ( _
ByRef lpMsg As APIMSG, _
- ByVal Hwnd As Long, _
+ ByVal hwnd As Long, _
ByVal wMsgFilterMin As Long, _
ByVal wMsgFilterMax As Long _
) As Long
@@ -221,7 +221,7 @@ Private Declare Function TranslateMessage _
Private Declare Function GetWindowRect _
Lib "user32.dll" ( _
- ByVal Hwnd As Long, _
+ ByVal hwnd As Long, _
ByRef lpRect As RECT _
) As Long
@@ -337,13 +337,13 @@ Public Property Set MenuControl(ByRef MnuCtl As Access.Control)
Select Case m_Section
Case 0 'Detailbereich
- lngSectionHwnd = WindowTools.GetDetailSection(ParentObj.Hwnd)
+ lngSectionHwnd = WindowTools.GetDetailSection(ParentObj.hwnd)
Case 1 'Kopf
- lngSectionHwnd = WindowTools.GetHeaderSection(ParentObj.Hwnd)
+ lngSectionHwnd = WindowTools.GetHeaderSection(ParentObj.hwnd)
Case 2 ' Fuß
- lngSectionHwnd = WindowTools.GetFooterSection(ParentObj.Hwnd)
+ lngSectionHwnd = WindowTools.GetFooterSection(ParentObj.hwnd)
Case Else
- lngSectionHwnd = WindowTools.GetDetailSection(ParentObj.Hwnd)
+ lngSectionHwnd = WindowTools.GetDetailSection(ParentObj.hwnd)
End Select
Set ParentObj = Nothing
@@ -419,16 +419,16 @@ End Sub
' Long - Number of the selected menu item
'
'---------------------------------------------------------------------------------------
-Public Function OpenMenu(Optional ByVal X As Single = 0, Optional ByVal Y As Single = 0) As Long
+Public Function OpenMenu(Optional ByVal x As Single = 0, Optional ByVal Y As Single = 0) As Long
#If VBA7 Then
Dim MenuHwnd As LongPtr
Dim TmpHwnd As LongPtr
- Dim Hwnd As LongPtr
+ Dim hwnd As LongPtr
#Else
Dim MenuHwnd As Long
Dim TmpHwnd As Long
- Dim Hwnd As Long
+ Dim hwnd As Long
#End If
Dim Message As APIMSG
@@ -477,12 +477,12 @@ Public Function OpenMenu(Optional ByVal X As Single = 0, Optional ByVal Y As Sin
GetWindowRect m_Helper, RcHelper
If m_MenuControl Is Nothing Then
- GetWindowRect m_AccessForm.Hwnd, AccFormRect
- ButtonLeft = LayoutTools.GetPixelFromTwips(X) + AccFormRect.Left
+ GetWindowRect m_AccessForm.hwnd, AccFormRect
+ ButtonLeft = LayoutTools.GetPixelFromTwips(x) + AccFormRect.Left
ButtonTop = LayoutTools.GetPixelFromTwips(Y) + AccFormRect.Top
Else
'- Buttom relative to the section window
- ButtonLeft = LayoutTools.GetPixelFromTwips(m_MenuControl.Left) + LayoutTools.GetPixelFromTwips(X)
+ ButtonLeft = LayoutTools.GetPixelFromTwips(m_MenuControl.Left) + LayoutTools.GetPixelFromTwips(x)
ButtonTop = LayoutTools.GetPixelFromTwips(m_MenuControl.Top) + LayoutTools.GetPixelFromTwips(Y)
End If
'- calc with each other
@@ -501,20 +501,20 @@ Public Function OpenMenu(Optional ByVal X As Single = 0, Optional ByVal Y As Sin
End If
TrackPopupMenu MenuHwnd, TPM_BOTTOMALIGN, XPos, YPos, _
- ByVal 0&, ParentObj.Hwnd, ByVal 0&
+ ByVal 0&, ParentObj.hwnd, ByVal 0&
'Message-Loop (Attention: for normal forms Application.hWndAccessApp, for POPUPS Form.Hwnd)
If m_AccessForm.PopUp = True Then
- Hwnd = m_AccessForm.Hwnd
+ hwnd = m_AccessForm.hwnd
Else
- Hwnd = Application.hWndAccessApp
+ hwnd = Application.hWndAccessApp
End If
Dim RepeatGetMessage As Boolean
Do ' Security sleep in case there are problems with windows message. (WM_MOUSELEAVE]
RepeatGetMessage = False
- GetMessage Message, Hwnd, ByVal 0&, ByVal 0&
+ GetMessage Message, hwnd, ByVal 0&, ByVal 0&
TranslateMessage Message
DispatchMessage Message
diff --git a/access-add-in/source/modules/WinApiWindowTools.cls b/access-add-in/source/modules/WinApiWindowTools.cls
index ef1e5cc..a81ca9b 100644
--- a/access-add-in/source/modules/WinApiWindowTools.cls
+++ b/access-add-in/source/modules/WinApiWindowTools.cls
@@ -35,12 +35,12 @@ Option Compare Text
Option Explicit
Private Type POINTAPI
- X As Long
+ x As Long
Y As Long
End Type
Private Declare PtrSafe Function ClientToScreen Lib "user32.dll" ( _
- ByVal Hwnd As LongPtr, _
+ ByVal hwnd As LongPtr, _
ByRef lpPoint As POINTAPI _
) As Long
@@ -81,10 +81,10 @@ End Function
' LongPtr
'
'---------------------------------------------------------------------------------------
-Public Function GetHeaderSection(ByVal Hwnd As LongPtr) As LongPtr
+Public Function GetHeaderSection(ByVal hwnd As LongPtr) As LongPtr
Dim h As LongPtr
'Determine first "OFormsub" child window of the form (fhwnd)
- h = FindWindowEx(Hwnd, 0&, "OformSub", vbNullString)
+ h = FindWindowEx(hwnd, 0&, "OformSub", vbNullString)
GetHeaderSection = h
End Function
@@ -101,11 +101,11 @@ End Function
' LongPtr
'
'---------------------------------------------------------------------------------------
-Public Function GetDetailSection(ByVal Hwnd As LongPtr) As LongPtr
+Public Function GetDetailSection(ByVal hwnd As LongPtr) As LongPtr
Dim h As LongPtr
'Determine first "OFormsub" child window of the form (fhwnd), starting after the header area.
- h = GetHeaderSection(Hwnd)
- h = FindWindowEx(Hwnd, h, "OformSub", vbNullString)
+ h = GetHeaderSection(hwnd)
+ h = FindWindowEx(hwnd, h, "OformSub", vbNullString)
GetDetailSection = h
End Function
@@ -122,11 +122,11 @@ End Function
' LongPtr
'
'---------------------------------------------------------------------------------------
-Public Function GetFooterSection(ByVal Hwnd As Long) As LongPtr
+Public Function GetFooterSection(ByVal hwnd As Long) As LongPtr
Dim h As LongPtr
'Determine first "OFormsub" child window of the form (fhwnd), starting after the detail area.
- h = GetDetailSection(Hwnd)
- h = FindWindowEx(Hwnd, h, "OformSub", vbNullString)
+ h = GetDetailSection(hwnd)
+ h = FindWindowEx(hwnd, h, "OformSub", vbNullString)
GetFooterSection = h
End Function
@@ -146,7 +146,7 @@ End Function
' LongPtr
'
'---------------------------------------------------------------------------------------
-Public Function GetControl(ByRef FormRef As Access.Form, ByVal Hwnd As LongPtr, _
+Public Function GetControl(ByRef FormRef As Access.Form, ByVal hwnd As LongPtr, _
ByVal ClassName As String, ByVal ControlName As String) As LongPtr
'Exitieren mehrere Controls der gleichen Klasse auf einem Formular, z.B. TabControls, besteht das Problem, daß
@@ -170,16 +170,16 @@ On Error Resume Next
Do
'Erstes (h=0)/nächstes (h<>0) Control auf dem Sektionsfenster ermitteln
- h = FindWindowEx(Hwnd, h, ClassName, vbNullString)
+ h = FindWindowEx(hwnd, h, ClassName, vbNullString)
'Bildschirmkoordinaten dieses Controls ermitteln
'dafür die Punktkoordinaten aus dem letzten Durchlauf zurücksetzen, sonst wird addiert!
- pt.X = 0
+ pt.x = 0
pt.Y = 0
ClientToScreen h, pt
'Objekt bei den Koordinaten ermitteln
- Set obj = FormRef.accHitTest(pt.X, pt.Y)
+ Set obj = FormRef.accHitTest(pt.x, pt.Y)
'Wenn Objektname = Tabname Ausstieg aus der Schleife
If obj.Name = ControlName Then
diff --git a/access-add-in/source/modules/_config_Application.bas b/access-add-in/source/modules/_config_Application.bas
index ea05b46..9f5eace 100644
--- a/access-add-in/source/modules/_config_Application.bas
+++ b/access-add-in/source/modules/_config_Application.bas
@@ -18,14 +18,14 @@ Option Compare Text
Option Explicit
'Version number
-Private Const APPLICATION_VERSION As String = "0.9.700.240403"
+Private Const APPLICATION_VERSION As String = "0.9.800.240509"
Private Const APPLICATION_NAME As String = "ACLib AccUnit Loader"
Private Const APPLICATION_FULLNAME As String = "Access Code Library - AccUnit Loader"
Private Const APPLICATION_TITLE As String = APPLICATION_FULLNAME
Private Const APPLICATION_ICONFILE As String = "ACLib.ico"
-Public Const ACCUNIT_TYPELIB_FILE As String = "AccessCodeLib.AccUnit.tlb"
-Public Const ACCUNIT_DLL_FILE As String = "AccessCodeLib.AccUnit.dll"
+Public Const ACCUNIT_TYPELIB_FILE As String = "AccUnit.tlb"
+Public Const ACCUNIT_DLL_FILE As String = "AccUnit.dll"
Private Const APPLICATION_STARTFORMNAME As String = "AccUnitLoaderForm"
diff --git a/access-add-in/source/modules/modTypeLibCheck.bas b/access-add-in/source/modules/modTypeLibCheck.bas
index 34bd6f2..ac7dda6 100644
--- a/access-add-in/source/modules/modTypeLibCheck.bas
+++ b/access-add-in/source/modules/modTypeLibCheck.bas
@@ -57,9 +57,9 @@ On Error Resume Next
CheckMissingReference VBProjectRef, ReferenceFixed
ReferenceFixed = ReferenceFixed Or FileFixed
- If Len(ReferenceFixedMessage) > 0 Then
- If Left(ReferenceFixedMessage, 2) = vbNewLine Then
- ReferenceFixedMessage = Mid(ReferenceFixedMessage, 3)
+ If VBA.Len(ReferenceFixedMessage) > 0 Then
+ If VBA.Left$(ReferenceFixedMessage, 2) = VBA.vbNewLine Then
+ ReferenceFixedMessage = VBA.Mid$(ReferenceFixedMessage, 3)
End If
End If
diff --git a/access-add-in/source/modules/modVbProject.bas b/access-add-in/source/modules/modVbProject.bas
index 942c8ee..f94a57a 100644
--- a/access-add-in/source/modules/modVbProject.bas
+++ b/access-add-in/source/modules/modVbProject.bas
@@ -21,7 +21,7 @@ Option Compare Text
Option Explicit
Option Private Module
-#Const EARLYBINDING = 0
+#Const EARLYBINDING = 1
Private m_CurrentVbProject As Object
diff --git a/access-add-in/source/tbldefs/USys_AppFiles.xml b/access-add-in/source/tbldefs/USys_AppFiles.xml
index afc18b6..7f07df2 100644
--- a/access-add-in/source/tbldefs/USys_AppFiles.xml
+++ b/access-add-in/source/tbldefs/USys_AppFiles.xml
@@ -38,7 +38,7 @@
-
+
@@ -74,6 +74,7 @@
+
diff --git a/binaries/VBE-Add-in/Register_HKCU.cmd b/binaries/VBE-Add-in/Register_HKCU.cmd
new file mode 100644
index 0000000..309594f
--- /dev/null
+++ b/binaries/VBE-Add-in/Register_HKCU.cmd
@@ -0,0 +1,159 @@
+@ECHO OFF
+setlocal enabledelayedexpansion
+
+:: ###################################################################
+:: Config ClassGuit, ProgId, ...
+:: -------------------------------------------------------------------
+
+SET TargetRuntimeVersion=v4.0.30319
+
+:: -------------------------------------------------------------------
+:: VBE Add-in:
+:: -----------
+
+SET AddInAssemblyName=AccUnit.VbeAddIn
+SET AddInAssemblyFile=%AddInAssemblyName%.dll
+
+SET AddInClassGuid=F15F18C3-CA43-421E-9585-6A04F51C5786
+SET AddInProgId=AccUnit.VbeAddIn.Connect
+SET AddInFullClassName=AccessCodeLib.AccUnit.VbeAddIn.Connect
+SET AddInProgVersion=0.2
+
+:: -------------------------------------------------------------------
+:: VBE ControlHost (VBE window)
+:: ----------------------------
+
+SET ControlHostAssemblyName=AccessCodeLib.Common.VbeUserControlHost
+SET ControlHostAssemblyFile=%ControlHostAssemblyName%.dll
+
+SET ControlHostClassGuid=030A1F2F-4E0B-4041-A7F5-C4C0B94BAF07
+SET ControlHostProgId=AccLib.VbeUserControlHost
+SET ControlHostFullClassName=AccessCodeLib.Common.VBIDETools.VbeUserControlHost
+SET ControlHostProgVersion=1.0
+
+:: ###################################################################
+:: Find Office bitness
+:: -------------------
+
+set "key64=HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\ClickToRun\Configuration"
+set "key32=HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Office\ClickToRun\Configuration"
+set "bitness="
+
+rem check bitness from Office:
+reg query "%key64%" /v "Platform" >nul 2>&1
+if !errorlevel! equ 0 (
+ for /f "tokens=3" %%a in ('reg query "%key64%" /v "Platform"') do set "bitness=%%a"
+)
+
+if not defined bitness (
+ reg query "%key32%" /v "Platform" >nul 2>&1
+ if !errorlevel! equ 0 (
+ for /f "tokens=3" %%a in ('reg query "%key32%" /v "Platform"') do set "bitness=%%a"
+ )
+)
+
+if defined bitness (
+ set "bitness=!bitness:x86=32!"
+ set "bitness=!bitness:x=!"
+) else (
+ set /p bitness="Please insert Office bitness (32 or 64):"
+)
+echo ------------------------
+echo Office bitness: !bitness! bit
+echo ------------------------
+
+:: ###################################################################
+:: set registry data (bitness)
+:: ---------------------------
+
+if %bitness%==64 (
+ SET AddInsFolder=Addins64
+) else (
+ SET AddInsFolder=Addins
+)
+
+
+:: ###################################################################
+:: set registry data VBE Add-in
+:: ----------------------------
+
+if %bitness%==64 (
+ SET ClsIdFolder=CLSID
+ SET AddInsFolder=Addins64
+) else (
+ SET ClsIdFolder=CLSID
+ SET AddInsFolder=Addins
+)
+
+SET AssemblyDir=%~dp0
+SET AssemblyDir=%AssemblyDir:\=/%
+
+SET AssemblyName=%AddInAssemblyName%
+SET AssemblyFile=%AddInAssemblyFile%
+
+SET ClassGuid=%AddInClassGuid%
+SET ProgId=%AddInProgId%
+SET FullClassName=%AddInFullClassName%
+SET ProgVersion=%AddInProgVersion%
+
+echo.
+echo.
+echo Insert registry data for %ProgId% (%AddInClassGuid%) ...
+echo.
+%windir%\system32\REG ADD "HKCU\Software\Classes\%ProgId%" /ve /t REG_SZ /d %FullClassName% /f
+%windir%\system32\REG ADD "HKCU\Software\Classes\%ProgId%\CLSID" /ve /t REG_SZ /d "{%ClassGuid%}" /f
+
+%windir%\system32\REG ADD "HKCU\Software\Classes\CLSID\{%ClassGuid%}" /ve /t REG_SZ /d %FullClassName% /reg:%bitness% /f
+%windir%\system32\REG ADD "HKCU\Software\Classes\CLSID\{%ClassGuid%}\ProgId" /ve /t REG_SZ /d %ProgId% /reg:%bitness% /f
+
+%windir%\system32\REG ADD "HKCU\Software\Classes\CLSID\{%ClassGuid%}\InprocServer32" /ve /t REG_SZ /d "mscoree.dll" /reg:%bitness% /f
+%windir%\system32\REG ADD "HKCU\Software\Classes\CLSID\{%ClassGuid%}\InprocServer32" /v "ThreadingModel" /t REG_SZ /d "Both" /reg:%bitness% /f
+%windir%\system32\REG ADD "HKCU\Software\Classes\CLSID\{%ClassGuid%}\InprocServer32" /v "Class" /t REG_SZ /d %FullClassName% /reg:%bitness% /f
+%windir%\system32\REG ADD "HKCU\Software\Classes\CLSID\{%ClassGuid%}\InprocServer32" /v "Assembly" /t ^
+ REG_SZ /d "%AssemblyName%, Version=%ProgVersion%, Culture=neutral, PublicKeyToken=null" /reg:%bitness% /f
+%windir%\system32\REG ADD "HKCU\Software\Classes\CLSID\{%ClassGuid%}\InprocServer32" /v "RuntimeVersion" /t ^
+ REG_SZ /d %TargetRuntimeVersion% /reg:%bitness% /f
+%windir%\system32\REG ADD "HKCU\Software\Classes\CLSID\{%ClassGuid%}\InprocServer32" /v "CodeBase" /t ^
+ REG_SZ /d "file:///%AssemblyDir%%AssemblyFile%" /reg:%bitness% /f
+
+%windir%\system32\REG ADD "HKCU\Software\Microsoft\VBA\VBE\6.0\%AddInsFolder%\%ProgId%" /v "LoadBehavior" /t REG_DWORD /d "0x00000003" /f
+%windir%\system32\REG ADD "HKCU\Software\Microsoft\VBA\VBE\6.0\%AddInsFolder%\%ProgId%" /v "FriendlyName" /t REG_SZ /d "AccUnit VBE Add-in" /f
+%windir%\system32\REG ADD "HKCU\Software\Microsoft\VBA\VBE\6.0\%AddInsFolder%\%ProgId%" /v "Description" /t REG_SZ /d "AccUnit VBE Add-in" /f
+
+
+
+:: ###################################################################
+:: set registry data VBE Window Host
+:: ---------------------------------
+
+SET AssemblyName=%ControlHostAssemblyName%
+SET AssemblyFile=%ControlHostAssemblyFile%
+
+SET ClassGuid=%ControlHostClassGuid%
+SET ProgId=%ControlHostProgId%
+SET FullClassName=%ControlHostFullClassName%
+SET ProgVersion=%ControlHostProgVersion%
+
+echo.
+echo.
+echo Insert registry data for %ProgId% (%AddInClassGuid%)
+echo.
+%windir%\system32\REG ADD "HKCU\Software\Classes\%ProgId%" /ve /t REG_SZ /d %FullClassName% /f
+%windir%\system32\REG ADD "HKCU\Software\Classes\%ProgId%\CLSID" /ve /t REG_SZ /d "{%ClassGuid%}" /reg:%bitness% /f
+
+%windir%\system32\REG ADD "HKCU\Software\Classes\CLSID\{%ClassGuid%}" /ve /t REG_SZ /d %FullClassName% /reg:%bitness% /f
+%windir%\system32\REG ADD "HKCU\Software\Classes\CLSID\{%ClassGuid%}\ProgId" /ve /t REG_SZ /d %ProgId% /reg:%bitness% /f
+
+%windir%\system32\REG ADD "HKCU\Software\Classes\CLSID\{%ClassGuid%}\InprocServer32" /ve /t REG_SZ /d "mscoree.dll" /reg:%bitness% /f
+%windir%\system32\REG ADD "HKCU\Software\Classes\CLSID\{%ClassGuid%}\InprocServer32" /v "ThreadingModel" /t REG_SZ /d "Both" /reg:%bitness% /f
+%windir%\system32\REG ADD "HKCU\Software\Classes\CLSID\{%ClassGuid%}\InprocServer32" /v "Class" /t REG_SZ /d %FullClassName% /reg:%bitness% /f
+%windir%\system32\REG ADD "HKCU\Software\Classes\CLSID\{%ClassGuid%}\InprocServer32" /v "Assembly" /t ^
+ REG_SZ /d "%AssemblyName%, Version=%ProgVersion%, Culture=neutral, PublicKeyToken=null" /reg:%bitness% /f
+%windir%\system32\REG ADD "HKCU\Software\Classes\CLSID\{%ClassGuid%}\InprocServer32" /v "RuntimeVersion" /t ^
+ REG_SZ /d %TargetRuntimeVersion% /reg:%bitness% /f
+%windir%\system32\REG ADD "HKCU\Software\Classes\CLSID\{%ClassGuid%}\InprocServer32" /v "CodeBase" /t ^
+ REG_SZ /d "file:///%AssemblyDir%%AssemblyFile%" /reg:%bitness% /f
+
+
+endlocal
+timeout 5
diff --git a/binaries/VBE-Add-in/Unregister_HKCU.cmd b/binaries/VBE-Add-in/Unregister_HKCU.cmd
new file mode 100644
index 0000000..08d87df
--- /dev/null
+++ b/binaries/VBE-Add-in/Unregister_HKCU.cmd
@@ -0,0 +1,104 @@
+@ECHO OFF
+setlocal enabledelayedexpansion
+
+:: ###################################################################
+:: Config ClassGuit, ProgId, ...
+:: -------------------------------------------------------------------
+::
+:: -------------------------------------------------------------------
+:: VBE Add-in:
+:: -----------
+
+SET AddInClassGuid=F15F18C3-CA43-421E-9585-6A04F51C5786
+SET AddInProgId=AccUnit.VbeAddIn.Connect
+
+:: -------------------------------------------------------------------
+:: VBE ControlHost (VBE window)
+:: ----------------------------
+
+SET ControlHostClassGuid=030A1F2F-4E0B-4041-A7F5-C4C0B94BAF07
+SET ControlHostProgId=AccLib.VbeUserControlHost
+
+:: ###################################################################
+:: Find Office bitness
+:: -------------------
+
+set "key64=HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\ClickToRun\Configuration"
+set "key32=HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Office\ClickToRun\Configuration"
+set "bitness="
+
+rem Prüfen für 64-Bit Office unter 64-Bit und 32-Bit Windows
+reg query "%key64%" /v "Platform" >nul 2>&1
+if !errorlevel! equ 0 (
+ for /f "tokens=3" %%a in ('reg query "%key64%" /v "Platform"') do set "bitness=%%a"
+)
+
+rem Prüfen für 32-Bit Office unter 64-Bit Windows
+if not defined bitness (
+ reg query "%key32%" /v "Platform" >nul 2>&1
+ if !errorlevel! equ 0 (
+ for /f "tokens=3" %%a in ('reg query "%key32%" /v "Platform"') do set "bitness=%%a"
+ )
+)
+
+if defined bitness (
+ set "bitness=!bitness:x86=32!"
+ set "bitness=!bitness:x=!"
+) else (
+ set /p bitness="Please insert Office bitness (32 or 64):"
+)
+echo ------------------------
+echo Office bitness: !bitness! bit
+echo ------------------------
+
+:: ###################################################################
+:: set registry data (bitness)
+:: ---------------------------
+
+if %bitness%==64 (
+ SET AddInsFolder=Addins64
+) else (
+ SET AddInsFolder=Addins
+)
+
+
+:: ###################################################################
+:: set registry data VBE Add-in
+:: ----------------------------
+
+if %bitness%==64 (
+ SET ClsIdFolder=CLSID
+ SET AddInsFolder=Addins64
+) else (
+ SET ClsIdFolder=CLSID
+ SET AddInsFolder=Addins
+)
+
+SET ClassGuid=%AddInClassGuid%
+SET ProgId=%AddInProgId%
+
+echo.
+echo.
+echo Remove registry data for %ProgId% (%AddInClassGuid%) ...
+echo.
+%windir%\system32\REG DELETE "HKCU\Software\Classes\%ProgId%" /f
+%windir%\system32\REG DELETE "HKCU\Software\Classes\CLSID\{%ClassGuid%}" /reg:%bitness% /f
+%windir%\system32\REG DELETE "HKCU\Software\Microsoft\VBA\VBE\6.0\%AddInsFolder%\%ProgId%" /f
+
+
+:: ###################################################################
+:: set registry data VBE Window Host
+:: ---------------------------------
+
+SET ClassGuid=%ControlHostClassGuid%
+SET ProgId=%ControlHostProgId%
+
+echo.
+echo.
+echo Remove registry data for %ProgId% (%AddInClassGuid%) ...
+echo.
+%windir%\system32\REG DELETE "HKCU\Software\Classes\%ProgId%" /f
+%windir%\system32\REG DELETE "HKCU\Software\Classes\CLSID\{%ClassGuid%}" /reg:%bitness% /f
+
+endlocal
+timeout 5
\ No newline at end of file
diff --git a/source/AccUnit/AccessCodeLib.AccUnit.csproj b/source/AccUnit/AccessCodeLib.AccUnit.csproj
index c1958c5..8d94471 100644
--- a/source/AccUnit/AccessCodeLib.AccUnit.csproj
+++ b/source/AccUnit/AccessCodeLib.AccUnit.csproj
@@ -145,6 +145,7 @@
+
@@ -156,10 +157,8 @@
-
-
+
-
@@ -169,7 +168,6 @@
-
@@ -293,8 +291,6 @@
- copy $(TargetDir)$(TargetFileName) $(TargetDir)$(ProjectName).dll
-"$(ProjectDir)..\tools\tlb\tlbExp.exe" $(TargetDir)$(TargetFileName) /out:$(TargetDir)\$(ProjectName).tlb
-copy $(TargetDir)$(TargetFileName).config $(TargetDir)$(ProjectName).dll.config
+ "$(ProjectDir)..\tools\tlb\tlbExp.exe" $(TargetDir)$(TargetFileName) /out:$(TargetDir)\$(TargetName).tlb
\ No newline at end of file
diff --git a/source/AccUnit/Assertions/Constraints/StringComparerConstraint.cs b/source/AccUnit/Assertions/Constraints/StringComparerConstraint.cs
index d94a47a..5f3db94 100644
--- a/source/AccUnit/Assertions/Constraints/StringComparerConstraint.cs
+++ b/source/AccUnit/Assertions/Constraints/StringComparerConstraint.cs
@@ -23,7 +23,7 @@ public StringComparerConstraint(string compareText, string expected, int expecte
protected override IMatchResult Compare(object actual)
{
- if (actual is null || (_nullIsEqualEmptyString && actual is string s && s == string.Empty))
+ if (actual is null || (_nullIsEqualEmptyString && actual is string s && s == string.Empty))
{
if (Expected == null || _nullIsEqualEmptyString && Expected == string.Empty)
{
@@ -41,7 +41,7 @@ protected override IMatchResult Compare(object actual)
{
return new MatchResult(CompareText, false, "actual is Null and expected is not Null", actual, Expected);
}
-
+
// Check type
var actualType = ConstraintBuilder.Type2Compare(actual, Strict);
var expectedType = typeof(string);
diff --git a/source/AccUnit/Configuration/AccUnitLoaderAddInCodeTemplates.cs b/source/AccUnit/Configuration/AccUnitLoaderAddInCodeTemplates.cs
index 90e5f3d..23aa974 100644
--- a/source/AccUnit/Configuration/AccUnitLoaderAddInCodeTemplates.cs
+++ b/source/AccUnit/Configuration/AccUnitLoaderAddInCodeTemplates.cs
@@ -18,7 +18,7 @@ public AccUnitLoaderAddInCodeTemplates(bool useAccUnitTypeLib = false, string ho
private void AddAccUnitLoaderFactory(bool useAccUnitTypeLib, string hostAppName)
{
- var code = hostAppName.Equals("Microsoft Access",System.StringComparison.OrdinalIgnoreCase) ? AccessAccUnitLoaderFactoryCode : ExcelAccUnitLoaderFactoryCode;
+ var code = hostAppName.Equals("Microsoft Access", System.StringComparison.OrdinalIgnoreCase) ? AccessAccUnitLoaderFactoryCode : ExcelAccUnitLoaderFactoryCode;
code = code.Replace("{UseAccUnitTypeLib}", useAccUnitTypeLib ? "1" : "0");
Add(new CodeTemplate(@"AccUnit_Factory", vbext_ComponentType.vbext_ct_StdModule, code));
@@ -42,6 +42,10 @@ Public Enum StringCompareMode
StringCompareMode_TextCompare = 1
StringCompareMode_vbNullStringEqualEmptyString = 4
End Enum
+Public Enum ResetMode
+ ResetMode_RemoveTests = 2
+ ResetMode_ResetTestSuite = 4
+End Enum
#End If
Private Const DefaultTestReportOutput As Long = TestReportOutput.DebugPrint
@@ -50,11 +54,38 @@ Private m_CodeCoverageTracker As Object
Private Function AccUnitLoaderFactory() As Object
If m_AccUnitLoaderFactory Is Nothing Then
- Set m_AccUnitLoaderFactory = Application.Run(GetAddInPath & ""AccUnitLoader.GetAccUnitFactory"")
+ Set m_AccUnitLoaderFactory = GetAccUnitLoaderFactory
End If
Set AccUnitLoaderFactory = m_AccUnitLoaderFactory
End Function
+Private Function GetAccUnitLoaderFactory() As Object
+
+ Dim AccUnitVbeAddIn As Object
+
+ If TryGetAccUnitVbeAddIn(AccUnitVbeAddIn) Then
+ Set GetAccUnitLoaderFactory = AccUnitVbeAddIn.Object
+ Else
+ Set GetAccUnitLoaderFactory = Application.Run(GetAddInPath & ""AccUnitLoader.GetAccUnitFactory"")
+ End If
+
+End Function
+
+Private Function TryGetAccUnitVbeAddIn(ByRef AccUnitVbeAddIn As Object) As Boolean
+
+ Dim AddIn2check As Object
+
+ For Each AddIn2check In Application.VBE.Addins
+ If AddIn2check.ProgId = ""AccUnit.VbeAddIn.Connect"" Then
+ If AddIn2check.Connect Then
+ Set AccUnitVbeAddIn = Application.VBE.Addins.Item(""AccUnit.VbeAddIn.Connect"")
+ TryGetAccUnitVbeAddIn = True
+ End If
+ End If
+ Next
+
+End Function
+
#If USE_ACCUNIT_TYPELIB Then
Private Property Get AccUnitFactory() As AccUnit.AccUnitFactory
#Else
@@ -89,6 +120,7 @@ Public Property Get TestSuite(Optional ByVal OutputTo As TestReportOutput = Defa
Public Property Get TestSuite(Optional ByVal OutputTo As TestReportOutput = DefaultTestReportOutput) As Object
#End If
Set TestSuite = AccUnitLoaderFactory.TestSuite(OutputTo)
+ TestSuite.Reset ResetMode_ResetTestSuite + ResetMode_RemoveTests
End Property
Public Sub RunAllTests()
@@ -168,11 +200,38 @@ Private m_CodeCoverageTracker As Object
Private Function AccUnitLoaderFactory() As Object
If m_AccUnitLoaderFactory Is Nothing Then
- Set m_AccUnitLoaderFactory = GetLoaderAddIn.Application.Run(""GetAccUnitFactory"")
+ Set m_AccUnitLoaderFactory = GetAccUnitLoaderFactory
End If
Set AccUnitLoaderFactory = m_AccUnitLoaderFactory
End Function
+Private Function GetAccUnitLoaderFactory() As Object
+
+ Dim AccUnitVbeAddIn As Object
+
+ If TryGetAccUnitVbeAddIn(AccUnitVbeAddIn) Then
+ Set GetAccUnitLoaderFactory = AccUnitVbeAddIn.Object
+ Else
+ Set GetAccUnitLoaderFactory = GetLoaderAddIn.Application.Run(""GetAccUnitFactory"")
+ End If
+
+End Function
+
+Private Function TryGetAccUnitVbeAddIn(ByRef AccUnitVbeAddIn As Object) As Boolean
+
+ Dim AddIn2check As Object
+
+ For Each AddIn2check In Application.VBE.Addins
+ If AddIn2check.ProgId = ""AccUnit.VbeAddIn.Connect"" Then
+ If AddIn2check.Connect Then
+ Set AccUnitVbeAddIn = Application.VBE.Addins.Item(""AccUnit.VbeAddIn.Connect"")
+ TryGetAccUnitVbeAddIn = True
+ End If
+ End If
+ Next
+
+End Function
+
Private Function GetLoaderAddIn() As Excel.AddIn
Dim AddIn As AddIn
diff --git a/source/AccUnit/Configuration/Configurator.cs b/source/AccUnit/Configuration/Configurator.cs
index 601d5c9..f89f56d 100644
--- a/source/AccUnit/Configuration/Configurator.cs
+++ b/source/AccUnit/Configuration/Configurator.cs
@@ -20,7 +20,7 @@ public interface IConfigurator
void ExportTestClasses(string ExportPath = null, [MarshalAs(UnmanagedType.IDispatch)] object VBProject = null, bool ExportTestComponents = true);
void ImportTestClasses(string FileNameFilter = null, string ImportPath = null, [MarshalAs(UnmanagedType.IDispatch)] object VBProject = null);
- IUserSettings UserSettings { get; }
+ IUserSettings UserSettings { get; }
}
[ComVisible(true)]
@@ -40,7 +40,7 @@ public Configurator(VBProject vbproject)
_vbProject = vbproject;
}
- public void InsertAccUnitLoaderFactoryModule(bool UseAccUnitTypeLib = false, bool removeIfExists = false,
+ public void InsertAccUnitLoaderFactoryModule(bool UseAccUnitTypeLib = false, bool removeIfExists = false,
object vbProject = null, object HostApplication = null)
{
if (vbProject != null)
@@ -114,7 +114,8 @@ private void RemoveAccUnitTlbReference()
{
refName = reference.Name;
}
- catch {
+ catch
+ {
refName = "";
}
@@ -153,7 +154,7 @@ public IUserSettings UserSettings
{
return Configuration.UserSettings.Current;
}
- }
+ }
/*
public static void CheckAccUnitVBAReferences(VBProject vbProject)
diff --git a/source/AccUnit/Configuration/ErrorTrappingObserver.cs b/source/AccUnit/Configuration/ErrorTrappingObserver.cs
index 775395a..59977eb 100644
--- a/source/AccUnit/Configuration/ErrorTrappingObserver.cs
+++ b/source/AccUnit/Configuration/ErrorTrappingObserver.cs
@@ -12,7 +12,7 @@ public interface IErrorTrappingObserver : IDisposable
{
[ComVisible(true)]
void SetErrorTrapping(VbaErrorTrapping ErrorTrapping);
- new void Dispose();
+ new void Dispose();
}
[ComVisible(true)]
diff --git a/source/AccUnit/Configuration/TestClassManager.cs b/source/AccUnit/Configuration/TestClassManager.cs
index 35845f5..37bb4d1 100644
--- a/source/AccUnit/Configuration/TestClassManager.cs
+++ b/source/AccUnit/Configuration/TestClassManager.cs
@@ -446,6 +446,15 @@ public TestClassInfo FindFirstMissingTestClassInVBProject(IEnumerable !completeList.Exists(x => x.Name == testClassInfo.Name));
}
+ public TestClassInfo GetTestClassInfo(string className, bool initMembers)
+ {
+ using (new BlockLogger())
+ {
+ var reader = new TestClassReader(ActiveVBProject);
+ return reader.GetTestClassInfo(className, initMembers);
+ }
+ }
+
public CodeModule InsertTestTemplate(CodeTemplate template, string templateName)
{
return template.AddToVBProject(ActiveVBProject, templateName);
diff --git a/source/AccUnit/Configuration/UserSettings.cs b/source/AccUnit/Configuration/UserSettings.cs
index 08c1201..dd1ebcc 100644
--- a/source/AccUnit/Configuration/UserSettings.cs
+++ b/source/AccUnit/Configuration/UserSettings.cs
@@ -116,7 +116,7 @@ public void Save()
// ReSharper restore MemberCanBePrivate.Global
#region Tools
-
+
[Category("Import/Export")]
[DefaultValue(@"%APPFOLDER%\Tests\%APPNAME%")]
[Description("Import and export folder for test classes\n%APPFOLDER% ... Path to current mdb/accdb\n%APPNAME% ... Filename of mdb/accdb")]
diff --git a/source/AccUnit/Integration/BaseTest.cs b/source/AccUnit/Integration/BaseTest.cs
index 85c939c..fc12875 100644
--- a/source/AccUnit/Integration/BaseTest.cs
+++ b/source/AccUnit/Integration/BaseTest.cs
@@ -2,16 +2,26 @@
namespace AccessCodeLib.AccUnit.Integration
{
- internal abstract class BaseTest : ITest
+ public abstract class BaseTest : ITest
{
public BaseTest(ITestFixture fixture, ITestClassMemberInfo testClassMemberInfo)
{
Fixture = fixture;
+ Parent = fixture;
Name = testClassMemberInfo.Name;
MethodName = testClassMemberInfo.Name;
TestClassMemberInfo = testClassMemberInfo;
}
+ public BaseTest(ITestFixture fixture, object parentTest, ITestClassMemberInfo testClassMemberInfo)
+ {
+ Fixture = fixture;
+ Name = testClassMemberInfo.Name;
+ MethodName = testClassMemberInfo.Name;
+ TestClassMemberInfo = testClassMemberInfo;
+ Parent = parentTest;
+ }
+
protected virtual string FormattedFullName()
{
return $"{Fixture.Name}.{MethodName}";
@@ -19,11 +29,14 @@ protected virtual string FormattedFullName()
public ITestFixture Fixture { get; private set; }
+ public object Parent { get; private set; }
+
public string MethodName { get; private set; }
public string FullName { get { return FormattedFullName(); } }
- public string DisplayName { get; set; }
+ protected string _displayName;
+ public string DisplayName { get { return _displayName ?? Name; } set { _displayName = value; } }
public RunState RunState { get; set; }
public string Name { get; private set; }
diff --git a/source/AccUnit/~trash/CodeModuleMemberWithMarker.cs b/source/AccUnit/Integration/CodeModuleMemberWithMarker.cs
similarity index 82%
rename from source/AccUnit/~trash/CodeModuleMemberWithMarker.cs
rename to source/AccUnit/Integration/CodeModuleMemberWithMarker.cs
index edef51a..e86730a 100644
--- a/source/AccUnit/~trash/CodeModuleMemberWithMarker.cs
+++ b/source/AccUnit/Integration/CodeModuleMemberWithMarker.cs
@@ -1,8 +1,7 @@
-/*
-using AccessCodeLib.Common.VBIDETools;
+using AccessCodeLib.Common.VBIDETools;
using Microsoft.Vbe.Interop;
-namespace AccessCodeLib.AccUnit.Common
+namespace AccessCodeLib.AccUnit
{
public class CodeModuleMemberWithMarker : CodeModuleMember
{
@@ -13,7 +12,5 @@ public CodeModuleMemberWithMarker(string name, vbext_ProcKind procKind, bool isP
}
public bool Marked { get; set; }
-
}
}
-*/
\ No newline at end of file
diff --git a/source/AccUnit/Integration/IgnoreInfo.cs b/source/AccUnit/Integration/IgnoreInfo.cs
new file mode 100644
index 0000000..dced358
--- /dev/null
+++ b/source/AccUnit/Integration/IgnoreInfo.cs
@@ -0,0 +1,12 @@
+using System.Runtime.InteropServices;
+
+namespace AccessCodeLib.AccUnit
+{
+ [ComVisible(true)]
+ [Guid("54485999-BB08-4C3C-99BB-0D6C1D84B69B")]
+ public class IgnoreInfo
+ {
+ public bool Ignore;
+ public string Comment;
+ }
+}
diff --git a/source/AccUnit/Integration/MethodTest.cs b/source/AccUnit/Integration/MethodTest.cs
index ce90d8d..195c3b1 100644
--- a/source/AccUnit/Integration/MethodTest.cs
+++ b/source/AccUnit/Integration/MethodTest.cs
@@ -2,7 +2,7 @@
namespace AccessCodeLib.AccUnit.Integration
{
- internal class MethodTest : BaseTest
+ public class MethodTest : BaseTest
{
public MethodTest(ITestFixture fixture, ITestClassMemberInfo testClassMemberInfo)
: base(fixture, testClassMemberInfo)
diff --git a/source/AccUnit/Integration/ParamTest.cs b/source/AccUnit/Integration/ParamTest.cs
index cb7628f..5717326 100644
--- a/source/AccUnit/Integration/ParamTest.cs
+++ b/source/AccUnit/Integration/ParamTest.cs
@@ -3,7 +3,7 @@
namespace AccessCodeLib.AccUnit.Integration
{
- internal class ParamTest : BaseTest, IParamTest
+ public class ParamTest : BaseTest, IParamTest, IRowTestId
{
private readonly string _testRowId = string.Empty;
@@ -14,11 +14,25 @@ public ParamTest(ITestFixture fixture, ITestClassMemberInfo testClassMemberInfo,
Parameters = parameters;
}
+ public ParamTest(ITestFixture fixture, ITest parent, ITestClassMemberInfo testClassMemberInfo, string testRowId, IEnumerable