IMENUCTL Problem | developer.brewmp.com IMENUCTL Problem | developer.brewmp.com

Developer

IMENUCTL Problem

Forums:

Hi
I am dynamically creating a menu using a function mentioned bellow. It is getting all the value, but displaying only one menu item i.e the first menu item. what might be reason could you please let me know
regards pramod

Function defination bellow:

static boolean AddMenuItem(strLogin *pLogin, char* str)
{
boolean menuCreated;
char* wData;
// char* mText;
int strLength=0;
int strLength2=0;
uint16 nID = 0;
int dwData=0;
AECHAR *menutxt={0};
AECHAR menuText[30]={0};
menuCreated=FALSE;
strLength=STRLEN(str);
wData=strtok(str,",");
WriteLine(pLogin,wData);
dwData=ATOI(wData);
while ((wData=strtok(NULL,","))!=NULL)
{
//mText=(char*)MALLOC(strLength*sizeof(char));
//STRCPY(mText,wData);
//strLength2=STRLEN(wData);
WriteLine(pLogin,wData);
STR_TO_WSTR(wData,menuText,sizeof(menuText));
//menutxt=(AECHAR*)MALLOC( WSTRLEN(menuText)*sizeof(AECHAR) );
//WSTRCPY(menutxt,menuText);
IMENUCTL_AddItem(pLogin->m_pIMenu , NULL, 0, (uint16)dwData, (AECHAR*)menuText, (uint32)dwData);
//IMENUCTL_SetActive(pLogin->m_pIMenu,TRUE);
//FREEIF(menutxt);
menuCreated=TRUE;
}
return menuCreated;
//IMENUCTL_SetActive(pLogin->m_pIMenu,TRUE);

There's nothing in your loop that changes the value of dwData, so all of your menu entries are being added with the same item ID.

There's nothing in your loop that changes the value of dwData, so all of your menu entries are being added with the same item ID.