E
Eric
Can anyone think of any reason I would be getting a "block not found"
(9) error when trying to get the AppointmentItem property from an
Exception object?
I'm able to check the "Exception.Deleted" value, and it is "FALSE". I
know it isn't deleted anyway. I'm also able to get any of the other
"Excpetion." properties, like OriginalDate, Session, Application,
Class (=30).
I'm making this calls from a seperate thread, from a COM add-in DLL,
but all of my other OLE code works fine, and like I say, I can check
all the other properties of the Excpetion object, so why can't I get
the "AppointmentItem" property. Is there something special about it?
I'm able to use Outlook Spy, or VBScript, and I can get the property
just fine. It is just my C++ code which isn't working.
Here is some of my source code. As you can see I'm using the same
"GetOleProp" call several times in a row, and it works fine, until I
get the the AppointmentItem property, where it fails with the "block
not found" type of error (0x????0009).
---------
HRESULT hr;
VARIANT v,p1;
hr = DoOleMethod(item,L"GetRecurrencePattern",&v,0);
assert(!(FAILED(hr) || v.vt != VT_DISPATCH || !v.pdispVal));
IDispatch *rp = v.pdispVal;
hr = GetOleProp(rp,L"Exceptions",&v);
assert(!(FAILED(hr) || v.vt != VT_DISPATCH || !v.pdispVal));
IDispatch *exps = v.pdispVal;
p1.vt = VT_I4;
p1.lVal = 1;
hr = DoOleMethod(exps,L"Item",&v,1,&p1);
assert(!(FAILED(hr) || v.vt != VT_DISPATCH || !v.pdispVal));
IDispatch *exp = v.pdispVal;
hr = GetOleProp(exp,L"AppointmentItem",&v);
if(!FAILED(hr) && v.vt == VT_DISPATCH && v.pdispVal)
{
v.pdispVal->Release();
Prompt("Wow, it worked!");
}
(9) error when trying to get the AppointmentItem property from an
Exception object?
I'm able to check the "Exception.Deleted" value, and it is "FALSE". I
know it isn't deleted anyway. I'm also able to get any of the other
"Excpetion." properties, like OriginalDate, Session, Application,
Class (=30).
I'm making this calls from a seperate thread, from a COM add-in DLL,
but all of my other OLE code works fine, and like I say, I can check
all the other properties of the Excpetion object, so why can't I get
the "AppointmentItem" property. Is there something special about it?
I'm able to use Outlook Spy, or VBScript, and I can get the property
just fine. It is just my C++ code which isn't working.
Here is some of my source code. As you can see I'm using the same
"GetOleProp" call several times in a row, and it works fine, until I
get the the AppointmentItem property, where it fails with the "block
not found" type of error (0x????0009).
---------
HRESULT hr;
VARIANT v,p1;
hr = DoOleMethod(item,L"GetRecurrencePattern",&v,0);
assert(!(FAILED(hr) || v.vt != VT_DISPATCH || !v.pdispVal));
IDispatch *rp = v.pdispVal;
hr = GetOleProp(rp,L"Exceptions",&v);
assert(!(FAILED(hr) || v.vt != VT_DISPATCH || !v.pdispVal));
IDispatch *exps = v.pdispVal;
p1.vt = VT_I4;
p1.lVal = 1;
hr = DoOleMethod(exps,L"Item",&v,1,&p1);
assert(!(FAILED(hr) || v.vt != VT_DISPATCH || !v.pdispVal));
IDispatch *exp = v.pdispVal;
hr = GetOleProp(exp,L"AppointmentItem",&v);
if(!FAILED(hr) && v.vt == VT_DISPATCH && v.pdispVal)
{
v.pdispVal->Release();
Prompt("Wow, it worked!");
}