|
蝎子
发表于 2014-3-13 17:50:01
|阅读模式
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
#include <stdio.h>0 K& V1 F N- m8 r& x
#include <uf.h>
1 H! q/ X' D( [: f#include <uf_ui.h>
. n( h b0 J8 `# y+ Q#include "UG_UI.h"
5 D0 w2 \' z) q9 P: e3 n: C$ o#include <uf_mb.h>" `8 @2 o4 U- d4 ^
#include "UG_UI_calculate_dialog.h": p3 K5 |+ P% v3 m; A0 d* _' `: r
$ p* d' Z4 p4 A9 z( H- \8 x8 V4 p
/*****************************************************************************: o" M- W8 [8 z2 \6 F
** Activation Methods2 J9 i7 _+ f' u+ `. N8 H: A9 n
*****************************************************************************/( D# O8 d9 u) [! T
/ b5 L# `. s# j' S
/* Unigraphics Startup$ {4 u& ~. ]4 D, @
** This entry point activates the application at Unigraphics startup */
3 C* c% j3 t! L5 p) v0 d: Xextern DllExport void ufsta( char *param, int *returnCode, int rlen )% ]9 r5 G9 L. u: M
{
. a) N2 B* Y+ [8 z0 x /* Initialize the API environment */; Z- |8 l( N5 a1 ]! ]6 D6 _
static UF_MB_cb_status_t UG_UI_Test_Dialog_fun( UF_MB_widget_t,* a, D' S) s" Z# O
UF_MB_data_t,UF_MB_activated_button_p_t );
9 V4 ? _* q2 p- M& B7 F, ~( `2 m p static UF_MB_action_t actionTable[]=
2 {4 f4 M( `$ o! n; n" H* I {
6 W B' x+ q7 D9 y! j- y {"UG_UI_ACTION",UG_UI_Test_Dialog_fun,NULL},
. l4 {% y1 f% T9 h {NULL,NULL,NULL}
; A9 g) _* C5 A) w& t) v* a* Z };/ f5 X! @/ Y9 Y5 T2 h5 w) V
int errorCode = UF_initialize();4 \* R* V8 ]5 ~* ]3 l; k) Z/ N& @
if ( 0 == errorCode ): I8 \- }% `% H$ C
{/ B# Q, `- p9 { i
UF_MB_add_actions(actionTable);
( H5 ?5 `0 z7 x' N' y$ U9 Y. H6 e7 T errorCode = UF_terminate();
, G" B4 u+ M) _+ o, T8 x3 g! ? }
/ _9 _9 r4 o# Z* d PrintErrorMessage( errorCode );
: x2 v9 `0 W$ H+ T" X( z, I5 w} H+ S+ P! d* A1 p( n1 f
9 i+ T1 `+ I4 n; [# J/ y: W
static UF_MB_cb_status_t UG_UI_Test_Dialog_fun(
" I* A) R7 P1 H) i- g" s8 B* } UF_MB_widget_t widget,
% u5 i) a4 p1 d) N | UF_MB_data_t client_data,
8 j2 E$ @; T5 |* F) U/ }& g4 p) G: [! D7 N UF_MB_activated_button_p_t call_button8 b5 W3 J! }' C* f- }9 }) @1 E2 S$ X
)' n1 F" A9 n, p) Z7 ~' u/ ]
{
' f2 A* j$ Y3 D. n UG_UI_calculate_data m_data;
3 Y& O' O" W9 D8 d. o int response;
2 k# N8 j2 `. q# p LaunchCalculateDialog( &response ,&m_data);: e/ T; X8 D! o) ~
return UF_MB_CB_CONTINUE ;
9 `- _; j& m$ v6 u}& `1 T. _" R. V
/*****************************************************************************4 a2 |: E$ d- p, G7 t( V1 a
** Utilities
: t5 q( L' _- u# k*****************************************************************************/$ }0 D# D! h# ? ?
5 u- ^9 v2 I! _+ m
/* Unload Handler
( Y( N4 x8 p& c- Q9 l** This function specifies when to unload your application from Unigraphics./ d. @7 G# I) n
** If your application registers a callback (from a MenuScript item or a
' S; V. ^: X% O, }2 _** User Defined Object for example), this function MUST return
' @# p* p+ Q) _4 e! d+ ]) z/ S- r** "UF_UNLOAD_UG_TERMINATE". */" H$ _9 W2 _- T }( d/ i9 `
extern int ufusr_ask_unload( void )$ v1 {$ }3 _% r& `8 I* n2 z
{
" x$ v d' t9 h: ]1 O return( UF_UNLOAD_IMMEDIATELY );! Z F& H; Q8 `5 V! [& q& H
}! I$ W' r' _; B+ ?0 W( {; k
5 B D: N+ L' I2 ^8 K
/* PrintErrorMessage
8 l% n7 g+ ?- ?. N4 [**
, n' d( d3 t9 s1 S$ B** Prints error messages to standard error and the Unigraphics status
/ G b2 t8 h+ P6 j$ _0 X3 t! z** line. */$ _( Q2 M5 G- e' V" U
static void PrintErrorMessage( int errorCode )
' i6 f+ |& m$ W6 z$ o2 J{5 g, t) O5 O( i+ j2 j) _+ Z1 D
if ( 0 != errorCode )
: V# I% h5 K- C { w! A9 t3 P% e# v5 W) H
/* Retrieve the associated error message */
) B1 o8 D: t' u& s char message[133];
/ }3 I, G# J1 b8 ]0 x UF_get_fail_message( errorCode, message );
$ W( @& |- \6 c! f) h! L
) O3 n9 A" Q$ h% C7 `0 | /* Print out the message */4 t2 q. v% }# N2 e$ m/ f
UF_UI_set_status( message );
# u. ^1 A( S- H5 R5 i- z' ]" m X J. D. y% _: }
fprintf( stderr, "%s\n", message );" S2 A0 e7 k: Q7 X/ _
}9 `. H* P; V, I8 a" S
}
2 j) b9 W( E3 B以上代码编译之后显示
: u% N/ s' T7 t6 V: V# G }/ B7 T4 R+ Ad:\ugkf\lesson1\ug_ui\ug_ui\ug_ui.c(54) : warning C4013: 'LaunchCalculateDialog' undefined; assuming extern returning int4 T& v# v! |( D* T, h' J
d:\ugkf\lesson1\ug_ui\ug_ui\ug_ui.c(55) : error C2065: 'UF_MB_CB_CONTUNUE' : undeclared identifier
, }, W: H" q( @7 X' C自己怎么都解决不了,不知道哪位大哥可以指点一下小弟3 N2 Y- A) Y# Q: p5 w
# ]: z! B1 I6 f |
|