Thanks for your reply. From the attached code sample, one call to LocalizeMenuBar produce total # of blocks allocated = 6 and total # of bytes = 192; two calls produce # blocks = 12 and # bytes = 384; and keeps increasing as I increase the number of calls to the function by switching back and forth between Spanish and English.
#include <utility.h>
#include "localui.h"
#include <cvirte.h>
#include <userint.h>
#include "LoadMenuBarTest.h"
#include "menu.h"
static int panelHandle, menuPanel;
static int menu = 0;
int __stdcall WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPSTR lpszCmdLine, int nCmdShow)
{
if (InitCVIRTE (hInstance, 0, 0) == 0)
return -1; /* out of memory */
if ((panelHandle = LoadPanel (0, "LoadMenuBarTest.uir", PANEL)) < 0)
return -1;
if ((menuPanel = LoadPanel (0, "menu.uir", MENUPANEL)) < 0)
return -1;
menu = LoadMenuBar (0, "menu.uir", MENU);
DisplayPanel (panelHandle);
RunUserInterface ();
DiscardPanel (panelHandle);
DiscardMenuBar(menu);
DiscardPanel (menuPanel);
//////////////////////
CVIDynamicMemoryInfo ("Dynamic Memory", NULL, NULL, DYNAMIC_MEMORY_SHOW_ALLOCATED_MEMORY);
//////////////////////
return 0;
}
int CVICALLBACK Quit (int panel, int control, int event,
void *callbackData, int eventData1, int eventData2)
{
if (event == EVENT_COMMIT) {
QuitUserInterface (0);
}
return 0;
}
int CVICALLBACK ShowMenuPopup (int panel, int control, int event,
void *callbackData, int eventData1, int eventData2)
{
int itemSelected = 0;
if (event == EVENT_COMMIT) {
itemSelected = RunPopupMenu (menu, MENU_LANGUAGE, panel, 0, 0, 0, 0, 0, 0);
if (itemSelected == MENU_LANGUAGE_SPANISH) {
LocalizeMenuBar(menu, "lang_span.lwl");
SetMenuBarAttribute (menu, MENU_LANGUAGE_SPANISH, ATTR_CHECKED, 1);
SetMenuBarAttribute (menu, MENU_LANGUAGE_ENGLISH, ATTR_CHECKED, 0);
}
else if (itemSelected == MENU_LANGUAGE_ENGLISH) {
LocalizeMenuBar(menu, "lang_engl.lwl");
SetMenuBarAttribute (menu, MENU_LANGUAGE_SPANISH, ATTR_CHECKED, 0);
SetMenuBarAttribute (menu, MENU_LANGUAGE_ENGLISH, ATTR_CHECKED, 1);
}
}
return 0;
}