|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
#include <stdio.h>
+ i) N3 \+ N# o* q o; A3 |+ O) v#include <uf.h>
( P& V+ c/ Z* @8 V% K' _#include <uf_ui.h>
9 N, Z% e6 w! ^1 R, x' [$ _#include "UG_UI.h"9 ]) \# w) g, E0 H( D) Y9 Q* i
#include <uf_mb.h>, r8 }- g/ q, v
#include "UG_UI_calculate_dialog.h"
4 v. n$ v0 c% C
6 n/ M# g/ X& q. z2 {/*****************************************************************************
2 f2 M1 M9 O; X' h# y' `6 O* ]** Activation Methods
$ H( m2 C3 Q! D*****************************************************************************/
0 U/ @: G; u3 _- z$ e# k" R2 m! v, u2 @1 z
/* Unigraphics Startup
$ [, Y. H; }) p9 }/ O- B8 F. q8 _4 h** This entry point activates the application at Unigraphics startup */
3 @5 m# u$ Z' \8 H6 Pextern DllExport void ufsta( char *param, int *returnCode, int rlen )6 d! G2 L4 F& l; y' I! ?! R6 p% {
{& Y( x/ P: U8 Y. |& H1 I8 v* t
/* Initialize the API environment */
: n- U! J6 Z* @ Y static UF_MB_cb_status_t UG_UI_Test_Dialog_fun( UF_MB_widget_t,
$ `/ h) q& X* y' x; w; l UF_MB_data_t,UF_MB_activated_button_p_t );
! ~# {6 N# y& ` g static UF_MB_action_t actionTable[]=9 @) F8 {; [$ P5 Y* \3 ]
{8 Q) q; W9 n0 q1 a! ` ^8 Z
{"UG_UI_ACTION",UG_UI_Test_Dialog_fun,NULL},) f. O" m/ L3 e1 f' K
{NULL,NULL,NULL}3 c1 `6 i( Y1 ^0 B0 x
};4 H6 l: y L9 i$ A( S# o
int errorCode = UF_initialize();# a" ?% l+ Z1 o. z8 t( o
if ( 0 == errorCode )7 ]$ j; w4 S; ], e2 z/ D: x
{2 T7 X; c0 M& ?3 e0 C7 v6 `
UF_MB_add_actions(actionTable);* d5 Z# R. o# J* b) K) ?! ^
errorCode = UF_terminate();) b; D2 k+ \% T) \* z0 d
}7 O( a# C# D7 I7 G
PrintErrorMessage( errorCode );
* p V- l" V. ^, k: F# L}0 \) u8 z9 t1 D! U2 T( d9 R, ~) T
+ u: g- D; M }6 E Q, [static UF_MB_cb_status_t UG_UI_Test_Dialog_fun(. h/ H, m7 i: I1 U& f4 w* i$ M8 L6 ^
UF_MB_widget_t widget,
0 t. \2 X, F1 R$ H UF_MB_data_t client_data,6 u% @7 m/ I$ {% W# r
UF_MB_activated_button_p_t call_button
% n& _$ a8 U( O1 H- S5 ^7 d )
) |: I3 T# H9 ~# _{
3 h" O' ?4 r0 A9 \ UG_UI_calculate_data m_data;
* w8 M, E6 @0 N& C( s$ V0 f int response;( [! S4 C& {8 @4 N; M! l
LaunchCalculateDialog( &response ,&m_data);
( \, ^8 Y: g: Z' o return UF_MB_CB_CONTINUE ;
8 H) x9 G0 i3 Q7 c+ Y0 X}) X+ g: y2 c7 |& c& h7 ~
/*****************************************************************************
1 E8 m% f' M3 r* w4 d. Z- Y7 g** Utilities6 n) o, J2 W4 h% {
*****************************************************************************/. ?/ ?: [, F8 `! Q# Z [
1 H# ?1 f' d* o' a/* Unload Handler
3 q& L/ b- u# j1 o: Z** This function specifies when to unload your application from Unigraphics.
' L0 ^+ E7 E) P o; O- g** If your application registers a callback (from a MenuScript item or a
' ^, O4 J9 s7 L% ^3 [7 G** User Defined Object for example), this function MUST return
: z! y; w) R* @/ r8 ^8 W8 S: Z** "UF_UNLOAD_UG_TERMINATE". */" U1 W/ Y3 u, K) r3 t
extern int ufusr_ask_unload( void )1 _- u8 t4 k- `4 r* \
{
5 W7 E4 A% r U% k return( UF_UNLOAD_IMMEDIATELY );
~6 ~: W- G1 ]% F$ p}
0 U s# y: k" s( Q
# l: F' X4 t! N' u& ?. Z/ K/* PrintErrorMessage
; B3 _1 F; E X" V**. f' b' d* T2 Z; p0 Y# G
** Prints error messages to standard error and the Unigraphics status
) Y/ x, n( X, I4 R; x& v6 N# h' v2 R** line. */) R7 v5 L, \! D
static void PrintErrorMessage( int errorCode )
" Q+ Z8 p9 d R* o{( |. f( C6 s) i! ], k, K5 x
if ( 0 != errorCode )
, B- Y0 A3 _, n, J& e- |! }6 _ {# n) ]( w% P/ r& Q$ l+ G$ ~3 k6 J
/* Retrieve the associated error message */
0 ^. }/ P/ @" x' b char message[133];
; f. H2 Y# L3 }7 t. ?/ V5 Z UF_get_fail_message( errorCode, message );$ f7 E# p1 `0 Y& w
/ U% p* b9 P- e; W% r /* Print out the message */
* _$ \ ]4 C& b UF_UI_set_status( message );# e8 w1 y5 V0 D3 c
1 a$ E) O3 ~# v Q' l+ c: \
fprintf( stderr, "%s\n", message );
( p4 c* J1 C3 ^3 G9 [/ g }
7 z1 o9 j# E) U' e}9 g8 h' @& Q; c
以上代码编译之后显示
* j1 \: @7 x' v1 u2 H h# i) H( Nd:\ugkf\lesson1\ug_ui\ug_ui\ug_ui.c(54) : warning C4013: 'LaunchCalculateDialog' undefined; assuming extern returning int
* \9 C4 [3 Y& F0 i& ^9 b; vd:\ugkf\lesson1\ug_ui\ug_ui\ug_ui.c(55) : error C2065: 'UF_MB_CB_CONTUNUE' : undeclared identifier
) E: o3 X9 T# R2 x, V自己怎么都解决不了,不知道哪位大哥可以指点一下小弟
5 _& y9 z0 G8 p/ D$ F7 X* Y: Z2 F7 W% q# j, V: s8 x& s$ t+ ?- P
|
|