马上注册登录,享用更多网站功能!
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
我设计了一个对话框,意图是:根据MENUOPTION1中的index来动态地设置MENUOPTION2中显示的内容。在编译时提示MENUOPTION2中的strings没有初始化。请教各位高手该如何解决?程序如下:
int TYPE_dalei_index_cb ( int dialog_id,
void * client_data,
UF_STYLER_item_value_type_p_t callback_data)
{
UF_STYLER_item_value_type_t item1_data,item2_data;
int index;
char xiaolei_opt[6][20]={"a1","a2","a3","a4","a5","a6"};
int row_num;
row_num=2;
/* Make sure User Function is available. */
if ( UF_initialize() != 0)
return ( UF_UI_CB_CONTINUE_DIALOG );
/* ---- Enter your callback code here ----- */
//get the index of the dalei option menu.
item1_data.item_attr=UF_STYLER_VALUE;
item1_data.item_id=TYPE_DALEI_OPTION;
item1_data.indicator=UF_STYLER_INTEGER_VALUE;
UF_STYLER_ask_value(dialog_id, [$item1_data)]
index=item1_data.value.integer;
//according to the index value to change the text of the xiaolei option menu.
//item2_data.indicator=UF_STYLER_STRING_PTR_VALUE;
item2_data.value.strings[0]=xiaolei_opt[0];
item2_data.value.strings[1]=xiaolei_opt[1];
if(index!=0)
{
if(index==1)
{
item2_data.value.strings[0]=xiaolei_opt[2];
item2_data.value.strings[1]=xiaolei_opt[3];
}
else
{
item2_data.value.strings[0]=xiaolei_opt[4];
item2_data.value.strings[1]=xiaolei_opt[5];
}
}
item2_data.item_attr=UF_STYLER_SUBITEM_VALUES;
item2_data.item_id=TYPE_XIAOLEI_OPTION;
item2_data.count=row_num;
UF_STYLER_set_value(dialog_id, [$item2_data)]
/* else
{
item2_data.value.strings[0]=xiaolei_opt[0];
item2_data.value.strings[1]=xiaolei_opt[1];
}
*/
UF_terminate ();
/* Callback acknowledged, do not terminate dialog */
return (UF_UI_CB_CONTINUE_DIALOG);
/* or Callback acknowledged, terminate dialog. */
/* return ( UF_UI_CB_EXIT_DIALOG ); */
}
编译提示:warning C4700: local variable 'item2_data' used without having been initialized。 |