怎样获取系统约会信息?
怎样获取系统约会信息?
[解决办法]
通过POOM API
[解决办法]
系统目录下的有POOM事例代码,好象是POOMManager.找找看!
[解决办法]
void ReadAppointment(TCHAR *strRet)
{
HRESULT hr = 0;
IPOutlookAppPtr m_pPOOMApp;
CLSID clsid;
LPOLESTR pProgID = L "PocketOutlook.Application ";
hr = CLSIDFromProgID(pProgID,&clsid);
if ( SUCCEEDED( m_pPOOMApp.CoCreateInstance(clsid, NULL, CLSCTX_INPROC_SERVER) ) )
{
if( SUCCEEDED(m_pPOOMApp-> Logon(NULL)) )
{
IFolderPtr pFolder;
if( SUCCEEDED(m_pPOOMApp-> GetDefaultFolder(olFolderCalendar,&pFolder)) )
{
IPOutlookItemCollectionPtr pItemCol;
CComBSTR bstrSubject,bstrDidian;
DATE dt1,dt2;
if (SUCCEEDED(pFolder-> get_Items(&pItemCol)))
{
int cItems = 0;
pItemCol-> get_Count(&cItems);
for (int i = 1; i <= cItems; i++)
{
IAppointmentPtr pAppointment;
if ( SUCCEEDED(pItemCol-> Item(i, (IDispatch**)&pAppointment)) )
{
pAppointment-> get_Subject(&bstrSubject);
pAppointment-> get_Location(&bstrDidian);
pAppointment-> get_Start(&dt1);
pAppointment-> get_End(&dt2);
TCHAR fname[1024];
_stprintf(fname, _T( "%s|||%s|||未知|||未知\n "), bstrSubject,bstrDidian);
wcscat(strRet + strRet[wcslen(strRet)] , fname);
}
}
}
pFolder.Release();
}
}
}
}