From 09c1aa8bf98a365323ced53259c016ffd4c2a765 Mon Sep 17 00:00:00 2001 From: Jonathan Chambers Date: Tue, 27 Mar 2012 21:49:31 -0400 Subject: [PATCH] Default COM visilibity to true. --- mono/metadata/cominterop.c | 2 +- mono/tests/cominterop.cs | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/mono/metadata/cominterop.c b/mono/metadata/cominterop.c index 7527d598c23..8aaa6d21447 100644 --- a/mono/metadata/cominterop.c +++ b/mono/metadata/cominterop.c @@ -392,7 +392,7 @@ cominterop_com_visible (MonoClass* klass) MonoError error; MonoCustomAttrInfo *cinfo; GPtrArray *ifaces; - MonoBoolean visible = 0; + MonoBoolean visible = 1; /* Handle the ComVisibleAttribute */ if (!ComVisibleAttribute) diff --git a/mono/tests/cominterop.cs b/mono/tests/cominterop.cs index b5be6e8de54..d541e5860c6 100644 --- a/mono/tests/cominterop.cs +++ b/mono/tests/cominterop.cs @@ -8,6 +8,7 @@ using System; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; + public class Tests { @@ -653,6 +654,13 @@ public class Tests } } #endregion // SafeArray Tests + + #region COM Visible Test + TestVisible test_vis = new TestVisible(); + IntPtr pDisp = Marshal.GetIDispatchForObject(test_vis); + if (pDisp == IntPtr.Zero) + return 200; + #endregion } return 0; @@ -1214,3 +1222,7 @@ public class Tests return 0; } } + +public class TestVisible +{ +} -- 2.25.1