PLM之家PLMHome-工业软件践行者

[求助] ufsta入口函数中的LaunchCalculateDialog总是显示没有定义

[复制链接]

2014-4-18 21:27:52 3190 1

4

主题

19

回帖

92

积分

PLM之家NX VIP

积分
92
发表于 2014-3-13 17:50:01 | 显示全部楼层 |阅读模式

请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!

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

x
#include <stdio.h>4 w! @) D- Y; a- H. ]# z7 b8 \, S
#include <uf.h>" S. U. ]/ c% S, P9 G
#include <uf_ui.h>' h- n1 J( L, k  Z5 ^2 M4 E
#include "UG_UI.h"
' D# E3 Q! ?" y! Q#include <uf_mb.h>* o2 V2 U0 t; c7 u; ^4 ]; Q( ]
#include "UG_UI_calculate_dialog.h"
/ S  N9 W: f) ~2 S- D. u6 |2 T0 D: [' J0 T
/*****************************************************************************
& A$ {+ \% P" M0 |**  Activation Methods# R! l* p+ T# l, b
*****************************************************************************/$ C3 a0 t3 H) T7 d( [7 i; `. H+ a

' l. T( U2 t0 L2 N0 s( p) ?, G/*  Unigraphics Startup) o! b. n; O8 {
**      This entry point activates the application at Unigraphics startup */
+ }5 H8 ]% U8 R+ U9 Q, h: k1 K. Aextern DllExport void ufsta( char *param, int *returnCode, int rlen )
1 V$ K5 a6 O+ ]- W( S{
" Z& z+ K* D5 ?2 o4 P    /* Initialize the API environment */9 x; v, p6 x* r* @' M# `  J
        static UF_MB_cb_status_t UG_UI_Test_Dialog_fun( UF_MB_widget_t,! w1 w$ l1 ^( W  g; x7 f
                UF_MB_data_t,UF_MB_activated_button_p_t );
+ A+ T6 {0 \. K! d: x* ~        static UF_MB_action_t actionTable[]=
' y6 Z. n* W3 e! X: z  W        {
3 N$ J$ |2 n# b* S                {"UG_UI_ACTION",UG_UI_Test_Dialog_fun,NULL},/ B' n5 p' v- l& z8 ]; A4 A7 r
                {NULL,NULL,NULL}
9 k! J2 `  u) l* J        };+ ]" V/ |- z& Z; A$ X
    int errorCode = UF_initialize();
5 E2 s! ?5 I% i    if ( 0 == errorCode )
) P  l/ k9 s% p1 s" S; F$ c    {: T0 I8 }% D4 D' ]4 _$ f
        UF_MB_add_actions(actionTable);; W+ _  T) S0 V: F. C4 s
        errorCode = UF_terminate();
  ]+ |3 ]! {( z+ O    }: e+ l- u5 ?9 O; O6 ?3 d6 C7 p/ n
    PrintErrorMessage( errorCode );  {- L: h/ X- @. K- i) @. h
}# n1 G5 e$ R" I

5 p2 |  }/ K0 U. r* Pstatic UF_MB_cb_status_t UG_UI_Test_Dialog_fun(4 [$ z  R% R3 c/ H& h% V( A+ I) Y0 d
        UF_MB_widget_t                  widget,  [4 `3 K' D8 ^' I+ `% p! P! J9 e
    UF_MB_data_t                    client_data,- J3 K' n1 P7 m* X( T
    UF_MB_activated_button_p_t      call_button
6 I; j. I: E) |" a* h, f                                                                                )
7 x! A1 |6 U6 `3 I/ H2 N8 f{8 G) i% n) n+ B  y, G, o# U
        UG_UI_calculate_data m_data;- b6 ]0 o1 i0 G2 Q9 |2 m8 `6 C5 m! U& a
        int                  response;
0 U$ l. n! z6 E# L        LaunchCalculateDialog( &response ,&m_data);
4 g5 [7 W/ X/ X! d7 h0 e7 A        return UF_MB_CB_CONTINUE ;
7 q+ z0 Q% z+ o: \$ t}
/ q' A, r" c% E3 ^* j5 R% v/*****************************************************************************
9 l4 ~/ l, m8 ]" m: a**  Utilities
: c, O6 u0 L, X% M' K: n*****************************************************************************/& H7 t% e- F+ v
" n6 ~) s) }) {9 s
/* Unload Handler* }, f% a7 L1 [# _1 w
**     This function specifies when to unload your application from Unigraphics.
, ?- z% U& @2 J# @  n/ Z+ Z4 x**     If your application registers a callback (from a MenuScript item or a' d7 X+ W$ [3 G/ {
**     User Defined Object for example), this function MUST return
" x& z; r0 x8 c: r2 A9 P. n' j**     "UF_UNLOAD_UG_TERMINATE". */( X  {/ _. O0 s+ x; ]4 r4 l/ e
extern int ufusr_ask_unload( void ), {5 m) g2 P5 }, E/ i, V5 j& B% m
{# Q$ `4 d2 n. k- v/ E; @+ i9 q) Y) z( X
    return( UF_UNLOAD_IMMEDIATELY );
, t; s* I! v: |* }" f) |}6 K* u6 s7 A9 P. r# M8 u
; v, P' I  t3 _; k/ T: ]7 H
/* PrintErrorMessage% k% E& `3 u( n! j4 f+ d9 @
**
" r/ B& |- W7 ^5 u' }' h/ |**     Prints error messages to standard error and the Unigraphics status
- d, d% j; T" a**     line. */, Y! c, P& M( H
static void PrintErrorMessage( int errorCode ). q+ p, l& S( c- }
{/ d9 C* N, y0 R% h0 T. n, j7 q
    if ( 0 != errorCode )
) V( r. p+ Q4 f: `5 }    {% a  d6 @8 K0 Q2 O
        /* Retrieve the associated error message */
; F+ @5 B1 P5 @2 o  H3 G# o4 }" j3 L' W        char message[133];
2 R8 C: Y( t6 ~- ]# N0 j* Q        UF_get_fail_message( errorCode, message );
9 J9 E4 y$ Q9 \1 t% F% `
1 N" r% Y9 ^- w$ ~4 [        /* Print out the message */
+ P) w) N. D" i6 W- {        UF_UI_set_status( message );
$ l0 v/ ]  u8 d5 g. {9 |/ u2 k+ x6 k- e, j1 F8 @
        fprintf( stderr, "%s\n", message );
! u) j3 b- D/ z3 k    }( {6 Q0 U% T+ h6 q
}
3 B+ X% f/ ?0 w) h# u以上代码编译之后显示! S1 v' ~' i1 o8 Q2 l( h/ i% ?
d:\ugkf\lesson1\ug_ui\ug_ui\ug_ui.c(54) : warning C4013: 'LaunchCalculateDialog' undefined; assuming extern returning int. r$ X: w2 r) K; n
d:\ugkf\lesson1\ug_ui\ug_ui\ug_ui.c(55) : error C2065: 'UF_MB_CB_CONTUNUE' : undeclared identifier6 |* j+ }3 U) B
自己怎么都解决不了,不知道哪位大哥可以指点一下小弟, z* L/ r: ^" Y) O/ B0 c
3 e) L, i; G4 O% |
上海点团信息科技有限公司,承接UG NX,CATIA,CREO,Solidworks 等CAx软件,Teamcenter,3D Experience等PLM软件,工业4.0数字化软件的实施\二次开发\培训相关业务,详情QQ 939801026 Tel 18301858168 网址 www.doteam.tech
回复

使用道具 举报

全部回复1

0

主题

7

回帖

29

积分

新手上路

积分
29
发表于 2014-4-18 21:27:52 | 显示全部楼层
        LaunchCalculateDialog( &response ,&m_data);# v1 f! g3 }3 L! |4 Q/ f3 K+ I* ]
: E% ]: ?9 V- e1 U9 p+ w# U; c8 o$ p
不是API函数,你没定义,当然不能使用
上海点团信息科技有限公司,承接UG NX,CATIA,CREO,Solidworks 等CAx软件,Teamcenter,3D Experience等PLM软件,工业4.0数字化软件的实施\二次开发\培训相关业务,详情QQ 939801026 Tel 18301858168 网址 www.doteam.tech
回复 支持 反对

使用道具 举报

发表回复

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

返回列表 本版积分规则

  • 发布新帖

  • 在线客服

  • 微信

  • 客户端

  • 返回顶部

  • x
    温馨提示

    本网站(plmhome.com)为PLM之家工业软件学习官网站

    展示的视频材料全部免费,需要高清和特殊技术支持请联系 QQ: 939801026

    PLM之家NX CAM二次开发专题模块培训报名开始啦

    我知道了