|
蝎子
发表于 2014-3-13 17:50:01
|阅读模式
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
#include <stdio.h>
4 W. H5 h/ X% s9 I. N% t#include <uf.h>& c3 m- y0 n, I1 I- E
#include <uf_ui.h>, M( v9 T7 l1 x2 p
#include "UG_UI.h"
, q; Q2 v- [: V$ N3 L#include <uf_mb.h>
+ ]0 u+ ?& q9 |#include "UG_UI_calculate_dialog.h" ?2 E6 h: s7 \
8 m% I; y1 p4 Q+ s- O# T
/*****************************************************************************5 f# A" T4 S- L/ G$ A* K$ q: e! y" {
** Activation Methods
( g% N3 i; J# s" c% R0 y*****************************************************************************/
' a/ e- s1 g" c/ L% R- w% h
% [3 q0 T8 h! i6 _ u! t/* Unigraphics Startup
" W1 u. M! E9 u. W** This entry point activates the application at Unigraphics startup */2 G0 z8 \( J/ S) t+ J" |/ \# D* P$ b& W
extern DllExport void ufsta( char *param, int *returnCode, int rlen )+ Z! J3 R- D) b
{
1 f( ?0 w% ?7 K9 S+ x /* Initialize the API environment */ b$ m6 G' _4 Z ~: h, ]0 ^! Q
static UF_MB_cb_status_t UG_UI_Test_Dialog_fun( UF_MB_widget_t,
$ x3 V' a1 @& c" Q* T4 r UF_MB_data_t,UF_MB_activated_button_p_t );
8 @* ?9 @3 P" O/ p" e+ C0 j static UF_MB_action_t actionTable[]=
' a+ h2 }/ ~/ z J- g' b$ M! n {( ?! Z/ z: j% I% T% i( k
{"UG_UI_ACTION",UG_UI_Test_Dialog_fun,NULL},! Z _6 R2 I! H8 T" Z
{NULL,NULL,NULL}
) X7 j7 m2 G5 M$ |1 @/ ^ };) Z& H7 Q( `; |; n& b/ h
int errorCode = UF_initialize();4 n, Y* v1 G- ~4 }# o
if ( 0 == errorCode )2 A" V2 L" ?2 n& d
{$ F" z3 i6 D- |" |0 R" Y
UF_MB_add_actions(actionTable);
# D, ~' ?( h- m" |* U4 W7 V. m errorCode = UF_terminate();
. V1 B* w0 e! k, z* j Z" ?" W, a }7 V' V, ^" ^- a
PrintErrorMessage( errorCode );
" C) d# S& S" W, s" d5 b9 f/ C$ k5 O}4 Y1 L# M1 y% N6 f/ w- l9 x4 n
7 C( O* |8 d7 ~5 M6 Istatic UF_MB_cb_status_t UG_UI_Test_Dialog_fun(
, v" r' d e7 C' _0 V* d4 h UF_MB_widget_t widget,
2 k: |1 Z5 J/ I& w% `4 Z UF_MB_data_t client_data,* a5 s1 `. x) }+ x
UF_MB_activated_button_p_t call_button/ }' c4 H. c2 w1 k& e- J9 M; q
)# X P; Q! f D5 u/ r+ J! e- _
{
( E6 @5 w' U$ n UG_UI_calculate_data m_data;
9 u, i B r2 v, K* @ int response;3 M1 Y( ?+ z9 E% h$ f: B; I
LaunchCalculateDialog( &response ,&m_data);3 w: n5 e; z! [$ G1 u
return UF_MB_CB_CONTINUE ;
. w8 o2 y7 [" r3 e2 \) K, ]}
5 x& f2 V7 k9 P; _3 I/****************************************************************************** c) U4 y! _% ?6 {( D
** Utilities
. D l% V6 G2 f/ f6 A*****************************************************************************/
' |9 r. l3 j D* p5 l/ e1 g! j* |5 l9 N2 r. H) {, \
/* Unload Handler& Z' Y( z1 p& `* c, b$ \8 \
** This function specifies when to unload your application from Unigraphics.
. F9 y8 @* O! u! P1 _" x. K** If your application registers a callback (from a MenuScript item or a
* T/ X6 X5 v0 ?8 K/ X** User Defined Object for example), this function MUST return0 F( |3 ?9 d J& t0 E. x; g
** "UF_UNLOAD_UG_TERMINATE". */
4 R- q) s4 B3 ~( U0 ^% kextern int ufusr_ask_unload( void )2 H _, m6 I, \; @& G. l7 R
{0 R1 e. ^1 `: ~' R1 ]: y, k6 `7 h" T; F
return( UF_UNLOAD_IMMEDIATELY );
; ?8 X0 {2 o+ a- }7 c- e4 g}
2 ?/ P! }/ i$ B) k6 y+ o, O. t
4 H: ?$ V8 v) s8 L) e2 R/* PrintErrorMessage
: e4 I; q/ A ^1 {**
7 z! a V$ C) E f- l** Prints error messages to standard error and the Unigraphics status
9 Y; \) |0 j9 b \** line. */. N' Z9 c8 H7 ~1 Z
static void PrintErrorMessage( int errorCode )
0 A7 W0 u: S# Q7 ^. e& Z: n{ L. m/ P) [! c* V- r) I
if ( 0 != errorCode )8 n- Y- v; ^9 P& `2 W
{
& d. M _- R8 A. f /* Retrieve the associated error message */
! \* A5 U$ Z5 v' K2 K char message[133];
/ i B% A, @. {( V" B! p1 ] UF_get_fail_message( errorCode, message );1 A: d. W& |* b# i4 V' e
, F g% ^0 F2 c" O) g
/* Print out the message */9 U8 u9 `# B7 c
UF_UI_set_status( message );
7 Z+ B0 E6 |+ K, X- v2 c
7 \( _; M/ ?4 w. M4 V9 w0 t fprintf( stderr, "%s\n", message );/ x" Q, T0 r! {% h: ~
}" m8 X' |- A0 w
}
" r- ]0 l$ ?$ J( }7 ]' a& ~( }以上代码编译之后显示
: s: q8 `" H) V5 t) Vd:\ugkf\lesson1\ug_ui\ug_ui\ug_ui.c(54) : warning C4013: 'LaunchCalculateDialog' undefined; assuming extern returning int/ r, {& G) z* c* O! Z
d:\ugkf\lesson1\ug_ui\ug_ui\ug_ui.c(55) : error C2065: 'UF_MB_CB_CONTUNUE' : undeclared identifier
2 A4 M2 m) x$ w7 O自己怎么都解决不了,不知道哪位大哥可以指点一下小弟
# s8 G! O: ]: o1 j8 g/ X+ m$ C3 |/ @0 j& k0 o5 H* Y5 u
|
|