Automation

rubierubie Member Posts: 5
I Created a .net class in Visual Studio 2010 (C#). This class contains one method. The method returns a message.
using System.Text;
using System.Runtime.InteropServices;
using Outlook = Microsoft.Office.Interop.Outlook;
using Microsoft.Office.Interop.Outlook;


namespace example
{
    [ComVisible(true)]
    [ProgId("OffiOutlook")]
    [ClassInterface(ClassInterfaceType.AutoDual)]

    public class example
    {
        public String TestMessage()
        {
            return "Message from automation object";
        }
     }
}

I've built the project and registered the dll with this statement form the command line:
regasm c:\example.dll /tlb:c:\example.tlb

The dll registered without errors.

Next, In Navision, I created a form with a button. I added some code to this button:
CLEAR(latm_example);
MESSAGE(latm_example.TestMessage());

Navision recognises the DLL and the form compiles without any errors.

When I run this form and click on the button, an error message appears:
This message is for C/AL programmers:

Could not create an instance of the OLE control or Automation server identified by GUID={...}:'example:example.
Check that the OLE control or Automation server is correctly installed an registered.

How can I solve this problem?

Comments

Sign In or Register to comment.