How do I integrate QAS API Products using VB.Net?

Document type: Tech doc  
Associated product(s): Product name: NameTracerImplementation: APIOS: Windows (more products)
Product name: ProImplementation: APIOS: Windows
Product name: RapidImplementation: APIOS: Windows
Product name: HealthcoderImplementation: APIOS: Windows
Product name: BatchImplementation: APIOS: Windows

Views: 1342  |  Created: 2 years agoLast updated: 2 years ago

Summary

This documents highlights the primary differences between VB X (e.g. 6) and VB.Net integrations so that Visual Basic integrations can be successfully ported to a VB.Net environment.

Solution

Code Changes Required

The primary differences between the VB sample code provided with the current API products and the VB.Net code required are as follows:

1. Function return values declared as Long must be changed to Integer. Similarly, arguments passed to these functions that were declared as Longs must also be declared as Integers. When changing these declarations be sure to change them in the declarations BAS module as well as the code itself.

Example

Declare Function QAPro_Search Lib "QAPUIEB.DLL" (ByVal vs1 As String) As Long

becomes

Declare Function QAPro_Search Lib "QAPUIEB.DLL" (ByVal vs1 As String) As Integer

Additionally, any variables that are declared as type Integer must now be declared as Short.

2. Strings in the VB.Net environment can no longer be declared with an absolute length, which means that string declarations such as Dim addBuffer As String * 200 are not compatible. Subsequently strings must be declared as follows.

Dim addBuffer As String

addBuffer = Space (200)

Related links

Further information on upgrading applications from VB 6 to VB.Net can be found at:

http://msdn.microsoft.com/library/default.asp?URL=/library/techart/vb6tovbdotnet.htm

Was this document helpful?

What can we do to improve this information?