青华模具培训学校

 找回密码
 注册

QQ登录

只需一步,快速开始

青华模具培训学院
查看: 3118|回复: 3

[疑难] 调用VC++生成的.DLL文件 ug调用后提示“缺少需要的库内存 功能ufusr”

[复制链接]
发表于 2013-11-28 17:27 | 显示全部楼层 |阅读模式
刚刚进行vc++与ug nx 7.0二次开发 在编对话框访问时生成dll 但是使用nx open后调用dll 然后出现“缺少需要的库内存 功能ufusr”
: a. G! P7 _. X( T. s9 S亟待解决啊
. P& @7 K: c( _附代码:
$ I$ u/ z3 S7 l! |/* These include files are needed for the following template code.            */# k, G0 N. L+ j' R# o
#include <stdio.h> 4 Y( o; `. |, j
#include <uf.h>. H. G/ J. S0 ^0 E7 c, R1 D
#include <uf_defs.h>
* o! _' A* }/ c. P#include <uf_exit.h>
/ ]2 @; A3 t# _1 f#include <uf_ui.h>) i1 Z! w# V  b+ @+ _$ Q
#include <uf_styler.h>( y# B" z- [. m5 L
#include <uf_mb.h>
+ D, N  ?6 {  ^4 R' M# E) _5 Z5 R#include "access_dialog.h": T: p+ H3 r! Y  C3 I
+ `( Y# S. C% \8 W
/* The following definition defines the number of callback entries */
  |5 l( [! Q6 M! A+ q; z! Q/* in the callback structure:                                      */
" M' P. ]  r: W3 j' H5 K/* UF_STYLER_callback_info_t DIALOG_ACCESS_cbs */  {- |  D2 R; C' {! Y8 n
#define DIALOG_ACCESS_CB_COUNT ( 2 + 1 ) /* Add 1 for the terminator */* n1 N+ @! A2 e$ Z2 f
; e# w' [/ T4 e0 Y" }; }$ l' W
/*--------------------------------------------------------------------------; ^" j$ N& J9 F/ P1 X! y! n' q
The following structure defines the callback entries used by the       1 D1 d% e9 j7 Q7 g6 o
styler file.  This structure MUST be passed into the user function,   
7 ^5 x' ], |6 S; {+ GUF_STYLER_create_dialog along with DIALOG_ACCESS_CB_COUNT.                       / i, n* S. M6 D7 f
--------------------------------------------------------------------------*/* C; Q$ R% ~) W8 u9 n
static UF_STYLER_callback_info_t DIALOG_ACCESS_cbs[DIALOG_ACCESS_CB_COUNT] = + Q5 Z, U: u4 y
{- s3 Y( `7 l3 f; h
{UF_STYLER_DIALOG_INDEX, UF_STYLER_BACK_CB         , 0, DIALOG_ACCESS_back_cb},
5 y. U/ q. o( ] {DIALOG_ACCESS_BUTTON  , UF_STYLER_ACTIVATE_CB     , 0, DIALOG_ACCESS_button_cb},: f2 o  `0 R! H
{UF_STYLER_NULL_OBJECT, UF_STYLER_NO_CB, 0, 0 }
# I2 g0 G% S+ v0 u( X2 t};
1 O8 \  K9 U* U0 M: F) Z3 i; G+ W2 f' R9 }, n6 e
" L& b& ]! V( A& y$ G. ~, v

* d4 N! O; ^- G0 l0 g8 p& g/*--------------------------------------------------------------------------8 `* n: X, `6 B1 K) B# u6 Z$ t
UF_MB_styler_actions_t contains 4 fields.  These are defined as follows:
; G; h3 V& b6 z; ?# o% X
7 J0 ]& j0 d7 F5 B' |Field 1 : the name of your dialog that you wish to display.6 B! e7 ]: M+ C2 F. I' \3 [
Field 2 : any client data you wish to pass to your callbacks.
; M& c, k: z3 N' p1 pField 3 : your callback structure.' N/ ?: e' X7 X9 c1 q
Field 4 : flag to inform menubar of your dialog location.  This flag MUST  / w1 p& R1 G9 j
          match the resource set in your dialog!  Do NOT ASSUME that changing
4 y9 T" e4 A: S          this field will update the location of your dialog.  Please use the
% y. L# |. f: ?          UIStyler to indicate the position of your dialog.# O0 K$ y$ w8 z' `' G; b: D8 H% E+ ]
--------------------------------------------------------------------------*/
8 f6 Z( R9 w& K6 X5 pstatic UF_MB_styler_actions_t actions[] = {
5 m$ l8 P* @7 @: o8 ?: e8 e    { "access_dialog.dlg",  NULL,   DIALOG_ACCESS_cbs,  UF_MB_STYLER_IS_NOT_TOP },
# b" K% ^4 d7 k+ x& n    { NULL,  NULL,  NULL,  0 } /* This is a NULL terminated list */3 P; A# e5 ^! ]8 Q$ j) K
};: W8 e' [# M2 w- H

3 r* V" ^  y  j8 ~6 J
9 k; T' ^6 B7 B' c8 Q
: d% Z/ V# Z: y# ~
2 a6 m! f& X' g# O8 U* h3 G. N3 E. c8 {7 f
6 g5 G: a& C- Q
: S5 k; C5 b4 V
- a, X5 R; G4 Q4 }
/*---------------- MENUBAR HOOKUP HELP Example -------------------# s" C& F6 k1 Y9 @
To launch this dialog from a Unigraphics menubar, you must follow
) B; F& F8 X  W' W& D; athe steps below.2 g" S; P, X% B6 V. w
1)  Add the following lines to your MenuScript file in order to * O0 h; a# p" M5 Z  C, F
    associate a menu bar button with your dialog.  In this     5 q$ g/ |* G0 l8 i9 X8 [! _0 T
    example, a cascade menu will be created and will be        + J9 i1 g1 E2 x* k0 a
    located just before the Help button on the main menubar.   ) p/ q; |2 I& q5 `( i& ?  g
    The button, ACCESS_DIALOG_BTN is set up to launch your dialog and
3 i4 y2 J0 p' |! r8 E( B3 \    will be positioned as the first button on your pulldown menu.
; ^3 Q* A8 j4 b2 ~% v9 e, P# d0 l    If you wish to add the button to an existing cascade, simply
0 C) I' L+ ?  r' C    add the 3 lines between MENU LAUNCH_CASCADE and END_OF_MENU  
  e# e* t% Z' y1 f, r    to your menuscript file.  2 p5 i$ w' H. k, w

/ a2 N7 r4 {2 Y    The MenuScript file requires an extension of ".men".
3 Q! L1 Z; V" t% a* M; A; K' ?' J    Make sure that you add the extension to the file and place  6 j5 S+ t7 _7 a* X" C+ Z0 u+ k% ]
    the file in your startup directory:: ]) R8 g* M' i- O- n" T
      $UGII_USER_DIR/startup or
) f7 t* f0 K" m/ _  g      $UGII_SITE_DIR/startup or
: P4 m. h. }5 j4 N8 j      $UGII_VENDOR_DIR/startup directory3 c) J# j' c+ ^( [  y) t0 }
! ], ^5 l. a) P6 t' \1 Q
. m* T2 K- G# [! n$ q- t
    Move the contents between the dashed lines to your Menuscript file." z: ^6 R" _: w; Q
!   ----------------------------------------------------------------6 {# w" K: a+ U1 v  n2 t7 ^
    VERSION NX7
: ?) ?+ c. @9 T2 R$ M7 a  b
5 _7 D! j) A  J9 D  K    EDIT UG_GATEWAY_MAIN_MENUBAR( M7 L5 h4 K* \; }  B& i; a

- }3 M( d/ C  r, A0 r. ^    BEFORE UG_HELP
3 e7 v0 A2 q# r# W6 T. |6 j  v4 A      CASCADE_BUTTON UISTYLER_DLG_CASCADE_BTN
( m; c9 c" _2 {$ \+ V      LABEL Dialog Launcher9 w7 }4 j1 U' M3 Z
    END_OF_BEFORE- Q9 V6 x: \1 i6 T: S

3 }4 l5 i) z; S% a    MENU UISTYLER_DLG_CASCADE_BTN2 f. m+ k/ X# y
      BUTTON ACCESS_DIALOG_BTN
5 h; q! ~6 u/ H' `8 M      LABEL Display access_dialog dialog
  o& t4 B) D$ J6 V4 V, f7 @' x1 }+ R      ACTIONS access_dialog.dlg! v, r2 g) ?, M" C2 ~1 L
    END_OF_MENU/ s0 M& l( |, X- L
!   ---------------------------------------------------------------
3 S# w" G7 _; g/ i5 [& n+ E7 {: G
  n/ v3 \+ i& x+ Z$ [
2) Issue a call to the function, UF_MB_add_styler_actions from the ufsta
( b; H" c. F% e  A0 v; H% G   user exit as shown below.  To use this call, remove the conditional $ @) h2 f' o2 z
   definitions:  #ifdef MENUBAR_COMMENTED_OUT 8 f" k/ E# h% k  s6 V
                 #endif MENUBAR_COMMENTED_OUT ; s. `: f1 O' h2 b0 Q5 x
: w1 J& U8 G7 d, L: S7 M& E
   The static structure, actions, will allow you to associate ALL of your- F) R: u: K6 E+ ]8 e. @! C
   dialogs and callback functions to the  menubar at once.  For example, if you
* @; T( t, @' X* J: t, s0 R   wish to have 10 dialogs associated to 10 different buttons on the menubar,+ ?  U' c  `) Q7 w  Q
   you may enter each dialog and callback list into the actions structure. Make/ ?, t" K$ j# _+ k/ R, j$ d0 C
   sure that you have created a corresponding button in your MenuScript file.
# v, U5 h3 i3 k5 q+ x. f1 {8 ^* f; g6 i+ c! s. b  i+ K
   You may also have separate shared libraries, each with a ufsta user exit* U2 W# j: A+ r2 D
   for each individual dialog.
: P' C! d) V9 p& z4 M  d. U( b0 C5 q! P) a; U
+ a3 Q3 ^: t1 T3 g3 }+ \& j3 }
3) Place your compiled and linked ufsta user function in
: g5 f  ^- i0 L# D& q   $UGII_USER_DIR/startup or   
- A# V1 X/ k2 \$ J6 }   $UGII_SITE_DIR/startup or % F1 U1 F# P1 r3 ~5 S/ c6 c- ~- v
   $UGII_VENDOR_DIR/startup directory.     / ~- `1 K: d( V; ?$ p( V

* X: l. f, `8 w9 V3 s' z% i   NOTE:  The user function must contain the proper extension .so, .sl or .dll
7 w  v* I2 p. l' c; f# ~   to make ensure that it is recognized by the MenuScript.  If it does not: b. f6 Q6 {: n2 x1 T* ~: i
   have the proper extension, it will NOT be recognized by MenuScript.    * l; z, u: R) W  \

! v3 Q) ^& {" h4 u/ G6 E- D. z
   The action name you have provided in your MenuScript must correspond to1 E3 J+ g/ j) L& l
   to the dialog name provided in the action structure.  This MUST match inorder0 X3 E- m1 \8 [1 H4 R: Z
   to bind your dlg file to your MenuScript button.                           
$ j' U, b5 k" x8 p5 f; w! l
' G& V. m* i6 ]% P. q  ^4 }/ @- S0 c2 Z6 q
4) Copy your UIStyler dialog file to the proper directory.) p  o( T; k' C8 v. P
   All dialog files (.dlg) must be located in
3 E* w9 W0 o1 c& L" R      $UGII_USER_DIR/application or 0 ?* _* O  N5 U1 ]6 S' t
      $UGII_SITE_DIR/application or
* ^9 A1 `& Y: m9 q4 g0 l/ z2 U* a      $UGII_VENDOR_DIR/application directory
3 G  O+ p! o6 z# B6 |6 R( o3 T  H, e) c: P) m
9 \8 i( R* X- {

# c. j# X" L  N% n# d& N' h+ k+ K' z- X8 G* U
------------------------------------------------------------*/6 w: |1 I/ p5 B9 K7 H, s$ a0 G+ ]
#ifdef MENUBAR_COMMENTED_OUT
; }& C5 ?$ t  D+ s# v/ J5 q+ Hextern void ufsta (char *param, int *retcode, int rlen)
3 a$ z7 g* G1 a1 L' U8 U{
- |: O0 V- {/ a( F    int  error_code;
" C- E& m( A  v( q8 Y; w5 F9 u6 ~7 f, V7 _
    if ( (UF_initialize()) != 0)
) F' c3 {, j0 d+ B4 |          return;; B4 Q5 S* H1 p! I
/ K5 w. v6 G* h% T7 y. I
    if ( (error_code = UF_MB_add_styler_actions ( actions ) ) != 0 )! }8 P  `4 V4 \/ y) j) M% v$ D
    {
6 g2 @) u9 W1 L% z8 h+ O' h          char fail_message[133];
. ?3 G8 S1 g$ i1 K0 m7 B8 n6 w$ l  |* {$ C
          UF_get_fail_message(error_code, fail_message);
8 m- {! ^5 Z% p+ J2 v, n* i          printf ( "%s\n", fail_message );
0 P& Y, ^+ }1 ?0 ?    }
) s. t- k0 S0 ?" U) K# X/ v
& X/ X% e/ b: v8 L8 R7 o    UF_terminate();                             
3 F6 w* t+ ]; F    return;  O4 _5 @  w5 x: N
}; p( n; Y$ o* d% s, G2 @
#endif/*MENUBAR_COMMENTED_OUT*/
3 @/ u; H* r' C# Z$ b6 z+ h
" x4 m( ?. I1 P; r
% G  p/ x# f3 `) c: e0 K' Y/ R
# j6 c! _0 N9 A3 m' \6 j7 p+ M9 F: y; u: B; I* v! V
+ m$ O2 U( C- J! V
/*-------DIALOG CREATION FROM A CALLBACK HELP Example ----------; K; K0 |# P% O+ i0 ~5 Q
If you wish to have this dialog displayed from the callback of
6 G8 Z2 E0 `- ~" x* F( Janother UIStyler dialog, you should:                           3 [' g3 X! t6 d* p1 A% C7 }

+ K) N0 ?+ W- j) a1) Make sure that the callback of your UIStyler dialog is
6 y# T" i, \8 N( J0 X   designated as a dialog building callback.              ! }5 @2 A) ^: ]9 T- [, K
2) Remove the conditional definitions:
5 [6 g9 Z1 F9 B5 F6 O   #ifdef DISPLAY_FROM_CALLBACK 7 `' C2 r# G$ {1 ^! n0 L# h3 X
   #endif DISPLAY_FROM_CALLBACK
  @8 m7 u& F. K9 D1 _2 W3) Your callback should issue a call to this function.2 x2 f& ~; P) g
4) You should also add the funcitonal prototype to your header file
5 w4 v" x* e0 r4 n' m# q7 P   (access_dialog.h) and ensure that the file is properly included.9 B* [* H* u  _1 v

8 ]( L( q  b1 y! f" N# mAll dialog files must be located in 4 f. J4 Z7 e3 O9 n- p2 t. m
      $UGII_USER_DIR/application or
6 _/ ^, b  @2 ^  Q' h. j# ?* ^      $UGII_SITE_DIR/application or
. [9 F+ N1 z7 K- M* ^1 H2 w) O4 n      $UGII_VENDOR_DIR/application directory5 R7 f+ O$ z  j" S& [. ~2 ?, O
--------------------------------------------------------------*/
9 m8 p3 ~- O3 l  B! s3 H: N% K  C! u
, r( M: s* b3 |7 V* Y& J. m; u
#ifdef DISPLAY_FROM_CALLBACK! K& E! |- J4 y0 V( N' y
extern int <enter the name of your function> ( int *response )9 Z; Y. P5 h( d/ Z
{+ ~. @  b7 w% h  A
    int  error_code = 0;
. W. u/ t. w( q. w% \
; f% m% l$ |1 u2 F    if ( ( error_code = UF_initialize() ) != 0 )
/ Y3 g: \/ r1 x" \3 d           return (0) ;
4 f8 P9 {! d0 Z% K
; [$ T" e) Y$ {    if ( ( error_code = UF_STYLER_create_dialog ( "access_dialog.dlg",: R4 p* d& R3 N0 r
           DIALOG_ACCESS_cbs,      /* Callbacks from dialog */
1 j% k3 z: o  o* b% X           DIALOG_ACCESS_CB_COUNT, /* number of callbacks*/
% K/ E8 ?! a8 s           NULL,        /* This is your client data */
4 u' V, e. k8 b; e- ]# E           response ) ) != 0 )- j) v4 m3 D: w8 [/ a
    {! {& x. I" s8 c& [% n
          char fail_message[133];
+ O8 b: k3 ]: S5 L3 ?: R1 F+ @' `7 F" J' d. N" g
          /* Get the user function fail message based on the fail code.*/. D7 y" L9 s% T
          UF_get_fail_message(error_code, fail_message);  R6 O/ a' c3 y, |3 F+ }/ z
          UF_UI_set_status (fail_message);
3 X5 v6 t* T' S( t- m1 W          printf ( "%s\n", fail_message );
& c" r) l0 W% u( j    }6 l$ ]$ g' f+ [9 v- q
" V5 u( p& e) p4 s: s

* n0 u. x5 Q# T9 v    UF_terminate();                             
: z3 B1 n; F7 Q1 X' ]; [    return (error_code);4 F5 i8 @" M) N) g
}
4 y4 S4 u5 g- H) ^2 O  g#endif /* DISPLAY_FROM_CALLBACK */ ' b; _- w9 W, L3 b; P
" ]$ c( e- X& K$ N3 Z  `

9 t; m1 F! m: d! ^& M3 J% ]: c, f! r* f

  |" K/ x$ o+ Q. m! x) \5 s/*-------DIALOG CREATION FROM A USER EXIT HELP Example --------
' Y) N: U8 h7 _To create this dialog from a user exit, you must invoke a     
: [1 l8 ^; D6 W, z# \& P) P6 qcall to the NX Open API, UF_STYLER_create_dialog.  An example ' t2 H/ J+ _& `$ M+ O
is shown below.                                               
, B7 L: q! b- O& l
7 V( J0 q! m; N# iAll dialog files must be located in 2 I4 ?$ Z9 Z! N. `! D1 ~
      $UGII_USER_DIR/application or : ]$ A' Z% i& q
      $UGII_SITE_DIR/application or $ v' p# @0 M" Z. ^6 c3 _
      $UGII_VENDOR_DIR/application directory9 o& {1 e* D+ m$ l
. Z) h- N3 z+ R- q# R7 }5 m
1) Remove the conditional definitions:
4 p9 J+ d/ t8 g8 [, g" u: {: q   #ifdef DISPLAY_FROM_USER_EXIT
2 f  v! h4 t# e9 u% n( y   #endif DISPLAY_FROM_USER_EXIT
- {2 a  x+ E; L  P$ q2) Add a user exit to the function name below, for example, ufusr.: J4 w$ j2 l; s$ W; l
3) Consider how your shared library will be unloaded.  Take a look
0 y% p$ u6 G* t   at the generated function ufusr_ask_unload.3 F+ E1 Z, x& v0 @
--------------------------------------------------------------*/6 ?% d7 D, k: L& J' U( S

! w/ {6 T+ q- P#ifdef DISPLAY_FROM_USER_EXIT
! L4 X- n9 v+ `5 |extern void ufusr (char *param, int *retcode, int rlen)
' o  h5 x! h5 n$ c! z+ H4 b# C{6 _1 Y, i+ E, f7 a, ]* U) ~0 c0 a
    int  response   = 0;
' L. l, _* C  m  l* L9 E0 k    int  error_code = 0;
" }* j( z2 u2 }% X
5 l' I2 q# H  N; M% D    if ( ( UF_initialize() ) != 0 ) # y1 w  N% D- H; Z' i" X
           return;% B- Y, Y- |5 v5 i6 j
6 ]  |* C/ J6 V1 b/ \9 D
    if ( ( error_code = UF_STYLER_create_dialog ( "access_dialog.dlg",9 W" y8 m( V- _. v- n* P
           DIALOG_ACCESS_cbs,      /* Callbacks from dialog */' ?" n; e% p6 D* L
           DIALOG_ACCESS_CB_COUNT, /* number of callbacks*/' n/ i1 f" _: z
           NULL,        /* This is your client data */) |. V! S2 X( j: l# [
           &response ) ) != 0 )
4 z5 S% P  l. s% n! ?- z    {7 j5 \: M, `) J- r
          char fail_message[133];
/ ^6 m) M$ ?6 b5 N
! ?  v8 S* u7 k% I% u9 l9 n          /* Get the user function fail message based on the fail code.*/1 V: T2 }$ m. b3 W) e
          UF_get_fail_message(error_code, fail_message);+ s0 O' y* R( N! j0 N7 S: f
          UF_UI_set_status (fail_message);) Z* x' I1 Q9 C4 _  o6 @
          printf ( "%s\n", fail_message ); 8 ~0 H  e9 z; d0 o: M
    }
9 W9 K, D3 T, R, j# j9 K) [" S/ Q! x# r/ Q5 B- `0 e

9 \6 i# x. h# p9 s# V5 D4 S    UF_terminate();                             
6 M7 A+ x' p, X    return;9 @/ r' L1 s7 M! e( Z6 \$ t, R
}
6 d5 a2 r; |& P' z# W4 A9 G7 Q+ b: B( m4 h  |8 ^

* L( }6 W: z( v
& z% k" ^0 T$ b, O" U. _7 n+ u& n: Y
/*--------------------------------------------------------------------------
3 K5 r; L+ z3 zThis function specifies how a shared image is unloaded from memory         
8 v4 t' F8 F+ L- E3 @within Unigraphics. This function gives you the capability to unload an     5 I, Q" L6 x$ f4 i5 S3 o9 t
internal NX Open application or user  exit from Unigraphics.  You can      
% j+ |& M! v5 C( D1 a% ~specify any one of the three constants as a return value to determine       3 h0 d. d/ k5 n" h$ J) c$ z
the type of unload to perform:  immediately after user function             ' F) c4 P& [4 C  H( M
execution, via an unload selection dialog, or when Unigraphics terminates   
* e* e1 A3 t5 ?; p! X/ Cterminates.  If you choose UF_UNLOAD_SEL_DIALOG, then you have the         
' W9 j) L/ T0 G4 u, ?option to unload your image by selecting  File->Utilities->Unload Shared   
& m# `+ G' W" H3 A  R4 ZImage.
) h5 Q# w6 i& S6 D2 J5 ]* c  S+ I
3 [4 a1 z3 f2 _6 `0 V+ s9 R3 cNOTE:  A program which associates NX Open applications with the menubar     
, Z; o5 S- p! G) o- [* oMUST NOT use this option since it will UNLOAD your NX Open application image" I" e2 W# [( }0 m# Q
--------
6 o$ I' k$ |; [; Y, _! m: Q# ]from the menubar.# z7 h, O( T- N2 j% t- [
--------------------------------------------------------------------------*/
, }' ?- m% L' N! }% [. T; j' v
; u2 e) `8 Y- [- ?  Fextern int ufusr_ask_unload (void)# Y2 q, |- R% a
{7 f( j5 _5 s# \0 `
     /* unload immediately after application exits*/
, V: q3 w" z- |7 T     return ( UF_UNLOAD_IMMEDIATELY );
+ j- s1 H& g/ @5 F# {. N. {. p/ G9 S; R# c+ d$ s
     /*via the unload selection dialog... */. b( \: T/ v, l/ Z
     /*return ( UF_UNLOAD_SEL_DIALOG );   */5 k) f4 A$ x0 n5 m9 _
     /*when UG terminates...              */
+ j3 [: Z4 u0 i  S' Y# G0 a5 s3 w     /*return ( UF_UNLOAD_UG_TERMINATE ); */
) f8 `+ C/ K0 e6 y  q3 |: ^}- J' f, w/ t7 S7 B
( j/ s1 J( b8 g6 l3 K

  s) x3 k. e( k4 S  J3 b! C9 T4 `& b9 O; f7 Y  m
/*--------------------------------------------------------------------------3 |  p5 v6 z9 y5 @0 v8 I
You have the option of coding the cleanup routine to perform any housekeeping
# ~: W% w% B& j& j) c' Q' @4 Hchores that may need to be performed.  If you code the cleanup routine, it is4 b  ]2 m1 P4 j" }& ]5 p5 k3 ~
automatically called by Unigraphics., p7 i' L5 I$ d& r4 Q. y7 U
--------------------------------------------------------------------------*/' e: L' r4 U4 m1 B/ r8 E
extern void ufusr_cleanup (void)
. p3 e# ?: N3 o. A9 ?; R: x/ k{% ]% U+ B& Z1 V
    return;% f( V1 }& n5 J$ H
}
3 y) c& @( L: W3 V0 A' @4 _- ?$ N//#endif /* DISPLAY_FROM_USER_EXIT */
, E; F  M# z! j& \; D9 c( a9 b+ g) ]) M6 ?  \, w' K6 a
/ }9 O3 h% i. p! e# p) R, p) b" o
4 g; V/ s  t* P. u

! |- Y9 o1 T9 r3 f. o4 ^6 n1 N; e8 H6 _. W
& s1 s0 x3 M) Y2 U) c' J: l
/*-------------------------------------------------------------------------*/
: O3 ]" C9 ]( r' P4 {3 V+ `5 ~  i/*---------------------- UIStyler Callback Functions ----------------------*/; X' Z. t4 O' \+ e
/*-------------------------------------------------------------------------*/" _2 J) x8 u( F

2 i# l$ h$ l! B/* -------------------------------------------------------------------------3 a7 q' T2 j' m4 P
* Callback Name: DIALOG_ACCESS_back_cb% j  Z# V# |% G7 E
* This is a callback function associated with an action taken from a- h' ?; y8 J5 O  T, \  N$ F* R/ @
* UIStyler object.
4 p8 c$ Y% v8 E" w. ]( Y$ | *0 q+ @7 E/ f2 i& |& @& g0 v* Y
* Input: dialog_id   -   The dialog id indicate which dialog this callback2 q8 B7 P- s$ Q! O
*                        is associated with.  The dialog id is a dynamic,
9 P& r* F  k. b( h# Z1 }/ | *                        unique id and should not be stored.  It is
% n! r- X- \3 m! v. A3 P. [# a) H *                        strictly for the use in the NX Open API:
0 d6 h8 B5 r5 [2 Q$ ? *                               UF_STYLER_ask_value(s)
; P9 @* i$ x' ?6 f1 c8 G *                               UF_STYLER_set_value   
% V# d% u( q, ^* q6 W8 O7 i2 e *        client_data -   Client data is user defined data associated
( P5 k% c! J8 E  z( Z# u' b! K *                        with your dialog.  Client data may be bound9 S3 m7 [3 P- Q8 z, @8 Z/ }  I" @5 H% b
*                        to your dialog with UF_MB_add_styler_actions
3 X: D2 z, \) G. f) p" f' y4 N *                        or UF_STYLER_create_dialog.                 ) c9 R" Z( ]- ~; d* M4 t+ }& G
*        callback_data - This structure pointer contains information
. |9 k/ }& v' w" D3 ^; H *                        specific to the UIStyler Object type that  . d% P; W4 X  b7 U
*                        invoked this callback and the callback type.7 Y2 D' G7 `* k$ v" R% g4 Z
* -----------------------------------------------------------------------*/" x3 Y2 C  v  q. y
int DIALOG_ACCESS_back_cb ( int dialog_id,
) @  J$ A" X, Q: {$ e9 k             void * client_data,
2 Q" H) X* n) J9 Y) \) L& a0 P             UF_STYLER_item_value_type_p_t callback_data)
' H- U: G) u8 `' D" E6 F8 t1 \{2 U' `- m+ ]( g/ h, o
     /* Make sure User Function is available. */  # c, h2 h' T' R, s- m9 P
     if ( UF_initialize() != 0) 4 Q2 x; I: `7 I6 d1 x: L$ e
          return ( UF_UI_CB_CONTINUE_DIALOG );
# [; J+ I/ j8 @3 }5 E7 `% m: E6 V5 x0 }) k/ {& ]
     /* ---- Enter your callback code here ----- */" _, @4 Q# m- z9 O2 R( F$ J
         uc1601("您将退出对话框!",1);* U) g8 B# N7 f3 J8 z% Z
     UF_terminate ();
  H6 W% i& f. d. x% j8 r$ q, Y/ n1 x
    /* Callback acknowledged, terminate dialog.            */
$ v. f4 o6 @8 n7 P0 b    /* It is STRONGLY recommended that you exit your       */+ g0 c- n1 V/ G. M5 c
    /* callback with UF_UI_CB_EXIT_DIALOG in a back call   */& T3 {# l- m. b7 G. i( E
    /* back rather than UF_UI_CB_CONTINUE_DIALOG.          */
* S  k1 {' n. R" g3 }    return (UF_UI_CB_EXIT_DIALOG);
& H4 Y& {+ C# Y2 O: b1 W. u/ ^5 u7 I
# S$ h8 ]7 w( D$ d" b
}
5 Z5 S. A1 q2 |$ A3 e6 x2 J  V# Z, z% M; Y- D7 y& R& [2 a
/* -------------------------------------------------------------------------
) W4 Y7 H$ F$ H4 h  U * Callback Name: DIALOG_ACCESS_button_cb( v2 l6 _! h1 _: y1 _
* This is a callback function associated with an action taken from a* m( }3 Y4 r# o  N3 ?4 x& O
* UIStyler object. % m! g. l% P" A
*& r$ h, w4 x3 x( K4 V+ x$ V. o
* Input: dialog_id   -   The dialog id indicate which dialog this callback
; K" ?4 {( z0 N; Z *                        is associated with.  The dialog id is a dynamic,
$ O9 ~/ R/ |$ b' U *                        unique id and should not be stored.  It is$ Z# F0 v: E. ^4 _/ y% m
*                        strictly for the use in the NX Open API:* j% l2 u5 i# g4 g  R
*                               UF_STYLER_ask_value(s)
9 ^7 g# n0 ~  L8 C *                               UF_STYLER_set_value   8 E* L6 k' A+ \/ B* x2 x
*        client_data -   Client data is user defined data associated
1 U% n3 p: s1 i *                        with your dialog.  Client data may be bound
- f! a. c! ]9 S* H4 l; K *                        to your dialog with UF_MB_add_styler_actions: q; z  t; g$ U# \
*                        or UF_STYLER_create_dialog.                 
( M8 c2 f& @  Q! e *        callback_data - This structure pointer contains information
: h) k, i; j2 [- h( q) O *                        specific to the UIStyler Object type that  3 W5 q. f4 \- O: ]0 @
*                        invoked this callback and the callback type.# w; i( F( o4 O+ c8 h% k- E6 X
* -----------------------------------------------------------------------*/  }- `+ j3 V; d$ y* f3 J3 D
int DIALOG_ACCESS_button_cb ( int dialog_id,
3 K6 P& |+ l7 R6 v- g. \) t7 H             void * client_data,
: \( O8 u3 ?/ e# m$ j+ u             UF_STYLER_item_value_type_p_t callback_data)5 t( ~/ x( T2 k8 W) d# Y
{( N+ V% m1 c' K# [+ o
     /* Make sure User Function is available. */  
3 {3 f$ z- O( O# L     if ( UF_initialize() != 0) 6 r+ d/ Q. F% ^
          return ( UF_UI_CB_CONTINUE_DIALOG );
! U5 E. Y6 v$ X& j1 g
: p% ]7 `4 D- W& S* M" w     /* ---- Enter your callback code here ----- */* U( m' m9 U* c% |
         UF_STYLER_item_value_type_t data[3];
& y8 A: S2 v8 O& q         char info[100];- ^9 O8 p$ N* B' o  K" m
         1 I: k+ j2 h2 |! h, a/ M% V( ?% J
         data[0].item_attr=UF_STYLER_VALUE;
6 E( m' Y+ x3 [         data[0].item_id=DIALOG_ACCESS_INTEGER;4 z5 S2 C" O6 w+ a; h$ D. i& U7 U, o* J2 _  R
     UF_STYLER_ask_value(dialog_id,&data[0]);
) K$ r5 @# C% J( d4 y
6 N* e& ~) ^* Z$ n         data[1].item_attr=UF_STYLER_VALUE;
* [6 m/ [+ o- n. W2 K% l         data[1].item_id=DIALOG_ACCESS_REAL;3 M6 Z2 M; k. @% \& V6 b
     UF_STYLER_ask_value(dialog_id,&data[1]);+ z/ Q7 J/ N6 |( p+ j0 G5 J
% g) T8 k" g+ Q: u9 f# S) \7 B! k
         data[2].item_attr=UF_STYLER_VALUE;
/ v8 u* A# o- B+ q5 b2 Z& }; M" f         data[2].item_id=DIALOG_ACCESS_STRING;- `% b+ ?' ?2 W3 `3 Q
     UF_STYLER_ask_value(dialog_id,&data[2]);0 u5 M5 @/ v& t5 e5 j5 i2 O
( ^* `& S2 t% U. ?- p: V/ d
         sprintf(info,"整数为:%d\n实数为:%f\n字符串为:%s\n",data[0].value.integer,data[1].value.real,data[2].value.string);
6 }" d" F' J3 x5 ^* K: N5 Z) }, a4 ^" E
         uc1601(info,1);
  p8 Z% N7 S# g8 P- S6 M; z% v+ y2 c1 b$ h  W
     UF_terminate ();
! n. k2 s+ i1 x7 e. j' z5 @2 b+ u, Z
    /* Callback acknowledged, do not terminate dialog */
5 N+ g0 L( g" `5 a; r) Q% Z    return (UF_UI_CB_CONTINUE_DIALOG);
" P# `$ u: p$ o$ e" {0 b& U2 [: b, |# e! r+ [
    /* or Callback acknowledged, terminate dialog.    */
% P, ~( L! L! q/ d* V  G  \! T    /* return ( UF_UI_CB_EXIT_DIALOG );               */! F: i8 o" @( i4 h
}5 Q. P* j' q: ]
! D5 `& v) W- j' y: @% p4 I
 楼主| 发表于 2013-11-30 13:45 | 显示全部楼层
木有人啊 。。。求指导啊
回复 支持 反对

使用道具 举报

发表于 2013-12-5 14:38 | 显示全部楼层
我觉得楼主狠牛B 我一个看不懂啊!
回复 支持 反对

使用道具 举报

 楼主| 发表于 2013-12-5 16:10 | 显示全部楼层
#ifdef MENUBAR_COMMENTED_OUT$ |; M5 r, k. i
#endif/*MENUBAR_COMMENTED_OUT*/
# Q) B4 ]4 ^) Q/ q! l6 b" F$ ^- ^) t' Y& |
找到原因了 没屏蔽这两句 呵呵 我也是新手。
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|关于我们|sitemap|小黑屋|Archiver|手机版|UG网-UG技术论坛-青华数控模具培训学校 ( 粤ICP备15108561号 )

GMT+8, 2024-11-17 03:56 , Processed in 0.052712 second(s), 20 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表