LabVIEW
To omit an optional parameter in LabVIEW, do not wire the input terminal for the parameter on the method Invoke Node.
LabWindows/CVI
Pass the value
CA_DEFAULT_VAL
to omit an optional input parameter. You cannot pass
CA_DEFAULT_VAL
to an output or in/out parameter. To omit an optional output or in/out parameter, initialize a local variable using a VARIANT type to the value
CA_DEFAULT_VAL
and pass the address of the local variable.
Note
[Com Threading]
When you call an ActiveX function from a thread with a COM threading model that has not been selected, LabWindows/CVI automatically places the thread in the Multi-threaded Apartment (MTA). This also occurs when you use the CA_DEFAULT_VAL macro because the macro resolves to an ActiveX library function. Any thread that loads a panel that contains an ActiveX control must be in an Single-threaded Apartment (STA) thread because ActiveX controls cannot be loaded in an MTA thread. To ensure a thread is in an STA, you must either load a panel with an ActiveX control or call
CA_InitActiveXThreadStyleForCurrentThread
with a value of
COINIT_APARTMENTTHREADED
before making any ActiveX library calls in the thread.
Microsoft Visual Basic and Microsoft Visual Basic .NET
In Microsoft Visual Basic and Microsoft Visual Basic .NET, do not specify the parameter.
C Sharp
Pass
System.Type.Missing
to omit an optional input parameter. You cannot pass
System.Type.Missing
to an out or ref parameter. To omit an out or ref parameter, initialize a local variable using an object type to the value
System.Type.Missing
and pass the local variable.
C++ (Using Compiler COM)
Pass the value
vtMissing
to omit an optional input parameter. Pass
&vtMissing
to omit an optional output or in/out parameter.