|
蝎子
发表于 2014-3-13 17:50:01
|阅读模式
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
#include <stdio.h>
2 i2 f! x" o4 P) l: q#include <uf.h>
# ` p; |) r8 ?#include <uf_ui.h>: U7 I/ E( J i+ E
#include "UG_UI.h"
8 R5 a1 x+ c4 z. X#include <uf_mb.h>/ ~6 x: j4 ]4 s9 U
#include "UG_UI_calculate_dialog.h"
4 z6 X! Q3 E! u/ A+ U- g/ I6 Z/ \. N3 _
/*****************************************************************************
, ~: A9 m2 P' M1 O* w- ^2 y** Activation Methods
! Y* e1 n& d- {/ q5 a*****************************************************************************/
' E. K( n, a( w/ `2 x# ]
5 S2 o, }! S' y2 j0 B2 U. q/* Unigraphics Startup m" k7 L5 h" g) A3 `
** This entry point activates the application at Unigraphics startup */
1 [/ ~' @$ a' bextern DllExport void ufsta( char *param, int *returnCode, int rlen )
- h8 l! R% |/ J+ H/ G a9 N{1 A& d- J v2 m0 ]9 O
/* Initialize the API environment */
4 z6 h' }1 U+ R9 z7 |% f static UF_MB_cb_status_t UG_UI_Test_Dialog_fun( UF_MB_widget_t,
9 \% ^2 S3 w( D0 t1 Z; Y UF_MB_data_t,UF_MB_activated_button_p_t );
3 ]) z! j$ {) W) [ static UF_MB_action_t actionTable[]=
2 G. S5 T: y7 b/ d$ H {
% @% s; H1 n; |0 |9 ]$ C+ \8 f {"UG_UI_ACTION",UG_UI_Test_Dialog_fun,NULL},
7 s6 a: D; e- d( d {NULL,NULL,NULL}
6 M! s1 S7 l# Q( \8 i" b# T };9 `" A F+ C9 j! }
int errorCode = UF_initialize();% V6 n9 q3 Q( m s* L1 A
if ( 0 == errorCode )
) ^; e9 n! Z6 I; u6 e& |% b3 S {
2 Y K: R) ~9 w" B+ l w UF_MB_add_actions(actionTable);" z8 ]1 `' {# c( @+ a7 I
errorCode = UF_terminate();/ T5 O$ g6 @5 W5 b) O" q" H
}
& |% f0 z, q! b& _& F PrintErrorMessage( errorCode );
( V6 \/ }0 D, Q0 p3 |, y}
5 P- n& i5 O5 \$ v2 n# j, r! x) M F
static UF_MB_cb_status_t UG_UI_Test_Dialog_fun(
/ T9 _$ Q3 l/ f) c) o+ Q UF_MB_widget_t widget,
( N# Y+ {! @- q# k1 N UF_MB_data_t client_data,
8 l5 H0 {+ l: |. j UF_MB_activated_button_p_t call_button
) M: h: C% W7 S ). m4 [6 k9 e' w
{4 K% B% n# F' n# `
UG_UI_calculate_data m_data;; d5 P& ^% E. E
int response;3 C! |1 D2 ^; b( s; h
LaunchCalculateDialog( &response ,&m_data);* a" ?- g/ J( }2 J! v, N' w6 Y
return UF_MB_CB_CONTINUE ;5 b. v' y9 m; Z$ I, Y# g* n5 z
}
% I) q: k- {3 }1 }; e/*****************************************************************************
) l4 b) k; |7 l, L# `* A* i/ K8 q( B) S, ?** Utilities; B0 u4 M5 ]/ e. u
*****************************************************************************/4 w7 D: g, l8 w- S+ W
$ k; b) m+ }% \% N/* Unload Handler
/ W. d+ F( i6 } s+ E** This function specifies when to unload your application from Unigraphics.
/ y& b4 x2 u( P4 H0 M8 X** If your application registers a callback (from a MenuScript item or a J5 ?$ }% p$ @8 k# W8 Q3 A1 E( ~5 ~5 `
** User Defined Object for example), this function MUST return9 L! I' F% o" V2 _& s
** "UF_UNLOAD_UG_TERMINATE". */
# e: ?0 s5 m7 \( Q2 x& ?# s/ f2 Z1 H2 Sextern int ufusr_ask_unload( void )
1 @$ N1 _7 W. P* [- w{
' x' v% D. Q% q4 F } return( UF_UNLOAD_IMMEDIATELY );
" K3 V' u7 c+ I( X m5 O. \! ~}+ u9 z2 h& v" u( G! _$ ^( y) q! p; m
! S7 t L* p* N1 M3 x/ q/* PrintErrorMessage
( l: H6 ^% z6 a' ?! b% B) m* {**
0 r; o. `. l4 |% ]. h% G, ^** Prints error messages to standard error and the Unigraphics status/ C% u' `; f3 N, I$ c
** line. */2 s$ n* `- h9 R" [4 v- f
static void PrintErrorMessage( int errorCode )
' w Y/ i& u/ \{
" A8 l1 x A5 r- T2 }5 A if ( 0 != errorCode )! q y/ h* |% z
{
/ u" i8 T9 x( g( X /* Retrieve the associated error message */
& Y* Z* c; e$ {. _' D char message[133];
( O6 n- C9 C: d4 g UF_get_fail_message( errorCode, message );
& B* I6 e. h$ c* w9 }. Q
' q6 n$ _! x) ~- C" z1 i7 w: B /* Print out the message */
% J% U; O5 m+ q UF_UI_set_status( message );
& r4 f) t) _! i: ?* F% s
# s/ c( D3 N6 S- d9 H2 [ fprintf( stderr, "%s\n", message );6 R4 H% N j" _
}9 Q6 T7 f o% j# q1 G
}1 U! t( Z( i, a) J4 J* a. x
以上代码编译之后显示
" H6 c" L, i3 @! ?" od:\ugkf\lesson1\ug_ui\ug_ui\ug_ui.c(54) : warning C4013: 'LaunchCalculateDialog' undefined; assuming extern returning int8 W$ d% v( n+ {6 l* A- m) i- ?+ ?, l
d:\ugkf\lesson1\ug_ui\ug_ui\ug_ui.c(55) : error C2065: 'UF_MB_CB_CONTUNUE' : undeclared identifier$ A5 O. D3 D$ B- h$ `+ K) a
自己怎么都解决不了,不知道哪位大哥可以指点一下小弟
) j+ M, E) [+ t! Z( z- O$ I2 G# y$ v1 ~% r
|
|