KRAZR EnumRecInitEx not working | developer.brewmp.com KRAZR EnumRecInitEx not working | developer.brewmp.com

Developer

KRAZR EnumRecInitEx not working

Forums:

I'm trying to search all the phone numbers on the KRAZR for a match. It works fine on the Simulator. It fails on the real device:

AEEAddrCat cat;
AEEAddrEnumRecInfo recInfo;
AEEAddrFieldID fieldList[7];
AEEAddrFieldType type;
uint16 searchSize;
AECHAR search[] = {'5','5','4','2','2','2','2', '\0'};

cat = AEE_ADDR_CAT_GENERAL;
searchSize = (WSTRLEN(search)+1)*sizeof(AECHAR);

type = AEEDB_FT_PHONE;

fieldList[0] = AEE_ADDRFIELD_PHONE_GENERIC;
fieldList[1] = AEE_ADDRFIELD_PHONE_HOME;
fieldList[2] = AEE_ADDRFIELD_PHONE_WORK;
fieldList[3] = AEE_ADDRFIELD_PHONE_FAX;
fieldList[4] = AEE_ADDRFIELD_PHONE_PAGER;
fieldList[5] = AEE_ADDRFIELD_PHONE_CELL;
fieldList[6] = AEE_ADDRFIELD_PHONE_CELL2;

recInfo.pCatList = &cat;
recInfo.nCategories = 1;
recInfo.pFieldList = (AEEAddrFieldID *)&fieldList;
recInfo.nFields = 7;
recInfo.pTypeList = (AEEAddrFieldType *)&type;
recInfo.nTypes = 1;
recInfo.pData = (void *)search;
recInfo.dwDataSize = searchSize;
recInfo.fType = AEEDB_FT_PHONE;
recInfo.flags = ABSF_MATCH_EQUAL | ABSF_CASE_INSENSITIVE;

pMe->m_pAdrErr = IADDRBOOK_EnumRecInitEx( pMe->m_pIAddrBook,(AEEAddrEnumRecInfo *)&recInfo );

I'm always getting EFAILED. {BTW - the number exists on the phone}

What is AEE_ADDR_CAT_GENERAL? That isn't one of the defined types of AEEAddrCat. Try using the defined types, like AEE_ADDR_CAT_NONE or AEE_ADDR_CAT_PERSONAL.

What is AEE_ADDR_CAT_GENERAL? That isn't one of the defined types of AEEAddrCat. Try using the defined types, like AEE_ADDR_CAT_NONE or AEE_ADDR_CAT_PERSONAL.

#define AEE_ADDR_CAT_GENERAL AEE_ADDR_CAT_USER + 1
#define AEE_ADDRFIELD_PHONE_CELL2 AEE_ADDRFIELD_USER + 1
Thanks for trying to help. AEE_ADDR_CAT_NONE will not work on the KRAZR. One has to use AEE_ADDR_CAT_GENERAL to search all categories.
BTW - this general search DOES work:
pMe->m_pAdrErr = IADDRBOOK_EnumRecInit(pMe->m_pIAddrBook,
AEE_ADDR_CAT_GENERAL, AEE_ADDRFIELD_NONE,
(void *)search, searchSize);
But I am trying to get it to search in specific fields.

#define AEE_ADDR_CAT_GENERAL AEE_ADDR_CAT_USER + 1
#define AEE_ADDRFIELD_PHONE_CELL2 AEE_ADDRFIELD_USER + 1
Thanks for trying to help. AEE_ADDR_CAT_NONE will not work on the KRAZR. One has to use AEE_ADDR_CAT_GENERAL to search all categories.
BTW - this general search DOES work:
pMe->m_pAdrErr = IADDRBOOK_EnumRecInit(pMe->m_pIAddrBook,
AEE_ADDR_CAT_GENERAL, AEE_ADDRFIELD_NONE,
(void *)search, searchSize);
But I am trying to get it to search in specific fields.

Has anyone managed to nail the problem?
In fact I am experiencing the same error returned by IADDRBOOK_EnumRecInitEx and in the output I can see also the following error:
"addrbookshim.c:1251 - ***AddrBookShim_EnumRecInit: invalid category 32767"
What does that mean?

Has anyone managed to nail the problem?
In fact I am experiencing the same error returned by IADDRBOOK_EnumRecInitEx and in the output I can see also the following error:
"addrbookshim.c:1251 - ***AddrBookShim_EnumRecInit: invalid category 32767"
What does that mean?

hey frd,
I am facing the same issue on the handset, it works on simulator correctly.
addrbookshim.c:1251 - ***AddrBookShim_EnumRecInit: invalid category 32767
I am using PERSONAL category, is there a way to find out that which category doies handset support ?

hey frd,
I am facing the same issue on the handset, it works on simulator correctly.
addrbookshim.c:1251 - ***AddrBookShim_EnumRecInit: invalid category 32767
I am using PERSONAL category, is there a way to find out that which category doies handset support ?

For category information on the deivce use IADDRBOOK_EnumCategoryInit(...) and IADDRBOOK_EnumNextCategory(..).
Check the api reference.

For category information on the deivce use IADDRBOOK_EnumCategoryInit(...) and IADDRBOOK_EnumNextCategory(..).
Check the api reference.