|
蝎子
发表于 2014-3-13 17:50:01
|阅读模式
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
#include <stdio.h>
X" ~% [) f! Y9 @0 G#include <uf.h>
' Q. s) O" e* V2 f) W A2 ?5 l#include <uf_ui.h>
K- Y" ]& ]* v0 P5 g0 m3 U#include "UG_UI.h"
. u7 Y/ |, ^1 g' f* @. T#include <uf_mb.h>, S8 z1 t5 m9 s/ t [9 [
#include "UG_UI_calculate_dialog.h"' A: E* s" I' V8 |/ i
: Y( m9 ]; n# a
/*****************************************************************************5 G- p2 Q- ~/ y" z$ c
** Activation Methods' @* ^( ?+ F8 I% z, C2 H' d
*****************************************************************************/& E# _* B. L* @6 `
: L& s/ B$ _, H9 `, ]6 u) K
/* Unigraphics Startup
4 I$ d, u. X3 X% G& V9 ~** This entry point activates the application at Unigraphics startup */9 a B0 M9 G j! o
extern DllExport void ufsta( char *param, int *returnCode, int rlen )
; y3 a8 t( M. f" o{
8 q' i6 [: C5 G) t, R0 t /* Initialize the API environment */
0 ^: K3 ^4 n) T( q+ q static UF_MB_cb_status_t UG_UI_Test_Dialog_fun( UF_MB_widget_t,, ^$ d5 [ v) {3 R _: `6 L' A) U
UF_MB_data_t,UF_MB_activated_button_p_t );/ }# J4 T3 A2 M* ?/ ^: I6 m) K
static UF_MB_action_t actionTable[]=. D) K% c$ w5 p
{
9 @/ i' a+ X: y. f* O* Y {"UG_UI_ACTION",UG_UI_Test_Dialog_fun,NULL},
5 I9 w/ U% c* b" h9 c2 K2 b2 |/ H0 y {NULL,NULL,NULL}
5 w1 X* U6 b+ _' B& Q; b8 O' w };7 H# [7 |. s* U$ q1 x
int errorCode = UF_initialize();
! q" c8 k3 a* R9 W% ?9 l; c if ( 0 == errorCode )! `! o- o2 E0 L7 | v9 L. \0 `
{1 T/ Q- R( ^$ l
UF_MB_add_actions(actionTable);
3 z% d% l- F" p8 L1 q errorCode = UF_terminate();( k- h; F3 Z- {/ I
}2 l; l! ?: z* P, W0 y
PrintErrorMessage( errorCode );1 b6 [+ K" a3 D" ?' ^; z+ Z
}
4 w% b' `7 k$ a t Q. p' e0 G! J3 U3 U& _
static UF_MB_cb_status_t UG_UI_Test_Dialog_fun(
l; _: f/ Y' \$ C; m+ a# |, Z' | UF_MB_widget_t widget,
/ M5 y' `) g' X7 P* N UF_MB_data_t client_data,8 N/ [( o3 P5 {6 ]0 O+ t) b' w
UF_MB_activated_button_p_t call_button$ z2 w& P& B, A0 s j& o
)
4 m/ @) \: B0 o1 h C7 W c, c{
( T9 S5 {( E: G; z UG_UI_calculate_data m_data;
& D( x& p2 F4 {+ D9 I int response;2 Q6 W- o3 u6 W; m& U- \) o% o
LaunchCalculateDialog( &response ,&m_data);
4 G( Y1 |. v- l( K return UF_MB_CB_CONTINUE ;
/ s- \" N+ k# |3 A' } m3 F}. f2 L* {# y% P* @
/*****************************************************************************% E0 J2 P- ~. A; ^
** Utilities8 m0 y& N% \0 a# }
*****************************************************************************/
1 k/ m# {1 u v, H4 z
# N8 | M* O. x' A7 n/* Unload Handler
% E$ D* o. d' U) K) o( ^** This function specifies when to unload your application from Unigraphics.; e, K H: H9 ^0 ^
** If your application registers a callback (from a MenuScript item or a
* ^. t8 K# V1 K( Q# P: u** User Defined Object for example), this function MUST return0 q0 ~0 ~% f( a; O
** "UF_UNLOAD_UG_TERMINATE". */4 K8 P d- _ U6 N( t2 q0 t
extern int ufusr_ask_unload( void )% D, I V) T4 \( w, M# W
{8 w" y. r5 L/ d4 U' R( h- Q0 x
return( UF_UNLOAD_IMMEDIATELY );( a& y/ E' W+ V0 P) q: R
}
" u2 @) B2 U/ l. T
|. n4 h8 V" B# |$ a* t0 B/* PrintErrorMessage
6 O* N+ G& L f' Q: {1 R**( I4 j( ]6 D9 N! N d
** Prints error messages to standard error and the Unigraphics status4 v1 F8 | }+ h9 u6 ?+ U# g
** line. */
0 N0 C# Y p( d% e( H4 Astatic void PrintErrorMessage( int errorCode )
7 Q* L3 ~; E" q4 {! [- u! p( ~{
. E% P A& J; N. x* I4 } if ( 0 != errorCode )7 s% a( X( H1 U, V+ ~# P* v5 y
{
4 a6 I" m2 e3 o2 s7 L /* Retrieve the associated error message */# p* g5 z' |! i8 u6 `
char message[133];$ |! b: E2 P+ y5 Y* @
UF_get_fail_message( errorCode, message );
- ~" t9 M, a& H+ ?: Z
7 M0 O( i; ` ~; q4 } /* Print out the message */$ ]$ s g3 B1 H" F5 Z
UF_UI_set_status( message );8 H, j6 w5 z( B+ m* ~6 n9 u3 B
( C! V' n+ X' x fprintf( stderr, "%s\n", message );
% u( o/ i, U/ d" ]6 @ }3 `( {6 x- P/ r' B6 V
}
i: K; `. x' r& L以上代码编译之后显示
/ ~: w% r4 H6 Yd:\ugkf\lesson1\ug_ui\ug_ui\ug_ui.c(54) : warning C4013: 'LaunchCalculateDialog' undefined; assuming extern returning int! c+ _# R& f- d& R
d:\ugkf\lesson1\ug_ui\ug_ui\ug_ui.c(55) : error C2065: 'UF_MB_CB_CONTUNUE' : undeclared identifier$ r1 {( _) _5 y
自己怎么都解决不了,不知道哪位大哥可以指点一下小弟' z1 G' ]8 d; j2 H' K" T0 L# O
( i, n4 E: X0 e& l, M" [9 r
|
|