How to create a Navision dll/ocx in Visual Studio 2005 .NET
timo
Member Posts: 11
I want to create a Navision Custome Control (OCX or DLL) -> for example one dll which create a "Hello World" massagebox after starting from navision.
I use Visual Studio 2005 .NET. C# is the favorieted language.
Can someone give me a Code example or guide for the dll?
I use Visual Studio 2005 .NET. C# is the favorieted language.
Can someone give me a Code example or guide for the dll?
Check out our new NAVonline HelpDesk
0
Comments
-
Imports System.Runtime.InteropServices
Namespace Something
<ClassInterface(ClassInterfaceType.AutoDual)> _
Public Class Starter
Public Sub SayHello()
messagebox.show('Hello world')
End Sub
End Class
End Namespace
in prpreties of solution chose "output type" - class library
in configuration prop check the "registrer for COM interop"
Now you can use method of your dll in navision
Regards0 -
sorry but i can't find the option for
in configuration prop check the "registrer for COM interop"
can you give me a hind?
I find it!Check out our new NAVonline HelpDesk0 -
It don't work.
I can't import the dll in Navision Custom Controls. Error: OLE Control can't registerCheck out our new NAVonline HelpDesk0 -
Try..
using System; using System.Windows.Forms; using System.Runtime.InteropServices; namespace DynamicNav { [InterfaceType(ComInterfaceType.InterfaceIsIDispatch)] public interface INavDefault { // Method void HelloWorld(); int Add2Numbers(int a, int b); // Property DateTime MyDate { set; get; } } [ClassInterface(ClassInterfaceType.None)] public class NavDefault : INavDefault { public NavDefault() { } // Method public void HelloWorld() { MessageBox.Show("Hello World"); } public int Add2Numbers(int a, int b) { return (a + b); } // Property private DateTime allocDate = DateTime.Today; public DateTime MyDate { set { allocDate = value; } get { return allocDate; } } } }In your AssemblyInfo.cs[assembly: ComVisible(true)]
..let me know if it works.
..psst. you can't register dotNet components in NAV Custom Controls, use regasm instead..Met vriendelijke groet, best regards,
Rvduuren0 -
I had the same problem, after reading a lot of things trying a lot things, found a simple solution. check it out
http://valpi.pt/web/valpi.nsf/a9d3838b9 ... enDocument0 -
-
@ JedrzejT: Thank you It works, afer register with regasm.exe. But not as Custom Control - as Automation Server. Whats the difference?
The other Samples i will test tomorrow - thank you allCheck out our new NAVonline HelpDesk0 -
Anyone actually able to create a .NET Assembly with events that create eventtriggers in navision when setting the automation property to WithEvents "True"?
Some sample code could be useful if you have done so in the past.
Thanks.0 -
With help from Demiliani's posts, as referenced above, I managed to get an Automation Object compiled and working with .Net 3.5 and Visual Studio 2008. To download the full solution sample code for a Hello World example (including a fob file), go to http://adventuresindotnet.blogspot.com/ ... bject.html
Tim Larson0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K 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
- 328 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