恳请各位xdjm解答,谢谢!
sample.uir包括两个panel,Constant Name分别为PANEL和TESTPANEL.
在PANEL上有个string,用
int GetCtrlVal (int Panel_Handle, int Control_ID, void *Value);
函数来取string的值时,书上写的是
GetCtrVal(panel,PANEL_STRING,string);
我不明白的是参数里的panel这个参数.它代表什么?为什么不是panelHandle呢?
generate all code时,Select panels to load....里的Panel Variable Name选项里的参数是什么意思?什么时候该用这个参数呢?
另外如果有几个panel的话,每个panel的Panel Variable Name参数在什么地方能够编辑呢?
我做过试验,好像上面函数里的那个panel用panelHandle也可以阿,为什么?
这个地方我实在是不明白,如果有什么资料的话,更加感激了,谢谢
int GetCtrlVal (int panelHandle, int controlID, void *value);
Obtains the current value of a control.
When the control ID is for a list box or ring control, GetCtrlVal returns the value of the currently selected list item. To obtain the index of the selected list item, use GetCtrlIndex.
![]() |
Note This function is not valid for graph and strip chart controls. |
Input | ||
Name | Type | Description |
panelHandle | integer | Specifier for a particular panel that is currently in memory. You obtain this handle from LoadPanel, NewPanel, or DuplicatePanel. |
controlID | integer | The defined constant, located in the .uir header file, that you assigned to the control in the User Interface Editor, or the ID returned by NewCtrl or DuplicateCtrl. |
Output | ||
Name | Type | Description |
value | void * | The control value. The data type of value must match the data type of the control. |
Name | Type | Description | ||||
status | integer | Return value indicating whether the function was successful. A negative number indicates that an error occurred.
|