|
蝎子
发表于 2014-3-13 17:50:01
|阅读模式
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
#include <stdio.h>
/ s' _# H' v9 N8 F9 H" _" |, T1 _9 k#include <uf.h>
' q. {* S v4 v- S( s5 F#include <uf_ui.h>
, }. o$ J) U0 @) T#include "UG_UI.h"2 R: F) |: w2 m! l% N
#include <uf_mb.h>7 F- f" ~; ~/ q: t5 G2 _: S
#include "UG_UI_calculate_dialog.h"3 S. k7 t. Q; z6 A1 v; J" i
* r [0 K0 Y3 r/*****************************************************************************
, l. ]( ?5 u& x m: _( a** Activation Methods0 ~8 A% F) [- i) n4 T
*****************************************************************************/
( ^9 G' g4 @: w, q& _/ z8 C) [- a. V0 d s1 d! _5 x: a
/* Unigraphics Startup1 \, ^4 G3 e6 c2 z
** This entry point activates the application at Unigraphics startup */. v8 {1 q5 n+ W. R5 S0 h) G4 f$ l
extern DllExport void ufsta( char *param, int *returnCode, int rlen )6 S; [& m W# m0 B [+ C+ X
{7 O. i- I# k' q* `1 p7 |5 y0 v- M4 v
/* Initialize the API environment */
5 }0 }% Z3 A8 ^, ]; a( F% ^ static UF_MB_cb_status_t UG_UI_Test_Dialog_fun( UF_MB_widget_t,
3 p a: B( I/ G6 \7 z. z7 ] UF_MB_data_t,UF_MB_activated_button_p_t );: I9 H c3 }! a. Z, M- s+ U
static UF_MB_action_t actionTable[]=
2 O" W! r$ q, I7 B; B {8 h, d- M/ t$ y7 l7 @/ v
{"UG_UI_ACTION",UG_UI_Test_Dialog_fun,NULL},/ ?8 C. V# a0 g5 L9 C
{NULL,NULL,NULL}
/ o- S6 i3 n" t1 T* V# D ~ };/ @, c( a+ t8 `3 C4 ~) Z
int errorCode = UF_initialize();. g$ ]% {( [4 \ f) n$ m% ?
if ( 0 == errorCode )1 b7 r$ V6 P- q
{
! e8 ]. Q% b! } UF_MB_add_actions(actionTable);) @7 H. n3 E z7 Q$ D. q
errorCode = UF_terminate();, t) V' U$ d4 O5 k- ]) M
}
" ?1 g% E" H; Q8 H PrintErrorMessage( errorCode );+ k$ q5 d" o% M" G' u% S5 q
}5 k2 N$ `/ M/ i* O: J
( Q1 L: n2 l0 J g6 m' t; m8 dstatic UF_MB_cb_status_t UG_UI_Test_Dialog_fun(! y' b" N' J3 E9 {' o
UF_MB_widget_t widget,
; w7 W8 K& m6 w" O) n c- u UF_MB_data_t client_data,
+ X+ P% O* p H7 \ UF_MB_activated_button_p_t call_button+ c0 j- |2 ?. w) f, M; K8 h e
)
; p/ s. E A# m' h! A6 p) L{0 w6 _ v0 S2 r! f% R* U2 l
UG_UI_calculate_data m_data;
& \( ~! t) |3 w# z4 u int response;( y" i3 d, i8 Q" @& W
LaunchCalculateDialog( &response ,&m_data);
% G- G" Q2 I k return UF_MB_CB_CONTINUE ;
3 L4 n W9 F7 w+ e}
& b% L7 D- W* T8 `: \/*****************************************************************************
9 }/ h5 V# Y2 v3 E. ~4 i** Utilities& M% c/ g% P/ a0 A
*****************************************************************************/
' A' V, d5 ]& e) v0 M8 a4 k6 `+ a) d1 M
/* Unload Handler
7 l r: ]. G) j' [6 B! ~$ s** This function specifies when to unload your application from Unigraphics.
# ^6 l! K3 s* i9 T& K) i** If your application registers a callback (from a MenuScript item or a' ?/ s, ^, T! s% j* [' O
** User Defined Object for example), this function MUST return- c( B. a/ b( k5 j+ ~+ S
** "UF_UNLOAD_UG_TERMINATE". */
& L% {! i1 [9 E; O m$ K' gextern int ufusr_ask_unload( void )0 P: u- z1 c' {
{
" L. r/ A9 [5 m return( UF_UNLOAD_IMMEDIATELY );6 g" C* F+ b. r7 }7 \
}# @1 s3 r! k% ]7 K& {8 `
8 G5 a4 W7 J% T$ c0 i9 L0 b. ?3 {, w/* PrintErrorMessage
1 ?* n& I) {+ A. @8 y**4 G) ^8 N- q$ Z. e7 e z/ m
** Prints error messages to standard error and the Unigraphics status9 ]3 T8 v* ~8 W
** line. */) T0 {8 S3 b+ l" E" ~
static void PrintErrorMessage( int errorCode )
& t R4 k, [ H0 g g{
4 j! ]& @8 Q7 x; |- k if ( 0 != errorCode )8 m0 H6 p6 r! v5 ~" f
{- T( V; a- O& f& d: l5 b
/* Retrieve the associated error message */
( p3 [ l J; N: ~$ T; u' w2 R char message[133];
: x; o3 p- c! y3 ^ UF_get_fail_message( errorCode, message );
6 I" Y2 Z& n, G' o' P$ ~" B0 f( o2 ?0 t& _8 ?
/* Print out the message */( C" h/ e- z% S1 F- m
UF_UI_set_status( message );+ t5 Y. B9 K, W
- c+ ^# ^0 Z X* K. J
fprintf( stderr, "%s\n", message );
( l5 E7 M- z% `. B9 a( ` }/ X: _) o$ G: d" W% a% ]5 c
}: ^6 C: ~$ i" E; b3 A/ S
以上代码编译之后显示, Q$ J; _- D* i5 W
d:\ugkf\lesson1\ug_ui\ug_ui\ug_ui.c(54) : warning C4013: 'LaunchCalculateDialog' undefined; assuming extern returning int% w& a6 c+ L1 ^% ?, x& U% M- `: o
d:\ugkf\lesson1\ug_ui\ug_ui\ug_ui.c(55) : error C2065: 'UF_MB_CB_CONTUNUE' : undeclared identifier/ P+ h; ?( i# f! ?% ^- N
自己怎么都解决不了,不知道哪位大哥可以指点一下小弟5 `8 U6 B" `. p# L* @
. b! }, }5 U+ |- \) C0 H& d7 k
|
|