|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
#include <stdio.h>
7 |, l! U1 ]9 q. X#include <uf.h>
9 J$ Y3 s% O) _: y) B; [5 c5 W#include <uf_ui.h>
+ J- b# }6 x* R* X#include "UG_UI.h"1 M) f( _% ^1 Q* m4 @* ]+ f: p
#include <uf_mb.h> E# ?0 |0 m' _) B
#include "UG_UI_calculate_dialog.h"1 [9 B8 m2 W6 R9 x
4 k+ ]5 E% S0 f/*****************************************************************************" t4 o% K% R( ^. D- V! S
** Activation Methods, |1 ~9 C- f1 b0 b
*****************************************************************************/
" P2 F% {" S( E1 I* F" I" n
0 u' j. V3 o9 ?8 S/* Unigraphics Startup! h+ _8 s _0 i+ k1 q% u7 _1 X- a5 _" _5 |1 I
** This entry point activates the application at Unigraphics startup */
1 ]) q& {; i0 a! g# ^extern DllExport void ufsta( char *param, int *returnCode, int rlen )' [& l$ h# N7 Q5 z
{
: {( R; d2 o4 ~! ? /* Initialize the API environment */
5 n& i; Y" I0 _. H static UF_MB_cb_status_t UG_UI_Test_Dialog_fun( UF_MB_widget_t,
, i! y9 l. z; ]- M3 P* H0 y UF_MB_data_t,UF_MB_activated_button_p_t );' ]1 A; n8 g8 J( X0 e" w. |
static UF_MB_action_t actionTable[]=
* D% X. t9 p6 G& k4 ^ {
& I! i& k8 z' S: q {"UG_UI_ACTION",UG_UI_Test_Dialog_fun,NULL},% ?3 Y2 v, T/ q% O3 o3 m. |& W
{NULL,NULL,NULL}+ w" F9 M; O" u/ Z. l* p
};+ p; ~. T( V. O9 K: C0 d2 B' z
int errorCode = UF_initialize(); j" S% a1 J- P5 E$ A* f
if ( 0 == errorCode )
1 s( [0 v. Z4 z2 f4 S" @9 D/ x2 j {
) w& u1 f+ Y8 U+ n+ b; z# a UF_MB_add_actions(actionTable);( I# }/ ?6 ~3 h8 t Q' F$ A
errorCode = UF_terminate();
. E2 N+ r, H; H }$ t6 V" a5 M- k9 {- Y3 g5 i8 J2 L
PrintErrorMessage( errorCode );$ O |: @9 Z. o7 g
}2 W4 ~% L4 G: K- W- |) T
. |) O4 J/ V, w3 e# j& Sstatic UF_MB_cb_status_t UG_UI_Test_Dialog_fun(
5 v5 D1 _( P8 b$ m6 b UF_MB_widget_t widget,/ V8 O2 k% o) w5 c: y! v: u Y
UF_MB_data_t client_data,
* k! m* W( G' r8 {: Y: h2 L UF_MB_activated_button_p_t call_button
. q% G, a" v5 F6 @ )
% a( D" v3 i' s6 T, s( Y2 p{- R! C, [" b0 {/ Y
UG_UI_calculate_data m_data;7 P2 e. z& ^ I# [4 x# T
int response;. [3 u6 j6 y3 k4 Z" v
LaunchCalculateDialog( &response ,&m_data); }& B- f) s8 s$ ?; _# J2 n% A- q, r
return UF_MB_CB_CONTINUE ;' V6 I5 j' H( |" y. I
}' A8 Y- w+ |' l" m
/*****************************************************************************
0 W+ L7 ?1 q0 G** Utilities
. l1 ~% X4 K3 [0 Z0 u*****************************************************************************/8 r9 y2 }- j* l
1 D' e/ m+ E& H( M8 S
/* Unload Handler) o% N- g4 L. e- u5 N9 p7 H
** This function specifies when to unload your application from Unigraphics.
2 w# G2 I0 k( ]# \** If your application registers a callback (from a MenuScript item or a! X5 U2 [6 L& i9 T: t' b- m8 c; U
** User Defined Object for example), this function MUST return
) y9 v3 w) t7 K1 w& N: n' {& g** "UF_UNLOAD_UG_TERMINATE". */0 A% k$ a: H7 F& { H) N
extern int ufusr_ask_unload( void )
6 o& F! J K6 G. b a2 f{
% a l: | D" A) g+ e2 j return( UF_UNLOAD_IMMEDIATELY );
5 [# j) h0 l. R* D l) U1 ?}
, M4 i* D! J6 m" U" {" V" D1 I; Q0 F( C: U) \
/* PrintErrorMessage
, c5 \: F, G/ z6 y**
9 O/ k; M! b+ d9 E+ j C ^2 a; i** Prints error messages to standard error and the Unigraphics status
3 e1 f* E2 R& i( ?$ ]8 w** line. */
, B2 f' e) j$ X c/ t8 n2 C1 Ystatic void PrintErrorMessage( int errorCode )
. g) ~' y; F$ G; b{! U2 T- J& W G8 b( C
if ( 0 != errorCode )& t; l# R- P2 r, n1 j
{
! K2 P+ U0 r# c% N& Y; E, w /* Retrieve the associated error message */3 Q/ |% J7 x8 c9 l6 L, J
char message[133];7 T% ~ n* e$ r, X I5 ~
UF_get_fail_message( errorCode, message );
; w6 _7 W% W# n+ |- p
" Z6 J, P; z: N+ ? /* Print out the message */( q8 T2 x& f! Y* \# T
UF_UI_set_status( message );5 i) D( c' X+ f, S+ ^
% [1 Y1 o2 n* y+ C fprintf( stderr, "%s\n", message );
( E4 j& q8 p: D' h7 d& X4 X0 S }$ a2 U ^" @4 t9 E m" H- k
}
) A# L8 c& t+ z9 K# {以上代码编译之后显示
# r) s5 k/ y6 E5 p0 j' td:\ugkf\lesson1\ug_ui\ug_ui\ug_ui.c(54) : warning C4013: 'LaunchCalculateDialog' undefined; assuming extern returning int$ C. |5 P7 |% G
d:\ugkf\lesson1\ug_ui\ug_ui\ug_ui.c(55) : error C2065: 'UF_MB_CB_CONTUNUE' : undeclared identifier7 R; G1 k7 ?6 [% Q
自己怎么都解决不了,不知道哪位大哥可以指点一下小弟
. u+ `8 `2 F( X8 l% v9 H& G1 P+ \& ?/ w) b
|
|