O'Reilly logo

Extending Microsoft Dynamics NAV 2016 Cookbook by Alexander Drogin

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating and registering a COM component that can be used in NAV

We will implement a simple custom COM component that exposes an interface to multiply two decimal numbers.

How to do it...

  1. 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.
  2. In the new project, remove all automatically generated using directives and insert one instead:
            using System.Runtime.InteropServices; 
    
  3. The following is code of the exported class:
            namespace NavAutomationServer        {        [ComVisible(true)] ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required