#define MAX_BUF_SIZE 256
#define MAX_DATE_LENGTH 64
WORD wNumRecProps = 0;
LPBYTE lpRecProps = NULL;
PCEPROPVAL pCePropVal;
DWORD dwBufLen = MAX_BUF_SIZE;
DWORD index ;
HANDLE m_hLogDB;
CEOID oid = 0;
CEGUID g_ceguid = {0};
CREATE_INVALIDGUID(&g_ceguid);
if(FALSE == CeMountDBVolEx(&g_ceguid, L"//pim.vol", NULL , OPEN_EXISTING ))//不是mxip_initdb.vol 吗?
{
DWORD dwErr = GetLastError();
CeUnmountDBVol(&g_ceguid);
return FALSE;
}
m_hLogDB = CeOpenDatabaseInSession(NULL, &g_ceguid, &oid, L"clog.db", NULL, CEDB_AUTOINCREMENT, NULL);
CEOID ceoid = CeSeekDatabaseEx(m_hLogDB,CEDB_SEEK_END,0,0,NULL);
ceoid = CeReadRecordPropsEx(m_hLogDB, CEDB_ALLOWREALLOC, &wNumRecProps, NULL, &lpRecProps, &dwBufLen, NULL);
if(!ceoid)
{
DWORD dwErr = GetLastError();
//MessageBox(NULL, L"222",L"Error",MB_OK);
return FALSE;
}
pCePropVal = (PCEPROPVAL)lpRecProps;
LPWSTR lpnum = pCePropVal[4].val.lpwstr;//号码
SYSTEMTIME stReceiveTime , endReceiveTime;
FILETIME startLocalFileTime , endLocalFileTime;
TCHAR szReceiveTime_start[MAX_DATE_LENGTH] = {0};
TCHAR szReceiveTime_end[MAX_DATE_LENGTH] = {0};
//FileTimeToSystemTime(&pCePropVal[1].val.filetime, &stReceiveTime);
FileTimeToLocalFileTime(&pCePropVal[1].val.filetime , &startLocalFileTime);
FileTimeToSystemTime(&startLocalFileTime , &stReceiveTime);
FileTimeToLocalFileTime(&pCePropVal[2].val.filetime , &endLocalFileTime);
FileTimeToSystemTime(&endLocalFileTime , &endReceiveTime);
long TypeId = pCePropVal[3].val.lVal;
BOOL bCallType = FALSE;
//拨出接是7
//拨出不接是5
//拨入接是6
//拨入不接是4
//反正这个我没弄明白
if(TypeId == 6)
{
TypeId = 1;//已接
bCallType = FALSE;
}
else if(TypeId == 4)
{
TypeId = 2;//未接
//Enter here
bCallType = FALSE;
}
else
{
bCallType = TRUE;
TypeId = 3;//拨出
}
BOOL bErr = CeDeleteRecord(m_hLogDB, ceoid);
//return S_OK;
CloseHandle(m_hLogDB);
return TRUE;
删除通话记录
最新推荐文章于 2021-05-29 00:21:05 发布