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 Declaration | Visual Basic Declaration | Variable to Use When Calling |
---|---|---|
Pointer to string (LPSTR) | ByVal S As String | Any String or Variant variable |
Pointer to integer (LPINT) | I As Integer | Any Integer or Variant variable |
Pointer to long (LPDWORD) | L As Long | Any Long or Variant variable |
Pointer to struct (such as, LPRECT) | S As Rect | Any variable of that user-defined type |
Integer (INT, UINT, WORD, BOOL) | ByVal I As Integer | Any Integer or Variant variable |
Handle (hWnd, hDC, hMenu, etc.) | ByVal h As Integer | Any Integer or Variant variable |
Long (DWORD, LONG) | ByVal L As Long | Any Long or Variant variable |
Pointer to integers | I As Integer | The first element of the array, for example I(0) |
Pointer to void (void *) | As Any | Any variable (use ByVal with strings) |
Void (function return value) | Sub procedure | not 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. |