Forums | developer.brewmp.com Forums | developer.brewmp.com

Developer

Forums

hi all,
I use IMENUMODEL_SetPfnFree to set callback to release memory, but the callback function never be invoked...my sample code are as follows:

1. create piMenuModel: ISHELL_CreateInstance(pMe->piShell, AEECLSID_MENUMODEL, (void**)&pMe->piMenuModel);
2. set menu model to list widget: IWIDGET_SetModel(piListWidget, IMENUMODEL_TO_IMODEL(pMe->piMenuModel));
3. Add menu items: IMENUMODEL_Add(piMenuModel, piStaticInfo, index, MMF_ENABLED);
4. set callback function: IMENUMODEL_SetPfnFree(pMe->piMenuModel, listCB);

void listCB(void *pvitem)
{
//do someting here.....But...this function doesn't be executed...why...

Pls give a tip, if i miss something so that callback function doesn't work?

Callback registered with IMENUMODEL_SetPfnFree( is called when you delete data using IMENUMODEL_DeleteAll or IMENUMODEL_DeleteAt.

Callback registered with IMENUMODEL_SetPfnFree( is called when you delete data using IMENUMODEL_DeleteAll or IMENUMODEL_DeleteAt.

hi Atul
yes, I found it in BREW Doc, thx ur help...:)

hi Atul
yes, I found it in BREW Doc, thx ur help...:)