![]() | CheckForNull Macro |
Returns from the current function with an error ViStatus if any of the supplied pointer arguments are null.
#define CheckForNull(Vi, ...)
[in] ViSession handle for the driver session.
[in] Comma-separated list of pointer variables to test against null.
This macro is used to validate pointer arguments. If any of the arguments are null, then this macro will return from the current function with a ViStatus value of IVIC_ERROR_NULL_POINTER. Before returning, this function stores the error code and appropriately formatted error message in the driver session so that client code may retrieve both via the GetError function.
The following example demonstrates use of the CheckForNull macro.
ViStatus _VI_FUNC acme4321_ReadData(ViSession Vi, ViReal64* Frequency, ViReal64* Amplitude)
{
ValidateSession(Vi);
ObtainLock(Vi);
CheckForNull(Vi, Frequency, Amplitude);
// ...
}