|
蝎子
发表于 2014-3-13 17:50:01
|阅读模式
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
#include <stdio.h>9 x9 j2 ^1 ]6 x J; U1 |4 l
#include <uf.h>) E* t4 F2 H9 @% I* V
#include <uf_ui.h>1 s7 s4 O6 f1 i( W- a
#include "UG_UI.h"
( p3 V5 K' I$ j! V3 Z' }, }( J#include <uf_mb.h>
- v4 k; S' @7 k" s: K#include "UG_UI_calculate_dialog.h"! P$ q0 `, L' v
1 T2 u2 A+ X* B) |8 W5 e
/*****************************************************************************
9 X% n8 ?- z+ f3 V1 M** Activation Methods
9 ~2 f/ E" ]( | K# F*****************************************************************************/
8 I# R; C3 b; |
0 g. f# q: m/ O2 j; |0 n/* Unigraphics Startup% x, r3 K: ^. [
** This entry point activates the application at Unigraphics startup */
+ n2 J: T& l5 l% i" \' \extern DllExport void ufsta( char *param, int *returnCode, int rlen )
" B! T( K U/ I: o" R/ y0 }$ o{
2 E) `& d& P; T' B /* Initialize the API environment */
) A- v( r& b6 s, d% l static UF_MB_cb_status_t UG_UI_Test_Dialog_fun( UF_MB_widget_t,
( U$ l! _, C- x2 h UF_MB_data_t,UF_MB_activated_button_p_t );# S T3 u: u8 c6 X$ R) i- w
static UF_MB_action_t actionTable[]=
" N: v1 C7 P7 {# ]% c/ i4 M( v {
6 T2 x1 P/ A$ c4 q9 J" d {"UG_UI_ACTION",UG_UI_Test_Dialog_fun,NULL},/ M7 v1 K. y6 o/ H$ Q
{NULL,NULL,NULL}
3 U$ Z$ D3 e, b( y! i* {& t7 K };3 [+ y5 ? V% W, B
int errorCode = UF_initialize();
' v2 Z( \5 G1 B0 ~' C if ( 0 == errorCode )0 t6 Q" s7 m% e0 f8 H
{
2 i. V) n4 [; ~ UF_MB_add_actions(actionTable);, D3 ~& ?7 H+ S; B
errorCode = UF_terminate();7 l/ ~8 ]& S( f. T+ z4 I& D
}) C3 }& w+ ~9 W- K2 W/ I
PrintErrorMessage( errorCode );
0 j5 f$ t* B4 m3 W}
- q) f" C" h+ f% p' }/ _" ? { m" A2 L& O+ K
static UF_MB_cb_status_t UG_UI_Test_Dialog_fun(
1 U" a, a( T8 |% b0 y5 \ UF_MB_widget_t widget,
+ ?! B: P9 Y) M) _ UF_MB_data_t client_data,( m/ P c3 ` P2 C3 c4 ?; _
UF_MB_activated_button_p_t call_button
! D. f% B7 _8 H/ H! @ ^* w4 p ) ^' M! p; X4 p- }9 w: |
{3 k9 i: o* q$ N {1 v: r7 Z+ w
UG_UI_calculate_data m_data;- e5 E: U7 [! E
int response;
! V; o' f4 @; c7 t. W0 O LaunchCalculateDialog( &response ,&m_data);; k& d, X$ a, G9 j: ?1 u8 V/ i( J
return UF_MB_CB_CONTINUE ;
( K. Q5 b Q( m9 W- T) Q}
9 v7 J6 B; Y+ g: @' Z8 |/*****************************************************************************
8 a" d2 d! A4 E3 J# g; P** Utilities2 y1 s* \9 b7 D6 L
*****************************************************************************/* J2 ?) Z n/ g( y9 l/ ?9 k
- }8 G& I( A* `+ D) i' l/ D/* Unload Handler
+ C# L: k, ]5 E. G6 q** This function specifies when to unload your application from Unigraphics.3 n7 W! y5 `/ X2 Y8 A' t% W! {* B/ t0 e
** If your application registers a callback (from a MenuScript item or a P1 t2 O7 N9 T. k9 C
** User Defined Object for example), this function MUST return
0 T5 w( D4 g, X** "UF_UNLOAD_UG_TERMINATE". */' d6 n& p- z B. \' C' h4 b
extern int ufusr_ask_unload( void )* E5 Q& S: i5 Y5 C- g; T- ]
{
0 `, H. Q5 b% K: b: ^+ T8 O# x return( UF_UNLOAD_IMMEDIATELY );% m5 j( u: d: S @- n* d0 u" N0 e. `
}8 ^2 F5 |6 o; \
( [) q0 O) F/ x2 Z! K/* PrintErrorMessage
" E- `4 z, x6 \) b6 _0 t**
, G+ O V- f8 N9 `0 T. n1 X** Prints error messages to standard error and the Unigraphics status
. T. v1 U/ I& T) w** line. */% b8 a0 I" J8 {# J2 x1 @) v
static void PrintErrorMessage( int errorCode )
$ @/ u2 ]4 f, n* E, C4 `{
. W; y |9 v5 s+ A2 M0 j' @! m& p if ( 0 != errorCode )! u: a L# k" X
{$ \8 B- n, k6 Z$ G
/* Retrieve the associated error message *// C- a1 Z5 z: R) z
char message[133];' P# P4 G$ e/ q
UF_get_fail_message( errorCode, message );
- u; _) Y2 d, {# {
3 c: F! Y% z8 M$ r- Q. E /* Print out the message */: {' q, ^7 g, B. V* P( J- N
UF_UI_set_status( message );* t9 N& @! A7 c: ]# |7 F
" M! F& o6 B: \' U9 y( ] fprintf( stderr, "%s\n", message );
/ F8 S) Q' K3 T" ]; E }
. ~6 N. U) h; e" L' c}
( w! J2 b5 v/ h- b' l3 A$ N+ }以上代码编译之后显示
$ \! J" k& E& u" j6 `5 f v( A, Md:\ugkf\lesson1\ug_ui\ug_ui\ug_ui.c(54) : warning C4013: 'LaunchCalculateDialog' undefined; assuming extern returning int( G8 l, }5 j: L3 e3 `. e9 o) u
d:\ugkf\lesson1\ug_ui\ug_ui\ug_ui.c(55) : error C2065: 'UF_MB_CB_CONTUNUE' : undeclared identifier3 o; e! k/ @% m% Y' n
自己怎么都解决不了,不知道哪位大哥可以指点一下小弟8 `/ }8 `9 s" g) C3 y @
' _. Y4 D' s4 n: i( U+ ~' f |
|