From 5c24bc93b2b146d0a1c84ede5db9556effc5550b Mon Sep 17 00:00:00 2001 From: Alexander Usov <28162428+sharpist@users.noreply.github.com> Date: Mon, 12 Nov 2018 21:06:27 +0300 Subject: [PATCH 1/3] Update com-callable-wrapper.md line 81-93: fixed code syntax line 138-148: fixed code syntax line 167-177: fixed code syntax --- .../framework/interop/com-callable-wrapper.md | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/docs/framework/interop/com-callable-wrapper.md b/docs/framework/interop/com-callable-wrapper.md index aab4cf559e5a1..fe187ab4635eb 100644 --- a/docs/framework/interop/com-callable-wrapper.md +++ b/docs/framework/interop/com-callable-wrapper.md @@ -84,6 +84,8 @@ End Class // Implicitly extends System.Object. public class Mammal { + public Mammal() {} + public void Eat() {} public void Breathe() {} public void Sleep() {} @@ -134,9 +136,14 @@ End Class ``` ```csharp +// The CLR does not expose a class interface for this type. +// COM clients can call the members of this class using the methods from the IExplicit interface. [ClassInterface(ClassInterfaceType.None)] -public class LoanApp : IExplicit { - public void M() {} +public class LoanApp : IExplicit +{ + public LoanApp() {} + + Int32 IExplicit.M() { return 0; } } ``` @@ -158,9 +165,14 @@ End Class ``` ```csharp +// Have the CLR expose a class interface (derived from IDispatch) for this type. +// COM clients can call the members of this class using the Invoke method from the IDispatch interface. [ClassInterface(ClassInterfaceType.AutoDispatch)] -public class LoanApp : IAnother { - public void M() {} +public class LoanApp +{ + public LoanApp() {} + + public Int32 M() { return 0; } } ``` From 049c3229c0dce688ab59ebb015ced0f73d5f2de9 Mon Sep 17 00:00:00 2001 From: Alexander Usov <28162428+sharpist@users.noreply.github.com> Date: Sun, 25 Nov 2018 00:20:06 +0300 Subject: [PATCH 2/3] Update com-callable-wrapper.md I replaced return type 'Int32' -> 'int' and 'default public parameterless constructors' now deleted --- docs/framework/interop/com-callable-wrapper.md | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/docs/framework/interop/com-callable-wrapper.md b/docs/framework/interop/com-callable-wrapper.md index fe187ab4635eb..b8aa8cf88e32c 100644 --- a/docs/framework/interop/com-callable-wrapper.md +++ b/docs/framework/interop/com-callable-wrapper.md @@ -84,8 +84,6 @@ End Class // Implicitly extends System.Object. public class Mammal { - public Mammal() {} - public void Eat() {} public void Breathe() {} public void Sleep() {} @@ -141,9 +139,7 @@ End Class [ClassInterface(ClassInterfaceType.None)] public class LoanApp : IExplicit { - public LoanApp() {} - - Int32 IExplicit.M() { return 0; } + int IExplicit.M() { return 0; } } ``` @@ -170,9 +166,7 @@ End Class [ClassInterface(ClassInterfaceType.AutoDispatch)] public class LoanApp { - public LoanApp() {} - - public Int32 M() { return 0; } + public int M() { return 0; } } ``` From 182d7bea45628c3ab3976ea150195f77d1d7cc3a Mon Sep 17 00:00:00 2001 From: Alexander Usov <28162428+sharpist@users.noreply.github.com> Date: Sun, 25 Nov 2018 02:37:19 +0300 Subject: [PATCH 3/3] Update com-callable-wrapper.md Removed unnecessary comments from edited code examples. --- docs/framework/interop/com-callable-wrapper.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/docs/framework/interop/com-callable-wrapper.md b/docs/framework/interop/com-callable-wrapper.md index b8aa8cf88e32c..8c831d6c54149 100644 --- a/docs/framework/interop/com-callable-wrapper.md +++ b/docs/framework/interop/com-callable-wrapper.md @@ -134,8 +134,6 @@ End Class ``` ```csharp -// The CLR does not expose a class interface for this type. -// COM clients can call the members of this class using the methods from the IExplicit interface. [ClassInterface(ClassInterfaceType.None)] public class LoanApp : IExplicit { @@ -161,8 +159,6 @@ End Class ``` ```csharp -// Have the CLR expose a class interface (derived from IDispatch) for this type. -// COM clients can call the members of this class using the Invoke method from the IDispatch interface. [ClassInterface(ClassInterfaceType.AutoDispatch)] public class LoanApp {