__declspec(dllimport)void QueryPart();//此为外部动态链接库函数声明
static UF_MB_cb_status_t query_part(
UF_MB_widget_t widget,
UF_MB_data_t client_data,
UF_MB_activated_button_p_t call_button);
static UF_MB_action_t action_table[] =
{
{"QUERY_PART",query_part,NULL},
{ NULL, NULL, NULL}
};
static UF_MB_cb_status_t query_part(
UF_MB_widget_t widget,
UF_MB_data_t client_data,
UF_MB_activated_button_p_t call_button)
{
UF_MB_cb_status_t ret;
QueryPart();
ret=UF_MB_CB_CONTINUE;
return(ret);
}
extern "C" DllExport void ufsta( char *parm, int *returnCode, int rlen )
{
//ufusr_ask_unload();
int errorCode=UF_initialize();
if(0==errorCode)
{
UF_MB_add_actions(action_table);//注册
}
errorCode=UF_terminate();
}
然后编辑菜单文件
VERSION 120
EDIT UG_GATEWAY_MAIN_MENUBAR
AFTER UG_HELP
CASCADE_BUTTON UISTYLER_DLG_CASCADE_BTN
LABEL 标准件库
END_OF_BEFORE
MENU UISTYLER_DLG_CASCADE_BTN
BUTTON 查询标准件
LABEL 查询标准件
ACTIONS QUERY_PART //此行为响应入口,对应上面程序
END_OF_MENU |