ni.com is currently undergoing scheduled maintenance.
Some services may be unavailable at this time. Please contact us for help or try again later.
07-03-2007 12:11 PM
07-03-2007 02:28 PM
07-03-2007 04:31 PM
This error arises because you are passing a panel handle as a control ID and are using the wrong panel handle in SetCtrlAttribute.
Once you CreateObject function has created the new panel, it returns its panel handle: this is the handle to pass as the first parameter in SetCtrlAttribute. The control ID is then simply the name of the control, so if your anel is PANEL and supposing the chart is named CHART, you should use
SetCtrlAttribute (newPanelID, PANEL_CHART, ATTR_LABEL_TEXT, label);
02-29-2008 02:13 AM
02-29-2008 03:14 AM
Unless you have defined a panel handle with the same name as the panel itself as defined in the UIR editor (which is forbidden by the compiler
), I see a problem in GetPanelHandleFromTabPage (SmlConfig, SmlConfig_TAB, 0, &Tab_uso);
The first parameter to this function must be the panel handle, that is the value returned from LoadPanel:
int SmlConfigHandle;
03-03-2008 01:45 AM
03-03-2008 02:01 AM - edited 03-03-2008 02:02 AM
As far as I can understand, your configuration function is called from a menu loaded on the same panel where the tab control is on. If this is the case, the panel handle is passed to the menu callback as the last parameter, and you can directly use 'panel' instead of your panel_config_equipos variable. The same happens if you were using a command button instead of a menu item: the panel handle is passed as the first parameter to the button callback.
As per defining global variables (i.e. variables usable from multiple .c files in your process) there are several threads in the forum that discuss this argument: here one sample discussion that you may want to read.