|
马上注册登录,享用更多网站功能!
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
程序的目的是通过对话框给工作部件添加一个文件属性。编译时提示错在红色部份那里。不知错在哪里,请高人指点。
错误提示:(error C2440: 'initializing' : cannot convert from '' to 'int (__cdecl *)(int,void *,struct UF_STYLER_item_value_type_s *)'
None of the functions with this name in scope match the target type)
下面是程序内容:
#include <stdio.h>
#include <uf.h>
#include <uf_defs.h>
#include <uf_exit.h>
#include <uf_ui.h>
#include <uf_styler.h>
#include <uf_mb.h>
#include <uf_part.h>
#include <uf_modl.h>
#include <uf_attr.h>
#include <uf_cfi.h>
#include <uf_assem.h>
#define MY_TH ("TH")
#define MY_DIALOG_OBJECT_COUNT ( 1 )
int MY_ok_fun(int dialog_id,
char *client_data,
UF_STYLER_item_value_type_p_t callback_data);
int LaunchProDesignDialog( int *response );
#define MY_CB_COUNT ( 1 + 1 ) /* Add 1 for the terminator */
static UF_STYLER_callback_info_t MY_cbs[MY_CB_COUNT] =
{
{UF_STYLER_DIALOG_INDEX, UF_STYLER_OK_CB, 0, MY_ok_fun},
{UF_STYLER_NULL_OBJECT, UF_STYLER_NO_CB, 0, 0 }
};
static UF_MB_styler_actions_t actions[] = {
{ "att.dlg", NULL, MY_cbs, UF_MB_STYLER_IS_NOT_TOP },
{ NULL, NULL, NULL, 0 } /* This is a NULL terminated list */
};
extern int LaunchProDesignDialog( int *response )
{
int error_code = 0;
if ( ( error_code = UF_initialize() ) != 0 )
return (0) ;
if ( ( error_code = UF_STYLER_create_dialog ( "att.dlg",
MY_cbs, /* Callbacks from dialog */
MY_CB_COUNT, /* number of callbacks*/
NULL, /* This is your client data */
response ) ) != 0 )
{
char fail_message[133];
/* Get the user function fail message based on the fail code.*/
UF_get_fail_message(error_code, fail_message);
UF_UI_set_status (fail_message);
printf ( "%s\n", fail_message );
}
UF_terminate();
return (error_code);
}
int MY_ok_fun(int dialog_id,
char *client_data,
UF_STYLER_item_value_type_p_t callback_data)
{
UF_STYLER_item_value_type_t data;
UF_ATTR_value_t value;
if ( UF_initialize() != 0)
return ( UF_UI_CB_CONTINUE_DIALOG );
data.item_attr=UF_STYLER_VALUE;
data.item_id=MY_TH;
UF_STYLER_ask_value(dialog_id,&data);
value.type=UF_ATTR_string;
value.value.string=data.value.string;
UF_ATTR_assign(UF_ASSEM_ask_work_part (), "图号", value);
UF_terminate ();
return (UF_UI_CB_CONTINUE_DIALOG);
return (UF_UI_CB_EXIT_DIALOG);
} |
|