How To Pass Optional Parameters to a C DLL Function from VB (153546)
The information in this article applies to:
- Microsoft Visual Basic Learning Edition for Windows 6.0
- Microsoft Visual Basic Learning Edition for Windows 5.0
- Microsoft Visual Basic Professional Edition for Windows 6.0
- Microsoft Visual Basic Professional Edition for Windows 5.0
- Microsoft Visual Basic Enterprise Edition for Windows 6.0
- Microsoft Visual Basic Enterprise Edition for Windows 5.0
- Microsoft Visual Basic Control Creation Edition for Windows 5.0
- Microsoft Visual Basic Standard Edition, 32-bit, for Windows 4.0
- Microsoft Visual Basic Professional Edition, 32-bit, for Windows 4.0
- Microsoft Visual Basic Enterprise Edition, 32-bit, for Windows 4.0
This article was previously published under Q153546 SUMMARY
It is possible to pass optional parameters to a C DLL function from Visual
Basic. Visual Basic supports the Optional Keyword in the Declare statement
that tells the compiler to pass a VARIANT of type VT_ERROR if the
corresponding parameter is omitted in the function call. Otherwise, if the
parameter is not omitted, it is passed according to however it may be
declared. In any case, nothing is optional on the C side of things -- the
function always accepts the fixed number of parameters for which it has
been defined.
This article provides a step-by-step example that demonstrates how to pass
optional parameters to a C DLL function.
Modification Type: | Minor | Last Reviewed: | 7/13/2004 |
---|
Keywords: | kbAPI kbhowto KB153546 |
---|
|