|
|
蝎子
发表于 2014-3-13 17:50:01
|阅读模式
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
#include <stdio.h>, c& f& T! L! K( S5 B- @
#include <uf.h>! U, w& K5 o3 G ?. x
#include <uf_ui.h>
: J" k, P& o3 ?! M/ g4 y#include "UG_UI.h"
5 |3 q/ y6 K# s0 o; \#include <uf_mb.h>
* s2 s3 H/ m: |3 }. q, |5 P#include "UG_UI_calculate_dialog.h"/ m i! u9 D7 T i0 L. E3 X. ?
2 z4 i& K4 ~0 R) k
/*****************************************************************************
0 K% z" R h# a9 X** Activation Methods5 w p% D- {8 U0 T7 z
*****************************************************************************/
" [ v% t5 V+ b& G' n) i" m# M: F" F/ _
/* Unigraphics Startup
4 M2 k" I1 b# f, y- E/ {** This entry point activates the application at Unigraphics startup */: H# Z+ e5 [# Y) u, h& u
extern DllExport void ufsta( char *param, int *returnCode, int rlen )
2 G1 x2 z1 F. W{ ?/ ?1 _ o, N" P7 d8 f5 k0 Z) Y
/* Initialize the API environment *// l4 d I' Y- b4 ]4 ~. x
static UF_MB_cb_status_t UG_UI_Test_Dialog_fun( UF_MB_widget_t,, l1 ^4 t+ F& X9 }; x' M2 C
UF_MB_data_t,UF_MB_activated_button_p_t );# A& g P7 N9 F6 U5 [
static UF_MB_action_t actionTable[]=6 r1 J- @0 `4 X& G9 G
{
3 Y5 {+ { W) ]) A/ Z) x {"UG_UI_ACTION",UG_UI_Test_Dialog_fun,NULL},
4 Z2 E- _, B V {NULL,NULL,NULL}: x5 e( g9 } G: m1 y) E8 p
};
( M% \: j) C$ }( s% y int errorCode = UF_initialize();; h8 X; G" I; [; K# |) u" c9 Y) ^
if ( 0 == errorCode ); c6 O( B) t2 \9 l0 l2 X1 J- T
{) u4 s p, @, G
UF_MB_add_actions(actionTable);
8 Q3 f. o( _$ i2 t" r p8 [ errorCode = UF_terminate();( _" r3 E) W% ~$ F# e8 e
}
1 W6 ~1 g. D" O/ B m/ c5 A+ z PrintErrorMessage( errorCode );/ X% u( b. z& q
}
/ x" |" b& g; @' o+ Q& k) k2 }
' w! F3 t3 _9 D9 ?# vstatic UF_MB_cb_status_t UG_UI_Test_Dialog_fun(
) x7 b7 p7 m4 E) }6 O; y# g UF_MB_widget_t widget,# g1 z) H4 S5 v& p, U' t. C
UF_MB_data_t client_data,
5 s: Z/ b1 M' K6 A' T2 T: w M4 S6 O5 J UF_MB_activated_button_p_t call_button
( `( R1 k/ _6 u, g4 z )8 T# s9 q# D6 C- R
{
) e* ?+ f3 b% X0 m/ o$ L1 }# ^ UG_UI_calculate_data m_data;' H* {& J2 W; e: @3 V
int response;
5 Y% R2 d9 N' O LaunchCalculateDialog( &response ,&m_data); n; j( |3 O) H# M& F4 E
return UF_MB_CB_CONTINUE ;
6 {2 X; x5 `5 S" g% D2 |7 U}/ b/ v) U/ } Q/ e+ Q3 N
/*****************************************************************************
, b, E, y# `$ Z6 o& V** Utilities$ |- A& O- f/ W# x7 |! ~
*****************************************************************************/0 Y. I9 m% l u. j& y8 J1 h9 @
& J9 @) [, M% U1 a4 W# f+ e. f/* Unload Handler
6 _7 Q4 }% ]/ P2 W** This function specifies when to unload your application from Unigraphics.
! }* B3 @5 m3 o. ]** If your application registers a callback (from a MenuScript item or a% [9 m% J4 d* k6 F# F& f
** User Defined Object for example), this function MUST return4 U8 R% \/ f5 g$ K
** "UF_UNLOAD_UG_TERMINATE". */
" A- m x8 N: Mextern int ufusr_ask_unload( void )
' R8 I3 B! G5 g( X/ E1 s{' I. t; c, P1 C$ t5 k& \( N7 W
return( UF_UNLOAD_IMMEDIATELY );
4 ~+ g8 k. }5 k/ f3 x j& s}
" n1 R. T- r# o3 T+ W- H3 `7 A' i1 A" N+ u" T2 v
/* PrintErrorMessage
2 C: ?! U+ k' {# x# n**
0 a" L* \# r5 `** Prints error messages to standard error and the Unigraphics status# C; Y, ?/ t( V. \
** line. */
' A3 g' D2 c/ x& I2 R! |static void PrintErrorMessage( int errorCode )8 \: ]7 ` N* R
{0 {1 l* q1 s+ v
if ( 0 != errorCode )& x% |9 d, @0 i) O3 |6 m" f. a, X+ G
{' @) i4 n7 `* u. k% q* Q! i
/* Retrieve the associated error message */( M7 U* X0 ]: D% j( T) n
char message[133];) K* r f" x" I& X0 {$ o* E
UF_get_fail_message( errorCode, message );- Q. t1 t: P( C5 A2 f
; ?& f2 e) z, O1 B5 x$ M6 [$ P; ?/ T2 j /* Print out the message */
* L/ ]& m8 j' V2 [( m7 |5 y UF_UI_set_status( message );8 Y: s6 W5 _$ D7 {) U# ]
2 J5 y1 J# O' z. i# G4 Y' c fprintf( stderr, "%s\n", message );
( c2 x+ G6 ?, l) t3 m }
9 v6 \4 O1 i5 W! W}
0 a2 _: L6 J4 ], Y8 K% [. K以上代码编译之后显示" j. s) N1 t S) d2 W2 m
d:\ugkf\lesson1\ug_ui\ug_ui\ug_ui.c(54) : warning C4013: 'LaunchCalculateDialog' undefined; assuming extern returning int
! M5 v* z, W, ^' Nd:\ugkf\lesson1\ug_ui\ug_ui\ug_ui.c(55) : error C2065: 'UF_MB_CB_CONTUNUE' : undeclared identifier
" \9 _3 {$ C9 }1 U" f7 R4 A自己怎么都解决不了,不知道哪位大哥可以指点一下小弟' Y+ f& U2 M% O7 X, _7 i( j
+ O% q9 b& i* ~" c9 F
|
|