I am trying to use a vector on the backside of a COM interface in microsoft visual c++ 6.0. All compiles and runs....but the return value of the com function is zero.
First I call the below function to add a new sheet to the vector
This function is called internally in the c++ COM dll
void CSheetStore::addSheet(SHEE
T* sht)
{
sheetStoreCurrent.addSheet
(sht);
}
Then from C#, I call the below function and it always returns zero.
STDMETHODIMP CSheetStore::get_BestSheet
s(int* cnt)
{
try
{
*cnt = vecBestShts.size();
}
catch (Except& x) { return onError(x); }
catch (_com_error& x) { return onError(x); }
return S_OK;
}
I am new to COM but not to using vectors, what am I missing? I have done this before in non-COM apps with no trouble.
Start Free Trial