|
蝎子
发表于 2014-3-13 17:50:01
|阅读模式
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
#include <stdio.h>
! N! g7 h! D" D#include <uf.h>
; b8 H8 p8 n* b' d( a#include <uf_ui.h>+ r" U2 C3 P+ A: u
#include "UG_UI.h"4 @' w, p1 s4 \
#include <uf_mb.h>
% N& G& x# ?. e8 Z& T/ H2 i2 l#include "UG_UI_calculate_dialog.h"
Q7 N# @8 Y3 D' J
6 {* P$ I' o1 s/*****************************************************************************3 z0 l# O, l$ g4 {9 _4 S, `
** Activation Methods* l. S2 D% r. v3 U- |6 q
*****************************************************************************/% Y! V- U+ Q, c+ E. h
, s3 |5 C |2 D( f w j
/* Unigraphics Startup2 K: U7 o% q9 M. R- P, p
** This entry point activates the application at Unigraphics startup */5 i; A) Y6 |% W1 h& V9 S& [
extern DllExport void ufsta( char *param, int *returnCode, int rlen )
+ B8 S& G$ P, k) T- ]9 s* P# ?{
! `& q$ ^1 V& P0 o2 ~5 V5 Y5 |. i /* Initialize the API environment */
8 Z3 I, j* @7 c" w; ^: { static UF_MB_cb_status_t UG_UI_Test_Dialog_fun( UF_MB_widget_t,# t6 g: R: T" r7 b/ {
UF_MB_data_t,UF_MB_activated_button_p_t );$ l/ t/ ?/ ^# G. h6 K
static UF_MB_action_t actionTable[]=
* s0 d' C$ R/ @3 L* f+ b* W {) X$ v; t9 G* z- |: b' u% D
{"UG_UI_ACTION",UG_UI_Test_Dialog_fun,NULL},
6 h6 d( E4 J0 ]# b {NULL,NULL,NULL}+ _: ]; i7 J: h# E& H: \* k
};
) H" y/ [0 k/ n! I: n4 X int errorCode = UF_initialize();5 S$ J% j6 }4 D) V8 T
if ( 0 == errorCode )# o6 M8 ]7 R1 m) V% u( |
{
# S. z: W- A+ a" m" j- K UF_MB_add_actions(actionTable);5 n; g% F$ O/ B8 d- Z! w. @6 \# W
errorCode = UF_terminate();& j, B0 ^! E) t. r" r& y
}
% D. R3 d2 ~2 D2 w% G PrintErrorMessage( errorCode );
# s: T2 c' y1 t4 |}: [6 S( F$ R9 C" u6 C2 F* I, _3 T1 X
0 A! i. M# v" z3 [# X& zstatic UF_MB_cb_status_t UG_UI_Test_Dialog_fun(& P. z3 T) s, ~* `; w+ W: p
UF_MB_widget_t widget,; ?4 N7 `; m6 I: ~; e' f
UF_MB_data_t client_data,
: f! e" U& `8 K UF_MB_activated_button_p_t call_button, |4 j9 f v# @, `; X
)3 q/ x# n3 c( _2 ~ { u+ V: i/ `
{) H3 t( j8 v& X2 f# _- j
UG_UI_calculate_data m_data; W6 g6 [( @* n, o* D: o
int response;
( v1 e6 y# ]! R LaunchCalculateDialog( &response ,&m_data);" N4 ?, s, F- m5 R% |
return UF_MB_CB_CONTINUE ;
; f6 I: E& I& m( i/ h: Y1 G% E. r}
% t- y# o4 Y* g5 H/*****************************************************************************
% d/ f3 @0 K C/ K7 X** Utilities( z9 S7 }6 R/ y
*****************************************************************************/
' O2 o: C' ~3 X# r
* N9 A, o4 B8 ~& M+ d e; F% c, h( ~/* Unload Handler& D2 ~; G- e5 l5 W$ O: s
** This function specifies when to unload your application from Unigraphics.4 z" J! M# h" _
** If your application registers a callback (from a MenuScript item or a
* [( }. y- a$ w u** User Defined Object for example), this function MUST return/ A( H- o. Q2 |) ?+ o8 Y* d
** "UF_UNLOAD_UG_TERMINATE". *// o7 H5 Z$ k7 m" R" T* D: _
extern int ufusr_ask_unload( void )
; J. M$ T* M, O2 r{
% y! W; h$ |0 [; |# f return( UF_UNLOAD_IMMEDIATELY );
- _' @# e, f, ^. h& t}
' Q6 X4 h! A& |. ^' c1 j4 x$ n
3 c3 X* R+ u( A t/ ^/* PrintErrorMessage
$ Y. O2 c1 G% F- r, P: H**+ D& P* P4 w( M
** Prints error messages to standard error and the Unigraphics status
7 ~4 v' X2 X) B: G2 e* q$ ~ f6 U: t** line. */' `6 Q/ U9 c2 I) b% n
static void PrintErrorMessage( int errorCode )
; z# F- p# u6 T{' q; |( G8 X7 n* L. K/ {" e8 w( \
if ( 0 != errorCode )$ l( Z% b" }, A. x; s) t0 G+ T
{" o. a/ X0 z M* h
/* Retrieve the associated error message */
' W1 M+ p- E; B* m char message[133];
* S4 F5 x9 x( M% K4 U8 o V UF_get_fail_message( errorCode, message );) @7 @1 ?1 G6 C' p
' m3 |9 s% K1 H /* Print out the message */
$ J# `8 m1 l6 ]* r+ K1 a UF_UI_set_status( message );" ?0 m& [( \/ Z$ r' y4 Z: F9 l* _
- S0 o& w: }" @' \5 I
fprintf( stderr, "%s\n", message );. D! \+ d4 {, @0 ?5 Q
}
* V N" D) Q- A; \" @3 V/ A: `}5 z( ], I1 R! a0 Q/ G1 d/ i
以上代码编译之后显示9 ]5 b y" Z1 m" d1 Z) x1 T
d:\ugkf\lesson1\ug_ui\ug_ui\ug_ui.c(54) : warning C4013: 'LaunchCalculateDialog' undefined; assuming extern returning int
: y S# S0 @: l4 _ od:\ugkf\lesson1\ug_ui\ug_ui\ug_ui.c(55) : error C2065: 'UF_MB_CB_CONTUNUE' : undeclared identifier/ \7 a/ Z8 B: m: C5 w! O: @
自己怎么都解决不了,不知道哪位大哥可以指点一下小弟
9 R5 t1 z' v. W# z: {4 ]5 ?: I% j! d [# L1 s
|
|