K
Krzysztof ¯elechowski
What is wrong with the following code?
CoInitializeEx(NULL, COINIT_MULTITHREADED); int i(01);
for(; i < argc; i++) {
static MULTI_QI interfaces[01] = {&__uuidof(_Workbook), NULL, 00}; // i
tried also IID_IDispatch, does not work either
HRESULT code;
wcout << _T("Trying to open file ") << argv << _T(" ... "); // argv[01]
== "sheet.xls"
if(SUCCEEDED(code = CoGetInstanceFromFile(NULL, NULL, NULL, CLSCTX_ALL,
STGM_READ, argv, 01, interfaces))) {
cout << _T("opened.") << endl;
interfaces->pItf->Release(); }
else {
wcout << _T("failed.") << endl;
HandleCOMError(code); } // code returned is E_NOINTERFACE
CoInitializeEx(NULL, COINIT_MULTITHREADED); int i(01);
for(; i < argc; i++) {
static MULTI_QI interfaces[01] = {&__uuidof(_Workbook), NULL, 00}; // i
tried also IID_IDispatch, does not work either
HRESULT code;
wcout << _T("Trying to open file ") << argv << _T(" ... "); // argv[01]
== "sheet.xls"
if(SUCCEEDED(code = CoGetInstanceFromFile(NULL, NULL, NULL, CLSCTX_ALL,
STGM_READ, argv, 01, interfaces))) {
cout << _T("opened.") << endl;
interfaces->pItf->Release(); }
else {
wcout << _T("failed.") << endl;
HandleCOMError(code); } // code returned is E_NOINTERFACE