Skip to content

Commit 1477103

Browse files
committed
added explicit GuidAttributes, and fixed debug build configs.
1 parent aa35edb commit 1477103

File tree

12 files changed

+44
-117
lines changed

12 files changed

+44
-117
lines changed

RetailCoder.VBE/Extension.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,11 @@ namespace Rubberduck
1111
[Guid(ClassId)]
1212
[ProgId(ProgId)]
1313
[EditorBrowsable(EditorBrowsableState.Never)]
14-
//underscores make classes invisible to VB6 object explorer
15-
//Nothing breaks because we declare a ProgId
14+
// ReSharper disable once InconsistentNaming
1615
public class _Extension : IDTExtensibility2, IDisposable
1716
{
18-
public const string ClassId = "8D052AD8-BBD2-4C59-8DEC-F697CA1F8A66";
19-
public const string ProgId = "Rubberduck.Extension";
17+
private const string ClassId = "8D052AD8-BBD2-4C59-8DEC-F697CA1F8A66";
18+
private const string ProgId = "Rubberduck.Extension";
2019

2120
private App _app;
2221

@@ -36,7 +35,7 @@ public void OnConnection(object Application, ext_ConnectMode ConnectMode, object
3635
}
3736
catch (Exception exception)
3837
{
39-
MessageBox.Show(exception.Message, "Rubberduck Add-In Could Not Be Loaded", MessageBoxButtons.OK, MessageBoxIcon.Error);
38+
MessageBox.Show(exception.Message, "Rubberduck Add-In could not be loaded", MessageBoxButtons.OK, MessageBoxIcon.Error);
4039
}
4140
}
4241

RetailCoder.VBE/Extensions/VbProjectExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public static void EnsureReferenceToAddInLibrary(this VBProject project)
3636
/// <summary>
3737
/// Exports all code modules in the VbProject to a destination directory. Files are given the same name as their parent code Module name and file extensions are based on what type of code Module it is.
3838
/// </summary>
39-
/// <param name="project">The <see cref="VbProject"/> to be exported to source files.</param>
39+
/// <param name="project">The <see cref="VBProject"/> to be exported to source files.</param>
4040
/// <param name="directoryPath">The destination directory path.</param>
4141
public static void ExportSourceFiles(this VBProject project, string directoryPath)
4242
{

RetailCoder.VBE/Extensions/VbeExtensions.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ public static void SetSelection(this VBE vbe, QualifiedSelection selection)
5555
{
5656
//not a very robust method. Breaks if there are multiple projects with the same name.
5757
var project = vbe.VBProjects.Cast<VBProject>()
58-
.FirstOrDefault(p => p.Protection != vbext_ProjectProtection.vbext_pp_locked && p.Name == selection.QualifiedName.ProjectName);
58+
.FirstOrDefault(p => p.Protection != vbext_ProjectProtection.vbext_pp_locked
59+
&& p.Equals(selection.QualifiedName.Project));
5960

6061
VBComponent component = null;
6162
if (project != null)

RetailCoder.VBE/Inspections/ObsoleteGlobalInspection.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,6 @@
22
using System.Linq;
33
using Antlr4.Runtime;
44
using Rubberduck.Parsing;
5-
using Rubberduck.Parsing.Grammar;
6-
using Rubberduck.Parsing.Listeners;
7-
using Rubberduck.Parsing;
8-
using Rubberduck.Parsing.Grammar;
9-
using Rubberduck.Parsing.Listeners;
105
using Rubberduck.Parsing.Symbols;
116

127
namespace Rubberduck.Inspections

RetailCoder.VBE/Properties/AssemblyInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
// Setting ComVisible to false makes the types in this assembly not visible
1717
// to COM components. If you need to access a type in this assembly from
1818
// COM, set the ComVisible attribute to true on that type.
19-
[assembly: ComVisible(false)]
19+
[assembly: ComVisible(true)]
2020

2121
// The following GUID is for the ID of the typelib if this project is exposed to COM
2222
[assembly: Guid("e07c841c-14b4-4890-83e9-8c80b06dd59d")]

RetailCoder.VBE/Rubberduck.csproj

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<DefineConstants>DEBUG;TRACE</DefineConstants>
2424
<ErrorReport>prompt</ErrorReport>
2525
<WarningLevel>4</WarningLevel>
26-
<RegisterForComInterop>true</RegisterForComInterop>
26+
<RegisterForComInterop>false</RegisterForComInterop>
2727
<DocumentationFile>bin\Debug\Rubberduck.XML</DocumentationFile>
2828
<NoWarn>1591</NoWarn>
2929
</PropertyGroup>
@@ -845,7 +845,7 @@
845845
<Import Project="..\packages\Antlr4.4.3.0\build\Antlr4.targets" Condition="Exists('..\packages\Antlr4.4.3.0\build\Antlr4.targets')" />
846846
<PropertyGroup>
847847
<PostBuildEvent>if $(ConfigurationName) == Debug64 (
848-
c:\Windows\Microsoft.NET\Framework64\v4.0.30319\regasm.exe $(TargetPath) /tlb
848+
c:\windows\microsoft.net\framework64\v4.0.30319\regasm.exe "$(TargetPath)" /codebase
849849
)
850850

851851
if $(ConfigurationName) == Release (
@@ -855,6 +855,12 @@ if $(ConfigurationName) == Release (
855855
if $(ConfigurationName) == Release64 (
856856
Copy $(TargetDir)\NativeBinaries\amd64\git2-e0902fb.dll $(TargetDir)
857857
)</PostBuildEvent>
858+
</PropertyGroup>
859+
<PropertyGroup>
860+
<PreBuildEvent>if $(ConfigurationName) == Debug64 (
861+
c:\windows\microsoft.net\framework64\v4.0.30319\regasm.exe $(TargetPath) /unregister
862+
)
863+
</PreBuildEvent>
858864
</PropertyGroup>
859865
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
860866
Other similar extension points exist, see Microsoft.Common.targets.

RetailCoder.VBE/UI/AboutWindow.Designer.cs

Lines changed: 7 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

RetailCoder.VBE/UI/AboutWindow.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,14 @@
99
namespace Rubberduck.UI
1010
{
1111
[ComVisible(true)]
12+
[Guid(ClassId)]
13+
[ProgId(ProgId)]
14+
// ReSharper disable once InconsistentNaming
1215
public partial class _AboutWindow : Form
1316
{
17+
private const string ClassId = "939CC8BB-A8CA-3BE6-89A3-5450949A6A43";
18+
private const string ProgId = "Rubberduck.UI.AboutWindow";
19+
1420
private static readonly IDictionary<string, string> Links =
1521
new Dictionary<string, string>
1622
{

RetailCoder.VBE/UI/Settings/SettingsDialog.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,14 @@
99
namespace Rubberduck.UI.Settings
1010
{
1111
[ComVisible(true)]
12+
[Guid(ClassId)]
13+
[ProgId(ProgId)]
14+
// ReSharper disable once InconsistentNaming
1215
public partial class _SettingsDialog : Form
1316
{
17+
private const string ClassId = "FB62BEA3-E11A-3C24-9101-AF2E1652AFFC";
18+
private const string ProgId = "Rubberduck.UI.Settings.SettingsDialog";
19+
1420
private Configuration _config;
1521
private IConfigurationService _configService;
1622
private ConfigurationTreeViewControl _treeview;

RetailCoder.VBE/UnitTesting/AssertClass.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,13 @@ namespace Rubberduck.UnitTesting
44
{
55
[ComVisible(true)]
66
[ComDefaultInterface(typeof(IAssert))]
7-
[ProgId("Rubberduck.AssertClass")]
7+
[Guid(ClassId)]
8+
[ProgId(ProgId)]
89
public class AssertClass : IAssert
910
{
11+
private const string ClassId = "69E194DA-43F0-3B33-B105-9B8188A6F040";
12+
private const string ProgId = "Rubberduck.AssertClass";
13+
1014
/// <summary>
1115
/// Verifies that the specified condition is <c>true</c>. The assertion fails if the condition is <c>false</c>.
1216
/// </summary>

0 commit comments

Comments
 (0)