Understanding Visual Basic API Declarations

In your programs, you use the Visual Basic equivalents of C language declarations. The following table shows C language declarations, the way they are declared in the Visual Basic ESB32.BAS file, and how to call them in a Visual Basic procedure.

C DeclarationVisual Basic DeclarationVariable to Use When Calling
Pointer to string (LPSTR)ByVal S As StringAny String or Variant variable
Pointer to integer (LPINT)I As IntegerAny Integer or Variant variable
Pointer to long (LPDWORD)L As LongAny Long or Variant variable
Pointer to struct (such as, LPRECT)S As RectAny variable of that user-defined type
Integer (INT, UINT, WORD, BOOL)ByVal I As IntegerAny Integer or Variant variable
Handle (hWnd, hDC, hMenu, etc.)ByVal h As IntegerAny Integer or Variant variable
Long (DWORD, LONG)ByVal L As LongAny Long or Variant variable
Pointer to integersI As IntegerThe first element of the array, for example I(0)
Pointer to void (void *)As AnyAny variable (use ByVal with strings)
Void (function return value)Sub procedurenot applicable

In the main form of your program, include the following lines to set the Boolean variables ESB_TRUE and ESB_FALSE, which occur in user-defined types such as the initialization structure ESB_INIT_T:

ESB_TRUE = 1
ESB_FALSE = 0

Note:

See the Microsoft Visual Basic Documentation for information about using C-language DLLs in Visual Basic programs.