A blog on Tally Integration, to import and export data from Tally.ERP programmatically using VB6, VB.NET,C#,ASP.NET etc

Saturday, May 19, 2007

Using RTSLINK DLL in VB.NET

PInvoke is the mechanism by which .NET languages can call unmanaged functions in DLLs. This is especially useful for calling Windows API functions that aren’t encapsulated by the .NET Framework classes, as well as for other third-party functions provided in DLLs.

Using PInvoke in VB.NET to call RTSLINK DLL functions

There are mainly two ways in which you can use PInvoke in VB
1) Using the Declare Statement
2) Using DllImport

Using the Declare Statement
Declare Auto Function RTSOpen Lib "RTSLINK.DLL" Alias "Open" () As Long
Declare Auto Function Send Lib "RTSLINK.DLL" (ByVal strRequestXML As String) As Long
Declare Auto Function GetLastErrorMessage Lib "RTSLINK.DLL" () As String

Remarks:-
For more information on using PInvoke in VB.NET, please refer the article at CodeProject