|
|
蝎子
发表于 2014-3-13 17:50:01
|阅读模式
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
#include <stdio.h>) L$ }1 M! L* q% r# i
#include <uf.h>
. X, q" A9 l1 O& G& X#include <uf_ui.h>, o7 x# M) {# O
#include "UG_UI.h"2 R: A% K0 g2 A6 A; U
#include <uf_mb.h>
; ~$ A0 w( D- L: M; z#include "UG_UI_calculate_dialog.h", M( _- `7 V* n1 z( u
5 j9 z* x# S8 I0 B; \. ~6 { b) j* _6 k
/*****************************************************************************
1 C1 b" z3 g) s4 h** Activation Methods! }6 s7 L- R" U, D' k0 }! ^: ]
*****************************************************************************/
; Q* e, T0 U, y2 s& t/ N7 m, E- M3 L) u+ b
/* Unigraphics Startup
/ g2 V) W0 l& @- I** This entry point activates the application at Unigraphics startup */3 {. E0 e+ c9 \7 `
extern DllExport void ufsta( char *param, int *returnCode, int rlen )1 ?/ d4 h% Q! E( v
{+ p: }& Y' e) a
/* Initialize the API environment */
9 Y+ e2 z% Q* {; W, ` static UF_MB_cb_status_t UG_UI_Test_Dialog_fun( UF_MB_widget_t,
% K3 y+ j% G# o) Y UF_MB_data_t,UF_MB_activated_button_p_t );, g1 C! |/ H% m* z: Z* K# ? V" ]2 u
static UF_MB_action_t actionTable[]=7 C; C+ g# `% b) [5 s
{6 R6 ^/ I# _4 n' s6 ~& B
{"UG_UI_ACTION",UG_UI_Test_Dialog_fun,NULL},9 J6 M/ t( a6 I4 Q1 Y- b7 E$ v
{NULL,NULL,NULL}/ z5 m6 l) k3 P% F3 m+ y3 g% l
}; w; z: F) l' o5 v0 G6 j
int errorCode = UF_initialize();
- b& M) D6 P, n& f6 ^& g0 q, s if ( 0 == errorCode )# l d/ t5 k9 l# ?, F
{
; n# A- I- w( F8 O8 o! X/ U UF_MB_add_actions(actionTable);
% \9 L. p6 h9 P! M. n. h8 R errorCode = UF_terminate();
7 B: l5 e& ~5 d }
" F+ D# H! e4 ]( n- D PrintErrorMessage( errorCode );/ d1 B' f( P2 E; l0 e3 p
}
* V& E B, _! f9 |3 W: K
/ X C6 b$ Q8 W% u& f# Rstatic UF_MB_cb_status_t UG_UI_Test_Dialog_fun(9 n: z7 W/ P8 d; ]4 N. ]) W& q
UF_MB_widget_t widget,
2 ] M0 t( Y! T8 v0 G# {( e UF_MB_data_t client_data, {1 z; ^& @' P3 e1 n) o
UF_MB_activated_button_p_t call_button
: u2 M: S! F5 k; H )
0 r* p- a6 Y9 }+ J. n{
" E0 b0 q, F4 ~" k" e: v# W UG_UI_calculate_data m_data;
& _2 T: h) k( z& F3 o* O' N int response;6 J2 ^* g7 r$ [/ J! u. B
LaunchCalculateDialog( &response ,&m_data);. D& f' B2 }6 ` l
return UF_MB_CB_CONTINUE ;) t* m1 A) R5 g' O" D
}) j5 ^6 [- F" {- v' D t* h8 L
/*****************************************************************************! ~: U3 [0 Q5 L7 v9 y; x% L
** Utilities
" U1 J) W$ ^5 Q. L7 U*****************************************************************************/
[/ C9 T" w* @$ P& ^* c
1 k0 ^7 h3 z1 `* y7 A) b- w/* Unload Handler
. N+ k' y p' Z( C5 A5 E2 q% {** This function specifies when to unload your application from Unigraphics.: e/ v! c, D3 C
** If your application registers a callback (from a MenuScript item or a
- U$ I- u/ P8 u# v# d- e** User Defined Object for example), this function MUST return: J8 s9 K8 J: ]/ J3 Q3 \ V& u
** "UF_UNLOAD_UG_TERMINATE". */% |+ B* _4 U, [* d7 f4 A& r
extern int ufusr_ask_unload( void )
) l. U( M8 g0 }3 j# |! y2 ]{
2 B, w* A# }/ j* Q return( UF_UNLOAD_IMMEDIATELY );/ {0 n! q! I! o) h% ~5 }1 I% X
}' a2 U5 ?3 r& U7 w8 X! ^3 R7 D8 j) D
2 d- s/ S5 ?) _/ E
/* PrintErrorMessage; N# W6 E- _9 [6 d9 C
**
- ?$ [/ H: ~4 {( H* T** Prints error messages to standard error and the Unigraphics status9 R% w! k+ F/ e# j
** line. */
; I! } x6 P/ `static void PrintErrorMessage( int errorCode )4 ]0 y" `; R: x( b8 X- k
{
- u5 U7 V8 h* O) ?; ?& T if ( 0 != errorCode )
- O) \0 r) o# j0 y4 V/ B {7 s% d/ W0 q7 C
/* Retrieve the associated error message */
0 b q8 R) O8 K, a char message[133];
% ^, V$ m/ C% ?5 ^! [* M UF_get_fail_message( errorCode, message );
' l& I! \* W$ ?; z/ r. j3 T& j2 F7 p, u8 ?2 J3 }
/* Print out the message */
* U( L9 ?/ L% _ UF_UI_set_status( message ); T/ o3 r5 h8 a& Z( B# u e4 J
}8 e) C9 f( Z2 G
fprintf( stderr, "%s\n", message );2 m. A* J! h) a
}
) f; w- n8 ]8 x}
. D( N) Y/ ]/ q/ L: }. r" D以上代码编译之后显示
5 v! ^1 z5 @# p1 W* ed:\ugkf\lesson1\ug_ui\ug_ui\ug_ui.c(54) : warning C4013: 'LaunchCalculateDialog' undefined; assuming extern returning int8 x8 T" N! a. j& \) r
d:\ugkf\lesson1\ug_ui\ug_ui\ug_ui.c(55) : error C2065: 'UF_MB_CB_CONTUNUE' : undeclared identifier, X) k# X( z. H- {' x0 {
自己怎么都解决不了,不知道哪位大哥可以指点一下小弟2 n: n# K) `1 D2 B2 N
- B2 m* d& A0 R, o7 b
|
|