找回密码 注册 QQ登录
一站式解决方案

iCAx开思网

CAD/CAM/CAE/设计/模具 高清视频【积分说明】如何快速获得积分?在线3D打印服务,一键上传,自动报价 
查看: 16094|回复: 1
打印 上一主题 下一主题

[讨论] 请高人帮我看看程序错在哪里

[复制链接]
跳转到指定楼层
1
发表于 2010-11-26 23:34:52 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

马上注册,结交更多同行朋友,交流,分享,学习。

您需要 登录 才可以下载或查看,没有帐号?注册

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);
}
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 分享淘帖 赞一下!赞一下!
2
发表于 2010-11-26 18:33:42 | 只看该作者

马上注册,结交更多同行朋友,交流,分享,学习。

您需要 登录 才可以下载或查看,没有帐号?注册

x
您需要登录后才可以回帖 登录 | 注册

本版积分规则

3D打印手板模型快速制作服务,在线报价下单!

QQ 咨询|手机版|联系我们|iCAx开思网  

GMT+8, 2024-9-20 16:31 , Processed in 0.031123 second(s), 11 queries , Gzip On, Redis On.

Powered by Discuz! X3.3

© 2002-2024 www.iCAx.org

快速回复 返回顶部 返回列表