# LoadLocalizedMenuBar

int LoadLocalizedMenuBar (int destinationPanelHandle, const char *menuBarResourceFile, int menuBarResourceID, const char *languageResourceFile, int *menuBarHandle);

## Purpose

This function is similar to LoadMenuBar, except that it applies the translated strings in the language resource file (*.lwl) to the specified menu bar.

See LoadMenuBar help for more information.

Use the platform SDK function GetLocaleInfo to get the system or user default language.

## Parameters

Input
Name | Type | Description
destinationPanelHandle | integer | The handle for the panel on which the menu bar is to reside. This handle will have been returned by the LoadPanel, NewPanel, or DuplicatePanel function. If the destination panel is not currently in memory, pass a zero as the destinationPanelHandle and this menu bar can later be assigned to a panel using SetPanelMenuBar.
menuBarResourceFile | const char * | The name of the User Interface Resource file (*.uir) or the Text Format User Interface file (*.tui) that contains the menubar. You can use a complete pathname or a simple filename. If the name is a simple filename (i.e., contains no directory path) and the file is listed in the project, then the file is loaded using the pathname from the project. If the name is a simple filename (i.e., contains no directory path) but the file is not listed in the project, then the file is loaded from the directory containing the project.
menuBarResourceID | integer | If the specified file is a User Interface Resource (*.uir) file, the menuBarResourceID is the defined constant that was assigned to the menu bar in the User Interface Editor. The menu bar resource ID can be found in the UIR header file. If the file is a Text Format User Interface (*.tui) file, the menuBarResourceID is the header number of the .tui file section in which the menu bar is defined. For example, if the section header for the desired menu bar is [MenuBar003], then the menuBarResourceID would be 3. LoadMenuBar loads all of the menus and menu items in the .tui file whose section headers are of the form [MenuBarNNN_...] where NNN is the menuBarResourceID passed to the function. The Menu ID or Menu Item ID that you pass to User Interface Library functions is based on a depth-first traversal of all of the items in the menu tree, starting at 2. (For submenu items, the submenu itself has an id that is one greater than the item id of the submenu entry in the parent menu.) If you save a .tui file in the User Interface Editor in LabWindows/CVI 5.0 or later, and you have an up-to-date include (.h) file generated by the User Interface Editor, you can use the panel, control, menu bar, menu, and menu item constants in the include file as parameters to User Interface Library functions. The menuBarResourceID is used only once to load the panel into memory. Subsequent function calls refer to this panel with the Menu Bar Handle returned by this function.
languageResourceFile | const char * | This file contains translated strings of the strings in the menu bar resource file.
Output
Name | Type | Description
menuBarHandle | integer * | The value which you must use in subsequent function calls to specify this menu bar. Zero is not a valid menu bar handle. Use DiscardMenuBar to discard.

## Return Value

Name | Type | Description
status | integer | Indicates whether the function was successful. A zero indicates success. A negative value indicates an error. If the value is from –1 to –999, it is one of the error values defined in userint.h. Otherwise, it is one of the error values defined in toolbox.h. Use GetGeneralErrorString in the toolbox to get a description. Among the more commonly encountered errors are:
–12 | Out of memory!
–91 | Too many files are open.
–93 | Input/Output error.
–94 | File not found.
–95 | File access permission denied.
–97 | Disk is full.
–99 | File already open.
–100 | Badly formed pathname.
–6000 | Invalid or corrupt language file