Frequently Asked Questions > How do I handle optional parameters in VSFlexGrid using C++? |
Optional parameters are always Variants. To omit optional parameters, use Variants of type VT_ERROR. For example:
Example Title |
Copy Code
|
---|---|
VARIANT v;
V_VT(&v) = VT_ERROR;
fg.AddItem("hello\tmy friend", v);
|
Note that using ActiveX controls in Visual C++ is a little different, depending on whether you are using MFC or not. The wrapper classes generated by the MFC Class Wizard require you to pass optional parameters as illustrated above. The wrapper classes generated by the #import statement supply default values for optional parameters, so you may simply omit them.
For more details and tips on using the VSFlexGrid control in Visual C++, see the Using VSFlexGrid in Visual C++ topic in the documentation.