We will implement a simple custom COM component that exposes an interface to multiply two decimal numbers.
Start Visual Studio and create a new project. The initial steps repeat those from the Developing your own .NET class recipe from Chapter 4, .NET Interoperability in C/AL - you need to create a project based on a Class Library template. Name the project
NAVAutomationServer
and choose to create a new solution for the project.In the new project, remove all automatically generated using directives and insert one instead:
using System.Runtime.InteropServices;
The following is code of the exported class:
namespace NavAutomationServer { [ComVisible(true)] public interface IMultiplication { int Multiply(int x, int y); } [ComVisible(true)] [ProgId("My.TestClass")] public class Multiplication : IMultiplication...