Article ID: 179233
Article Last Modified on 3/4/2004
//----------------------------------------------------
#import "cdo.dll"
try {
VARIANT vtCalendar;
VARIANT vtFolder; // To Correct Problem: Remark this line and
//variant_t vtFolder; // un-remark this line.
_SessionPtr pSession("MAPI.Session");
pSession->Logon();
vtCalendar.vt = VT_I4;
vtCalendar.lVal = CdoDefaultFolderCalendar;
vtFolder = pSession->GetDefaultFolder(vtCalendar);
// The problem occurs in the "smart-pointer" FolderPtr
// constructor that attempts to call QueryInterface
// on the IDispatch pointer.
FolderPtr pFolder = vtFolder.pdispVal;
pSession->Logoff();
} catch(_com_error e) {
....
}
//----------------------------------------------------
Keywords: kberrmsg kbmsg kbprb kbcode KB179233