User manual

Chapter 2 Fundamentals of Building Windows Applications
NI-DAQ User Manual for PC Compatibles 2-6 ni.com
The following paragraph illustrates declarations of functions.
For Visual Basic 4.0 or later, 32-bit:
Declare Function GlobalAlloc Lib "kernel32" Alias
"GlobalAlloc" (ByVal wFlags As Long, ByVal dwBytes As
Long) As Long
Declare Function GlobalFree Lib "kernel32" Alias
"GlobalFree" (ByVal hMem As Long) As Long
Declare Function GlobalLock Lib "kernel32" Alias
"GlobalLock" (ByVal hMem As Long) As Long
Declare Function GlobalReAlloc Lib "kernel32" Alias
"GlobalReAlloc" (ByVal hMem As Long, ByVal dwBytes As
Long, ByVal wFlags As Long) As Long
Declare Function GlobalUnlock Lib "kernel32" Alias
"GlobalUnlock" (ByVal hMem As Long) As Long
String Passing
In Visual Basic, variables of data type
String
need no special
modifications to be passed to NI-DAQ for Windows functions. Visual
Basic automatically appends a null character to the end of a string before
passing it (by reference, because strings cannot be passed by value in
Visual Basic) to a procedure or function.
Parameter Passing
By default, Visual Basic passes parameters by reference. Prepend the
ByVal
keyword if you need to pass by value.