I have an MFC wrapper over a COM object. There is a function that takes a large number of options, which are mostly optional. How do I pass some arguments but not others?
For what it's worth, the optional arguments are listed as VARIANT*.
Below is the code
CComVariant vFalse = false;
CApplication application;
{
application.CreateDispatch(_T("Word.Application"));
CDocuments documents = application.get_Documents();
CComVariant vFilename = _T("c:\\temp\\test.rtf");
CComVariant vNothing;
CComVariant vEmpty = _T("");
CComVariant vOpenFormat = 0;
application.put_Visible(TRUE);
//
// THIS FUNCTION has a number of optional arguments
//
LPDISPATCH pDocument = documents.Open(&vFilename, &vFalse, &vFalse, &vFalse, &vEmpty, &vEmpty, &vFalse, &vEmpty, &vEmpty, &vOpenFormat, &vOpenFormat, &vFalse, &vFalse, &vOpenFormat, &vFalse, &vFalse);
}
application.Quit(&vFalse, NULL, NULL);