Automation

rubie
Member Posts: 5
I Created a .net class in Visual Studio 2010 (C#). This class contains one method. The method returns a message.
I've built the project and registered the dll with this statement form the command line:
The dll registered without errors.
Next, In Navision, I created a form with a button. I added some code to this button:
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:
How can I solve this problem?
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?
0
Comments
-
-
I'm sorry. I forgot to mention it.
This is the c/al code:IF ISCLEAR(latm_example) THEN CREATE(latm_example); MESSAGE(latm_example.TestMessage());
0 -
I have similar situation. When I build solution with Visual Studio 2010 it registers DLL automagically and I can use automation without problems on development machine (W7 pro 64bit) with Dynamics Nav 2009 R2.
Trying to register it manually with regasm behaves exactly as Rubie describes.
Did you find solution Rubie?0 -
This helped:
http://www.mibuso.com/forum/viewtopic.php?f=23&t=46696&p=228244
IsakssonMi had the answer for me!regasm /codebase My.dll /tlb:My.tlb
0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions