Hi All,
How to create a DLL file in Visual Studio 2008,then How to use that DLL file in Navison…If any one know please tell me…Thanks in Advance…
Hi All,
How to create a DLL file in Visual Studio 2008,then How to use that DLL file in Navison…If any one know please tell me…Thanks in Advance…
can u explain the scenario where u want to use this
Creating DLL and use it in navision
Create a new class library project named DDL Sample in Visual Studio.
Add a new file called DLL Sample with the following code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Runtime.InteropServices;
namespace DLL_Sample
{
[ClassInterface(ClassInterfaceType.AutoDual)]
[ProgId(“Class1”)]
[ComVisible(true)]
public class Class1
{
public int add(int a, int b)
{
return a + b;
}
}
}
View the Properties of the project.
On the Build tab set the Register for COM interop property to True (checked).
Save and compile your objects.
Create a new object in navision say form.
Write the following code in onpush of button.
if isclear(sample) then
create(sample);
message(format(sample.add(12,12)));
Where Sample is of type automation of subtype ‘DLL_Sample’.Class1
The subtype depends on the project name and class name that you have entered.
Hi Karthik,
Thanks for your reply…it is very helpful for me…thanks[:)]…