LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Library errors

My code returs Library function error (return value == -38) - the id passed must be a menu id or menu item id.

 

Using CVI 8.5 full feature OI. This occurs in RebuildEditMenu() function on the call TS_CleanupMenu().

 

If I comment out the TS_CleanupMenu() call then it return menu id error -13 - Invalid control ID on RunUserInterface() function.

 

I do have another cvi code that launched the custom UUT dialog box and this error is reported every time a particular button of the dialog is clicked.

 

static int RebuildEditMenu()
{
int error = 0;
CAObjHandle viewMgr = 0;
int menuBar;

menuBar = GetPanelMenuBar(gMainWindow.panel);

// determine which view manager the menu commands apply to
errChk( GetActiveViewManager(&viewMgr));

// discard any current menu items that were inserted by TS_InsertCommandsInMenu
errChk( TS_RemoveMenuCommands(menuBar, BAR_EDIT, FALSE, FALSE));

// rebuild Edit menu
errChk( TS_InsertCommandsInMenu(sEditMenuCommands, menuBar, BAR_EDIT, -1, viewMgr, NULL, TRUE, errMsg));

// remove duplicate separators and shortcut keys
errChk( TS_CleanupMenu(menuBar, 0)); //jjt

Error:
return error;
}

 

Any advice as to what is causing the error.

TIA

0 Kudos
Message 1 of 2
(2,865 Views)

Hi sonotk,

 

Would it be possible to post a screenshot of the errors you're seeing, specifically the first error (the library function error)?

 

Thanks!

0 Kudos
Message 2 of 2
(2,850 Views)