PLM之家PLMHome-工业软件践行者

[VIP求助] 库缺少需要的入口点,功能名:ufusr

[复制链接]

2017-2-14 11:29:07 6714 0

lzhyi 发表于 2017-2-14 11:29:07 |阅读模式

lzhyi 楼主

2017-2-14 11:29:07

请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!

您需要 登录 才可以下载或查看,没有账号?注册

x
本帖最后由 lzhyi 于 2017-2-14 11:32 编辑
/ l$ O/ d- _3 I  g! w* @+ u0 H! A4 l9 ], ]) T$ h
请问出现如下问题,是什么原因:库缺少需要的入口点,功能名:ufusr
+ Q  |2 a  z9 j, S! s8 C代码如下:
: c9 K" i- }1 q) M+ F#include "Shrinkage.hpp"
! X& A9 W3 l# ~% Z0 p( L( Cusing namespace NXOpen;
. {* P" E" s& z7 K# Z/ cusing namespace NXOpen::BlockStyler;7 |5 S/ g+ ~4 _9 G' d  Q1 |
& Z9 P" P' i  M8 N) d) z: G
Session *(Shrinkage::theSession) = NULL;
& E& K, E/ r( G& ^- K. S/ XUI *(Shrinkage::theUI) = NULL;
% A" j8 c- Y+ u9 Q8 C% b& i2 w; ]. ]; b/ b
Shrinkage *theShrinkage;* O+ J0 O. w! C% F7 E, A! S

8 z9 q. `$ c2 J3 @Shrinkage::Shrinkage()
$ c/ o" m8 M2 T{4 g: D: z2 }! `
    try
, X8 }7 H7 t6 m7 x: T9 ]$ }# i0 P    {
/ M) J% v2 f6 J# T) X3 q- l        // Initialize the NX Open C++ API environment4 u+ s( u( O3 \" R; D9 q% c* i
        Shrinkage::theSession = NXOpen::Session::GetSession();
4 J/ l. @: _! D( w$ c* q4 a8 j# b        Shrinkage::theUI = UI::GetUI();
- J: E! ?, z" T! _4 _/ K2 V        theDialogName = "Shrinkage.dlx";9 c4 c7 r- r/ X$ k; u/ M* @* O
        theDialog = Shrinkage::theUI->CreateDialog(theDialogName.c_str());
* h2 U; n4 e+ g' n- u8 Z$ y! A        // Registration of callback functions/ t5 @. ~% @8 ^0 e) ~
        theDialog->AddApplyHandler(make_callback(this, &Shrinkage::apply_cb));
8 |* Z4 G$ _1 x  J8 o, M8 i        theDialog->AddOkHandler(make_callback(this, &Shrinkage:k_cb));
) u& \2 S# a: j" _        theDialog->AddUpdateHandler(make_callback(this, &Shrinkage::update_cb));5 ~1 ~  F" Z8 l9 [
        theDialog->AddFilterHandler(make_callback(this, &Shrinkage::filter_cb));
7 {: f5 z/ I: ?) m. [  p        theDialog->AddInitializeHandler(make_callback(this, &Shrinkage::initialize_cb));7 B# ^3 ?& \, F6 `4 C7 X( ~
        theDialog->AddFocusNotifyHandler(make_callback(this, &Shrinkage::focusNotify_cb));
2 @: S" V4 i2 q8 }5 o+ m3 A        theDialog->AddKeyboardFocusNotifyHandler(make_callback(this, &Shrinkage::keyboardFocusNotify_cb));
! a  P9 [* A1 Z8 K! R0 Z* |        theDialog->AddDialogShownHandler(make_callback(this, &Shrinkage::dialogShown_cb));) g" @9 T0 q2 M, U, B
    }  e3 W. e( G0 K7 x% y
    caTCh(exception& ex)7 {3 S3 s1 D: N! b' m
    {
/ i3 ^+ c. B$ b( p0 A$ n0 C   
  h, M- k0 j1 V. b) w: d; s; U        throw;
0 Q' T4 Z0 S) f    }  `. o& @. O! i9 T# j3 S1 x
}+ |4 A. ]2 D( ?. {

& L6 u: w. `7 ~$ H  f  sShrinkage::~Shrinkage()
8 j' _+ z  ?, _( ?0 \4 a: v" N* o: o{2 ^: W$ ^* r* J* S! _' m  m
    if (theDialog != NULL)4 w/ l. X1 x1 s/ c
    {! n6 i2 N! i' N1 g" @4 t. X
        delete theDialog;( C7 T1 _! n& F8 {  i
        theDialog = NULL;* ~" Y- q9 ?- a% F1 H+ o! M. A
    }
3 y" D1 ]* Q6 t- Y1 u# q6 p4 }" T}
1 c6 S9 b  e3 R. p( v7 F+ ^' m* N1 f: D* t3 D
#if USER_EXIT_OR_MENU
+ |) b6 U  y* Y: T/ ?    extern "C" DllExport void  ufusr(char *param, int *retcod, int param_len)9 }) i* B" r* H
    {
8 v; X- z) ~2 ~0 _# J( K, A+ j        try
' s- _$ M+ \/ ?3 p: l& c1 I        {
1 Q9 {, @% `' O% v4 U            theShrinkage = new Shrinkage();# t: G3 i* O7 X9 T2 h( V2 f
            // The following method shows the dialog immediately
1 ^) a% Q+ \2 h! w# K; K            theShrinkage->Show();
1 h. F/ }; D0 F6 H: n9 w        }
: [5 G$ h, J3 B9 |( |0 Z8 K        catch(exception& ex)
% M9 R" v3 _5 \$ V# D) |        {' S, ?0 \! b2 v# G
            //---- Enter your exception handling code here -----1 N+ J' r/ u: G7 A% n+ ?  ]
            Shrinkage::theUI->NXMessageBox()->Show("Block Styler", NXOpen::NXMessageBox:ialogTypeError, ex.what());
' Y7 A% z: {0 U8 k; o7 e8 C        }9 I4 Z0 }8 s7 i8 R* w  f1 `" U
        delete theShrinkage;$ `. f/ V( E% h+ O( j8 N
    }
& O8 x0 _+ p& c  h#endif//USER_EXIT_OR_MENU6 [7 u' P) e; H) {. M( a
#if USER_EXIT
5 I. ^. W( U8 `   
; I$ {1 O) t' @+ D    //------------------------------------------------------------------------------
, M' S& u% B7 T: p' W0 R, }. J3 D   
' N1 d  N+ w+ \3 E3 ^) c    // MUST NOT use this option since it will UNLOAD your NX Open application image- J0 p# ?) t/ H: Q3 p. Q
    // from the menubar., h! ~% t  e( P& U
    //------------------------------------------------------------------------------
9 M/ A4 _& u3 k9 k6 b9 M: |8 C% z    extern "C" DllExport int ufusr_ask_unload()
9 x. t' j: O: h    {
4 N( e1 D+ `$ J' a) ?$ M        //return (int)Session:ibraryUnloadOptionExplicitly;6 N) I3 f7 Y# w2 f
        return (int)Session:ibraryUnloadOptionImmediately;# U! }8 {2 Y7 K
        //return (int)Session:ibraryUnloadOptionAtTermination;
# l+ p" a3 W- y6 C) B    }  H4 z* O/ ?( h& p  W( ~
    " [: b2 U1 m6 @# X6 T0 S
    //------------------------------------------------------------------------------
0 d' m& q* z, {, `* d    // This method is automatically called by NX.3 z0 q& h% `2 s$ x# p  n1 F; I$ I
    //------------------------------------------------------------------------------! T2 M/ a7 l  ^+ L( A1 S9 [
    extern "C" DllExport void ufusr_cleanup(void)5 {- d% ^% ~- x5 h3 C  [6 f
    {3 z- q# w7 b5 h+ L, ?
        try
; Z& {, l$ a4 V4 k- X, C% F        {
' k( b. Z1 B4 h9 ~            //---- Enter your callback code here -----( c  W; L/ ~# d1 _; q8 D  U
        }4 A2 V% f7 p* z9 S/ ?3 H5 ]
        catch(exception& ex)1 K. w& M$ P# L, x( l6 p  u% Q
        {2 u) J% m4 t' A3 @
            //---- Enter your exception handling code here -----' T% g, l! I( T2 X
            Shrinkage::theUI->NXMessageBox()->Show("Block Styler", NXOpen::NXMessageBox:ialogTypeError, ex.what());8 d1 Z9 Y3 U+ {, [# p; C
        }8 f4 v2 H% h: M$ a
    }4 }& m7 ]) A7 S4 y3 O! l) @8 f6 Z
#endif//USER_EXIT
  k0 V. u' _# X6 h* n+ g! t4 S   
5 P: k" r' a5 w* t* q; }4 v) G* ^    int Shrinkage::Show()0 f: K9 r# s, Z6 k' M% v  ?
    {
% E/ {) o- M! R6 U( V) f# x        try
  @; W2 ^' |0 O  G3 c6 i        {
% k% y/ Q; h2 `+ X! `; w, o" o            theDialog->Show();
7 G6 N* @: X/ U1 X5 }4 ]        }
! y, `  s: J9 Z- u7 x, M' }        catch(exception& ex)
! X0 e* @1 z8 S% w        {
+ X# D7 }3 [) A0 }( F+ u/ Z            //---- Enter your exception handling code here -----" H7 j* f$ W. \; k
            Shrinkage::theUI->NXMessageBox()->Show("Block Styler", NXOpen::NXMessageBox:ialogTypeError, ex.what());, C6 ^. i& E3 D! Y- H/ @! M
        }
* E4 \' ~; k& t" o7 r        return 0;
2 |& S0 W: x* q8 ]0 l6 w! n, u    }/ H: \" U2 L+ r8 L5 X; f* m
   
  ^6 D5 r4 d" [  C2 Z#if CALLBACK
- f6 I6 f: c; j1 o
" s; U4 M0 g! k5 d$ x' \0 C    void Shrinkage::Show_Shrinkage()
( Q5 ~( o; l5 P% S( {' G% z    {" p' ~+ [4 B7 p, L
        try2 a% l& J; v+ D5 p9 x0 c- q0 u
        {
1 J3 b7 F3 x- Q" f' Y4 m$ P            theShrinkage = new Shrinkage();
4 y6 y. Q3 _5 u
- X4 Y$ }3 D4 I) o" d            theShrinkage->Show();# p. Z! h* l, j" [3 V; x
        }
7 ?5 k. G4 k: |$ C8 P, S3 H        catch(exception& ex)
9 L! o5 J# v# s: \        {
6 F. I. Z7 s3 x+ d. ^* g* s9 S) C- H3 {
            Shrinkage::theUI->NXMessageBox()->Show("Block Styler", NXOpen::NXMessageBox:ialogTypeError, ex.what());5 Q; f3 x6 _: e* a( m: s, i% [- G
        }
0 f# }  c4 {  \7 t5 Z; D$ Y/ j! @        delete theShrinkage;; T; Q; y8 O. V6 |! B3 |# f
    }
# y0 ]+ ]  X8 R  ~/ U#endif//CALLBACK
: }+ [# B+ K  h5 Y; }: }/ p    8 \  p+ U9 j( K* ?
    void Shrinkage::initialize_cb()% J8 p# A+ p* k2 J: @9 |: ~
    {
0 @, h8 }7 W4 f( v7 S        try
$ n1 f% }, A$ x" J        {  P8 ?! u: \  ]6 F
            group0 = dynamic_cast<NXOpen::BlockStyler::UIBlock* >(theDialog->TopBlock()->FindBlock("group0"));
; j% j  g! X2 p            face_select0 = dynamic_cast<NXOpen::BlockStyler::UIBlock* >(theDialog->TopBlock()->FindBlock("face_select0"));& I+ Y" I  P# `( M
            face_select01 = dynamic_cast<NXOpen::BlockStyler::UIBlock* >(theDialog->TopBlock()->FindBlock("face_select01"));
) q; a  D* Z. M( Y$ \" `6 j+ e8 v            group01 = dynamic_cast<NXOpen::BlockStyler::UIBlock* >(theDialog->TopBlock()->FindBlock("group01"));
& d' @9 A  E1 Q            bodySelect0 = dynamic_cast<NXOpen::BlockStyler::UIBlock* >(theDialog->TopBlock()->FindBlock("bodySelect0"));
5 c! @+ B( n. p0 X) z9 ]7 \            bodySelect01 = dynamic_cast<NXOpen::BlockStyler::UIBlock* >(theDialog->TopBlock()->FindBlock("bodySelect01"));; Y3 l. ~" T/ c( r# T6 {- S
            group = dynamic_cast<NXOpen::BlockStyler::UIBlock* >(theDialog->TopBlock()->FindBlock("group"));: [) c+ i+ i3 O1 g
            string0 = dynamic_cast<NXOpen::BlockStyler::UIBlock* >(theDialog->TopBlock()->FindBlock("string0"));
* M. {8 N5 W$ w6 v  ?- m+ i            label0 = dynamic_cast<NXOpen::BlockStyler::UIBlock* >(theDialog->TopBlock()->FindBlock("label0"));: b! f% W% b' v/ S8 f/ e% }/ Z/ T
            string01 = dynamic_cast<NXOpen::BlockStyler::UIBlock* >(theDialog->TopBlock()->FindBlock("string01"));8 `) d" y# w  `; l' M& s
            label01 = dynamic_cast<NXOpen::BlockStyler::UIBlock* >(theDialog->TopBlock()->FindBlock("label01"));
1 g8 a7 a" C; A+ Y# t: @            label02 = dynamic_cast<NXOpen::BlockStyler::UIBlock* >(theDialog->TopBlock()->FindBlock("label02"));
2 \+ x: d6 p' I' I' T( z5 \" m        }
- h' E3 g, d* A5 b9 I5 {        catch(exception& ex)0 }  b- n* p+ K, M
        {3 a' D: V, v& N, m
           
+ [4 e) b3 E! f4 l/ p            Shrinkage::theUI->NXMessageBox()->Show("Block Styler", NXOpen::NXMessageBox:ialogTypeError, ex.what());) C6 u* m! t* y2 p0 n$ e$ J& V  e9 ^; W
        }) u2 E* W6 a5 x7 s3 J/ A3 b
    }6 e, G) t. A; `/ P+ d
    //------------------------------------------------------------------------------) C5 c, I3 R! A; z# |$ C: o
    void Shrinkage::dialogShown_cb()4 J4 g# Z" s% Y! ^" K
    {: [/ G+ ?, i7 f( @
        try
7 k7 s/ f% A* O+ i& f: g4 Z; N        {
# D! G2 v2 q# M+ C; G            //---- Enter your callback code here ------ Q! {& w9 t7 Q* K- f
        }
, C- D! K+ i4 q3 U- S        catch(exception& ex): u& l; z6 ~+ m0 h5 s. E$ w( B9 |
        {
$ j' H7 W9 p% G3 e& T$ h+ v
( q9 w4 m/ K' b7 h! U            Shrinkage::theUI->NXMessageBox()->Show("Block Styler", NXOpen::NXMessageBox:ialogTypeError, ex.what());
" t* m1 S% A8 H8 @        }
  X7 t" {- B! w+ {0 Y9 i    }
; a7 W# @% O2 y; f* b    ( C% y( c, [, q
    int Shrinkage::apply_cb()8 @/ y0 ?: a9 `% c  B
    {
. T8 e/ r9 D2 a        int errorCode = 0;
+ y% c2 e, J# `" P; X* L        try' L8 I; p- x: a! @0 B
        {( \4 o% V! h5 I* n; B; R
            //---- Enter your callback code here -----
: X; @) N& B" P" s- o+ U& @        }/ P/ A  t) ~% u
        catch(exception& ex)
) A  Y% r1 _. I/ V7 b- L# C        {
* m6 ]2 O( W* P# L% L. d/ R            //---- Enter your exception handling code here -----/ h: q. H, [; p# D  ^
            errorCode = 1;
  B  P& x: r, y( m            Shrinkage::theUI->NXMessageBox()->Show("Block Styler", NXOpen::NXMessageBox:ialogTypeError, ex.what());& M' q9 F( b* y$ Q& s. \0 O
        }" Y4 Y& m, Q' L0 Z
        return errorCode;6 y( o2 @: y2 n6 _2 l$ |. K) z2 W
    }
+ t8 t" B: G2 Y  B
2 |5 ~' Q1 q) v& ^5 R    int Shrinkage::update_cb(NXOpen::BlockStyler::UIBlock* block)- _$ {8 |. a/ r. h$ Y
    {/ D! h8 `- X" \" E! C, {/ o
        try
* T& n! _1 ^5 F! J: M" G5 o& j        {. }5 M' c1 \2 x' w% n, N0 x. W. x
            if(block == face_select0)
2 b% ?# W, d' }, e( p            {/ E7 w& x% x+ d, q' S5 M$ M
            //---------Enter your code here-----------
- H( n& Y$ t" n, r            }
' V# ~6 @! ~" Y6 H, r            else if(block == face_select01)
; i! O. u. m3 J3 u, R            {
. d8 }$ c$ n* t& u: Z            //---------Enter your code here-----------
1 ]; I$ I: k6 N0 P3 W3 U2 v            }
6 T6 b8 @/ I& L, r! m5 Z* x            else if(block == bodySelect0)
& k9 W! z* R4 V9 y/ W6 }            {
) A3 N; B% m0 X7 L" p9 s            //---------Enter your code here-----------' O% V0 d) C8 v' _$ ~6 c' P
            }
: d4 l) C' e+ m2 V: V7 r. B            else if(block == bodySelect01)
1 h& ], l* V0 x8 L& k  {            {
2 [9 X, ^( t6 P5 q            //---------Enter your code here-----------# F% [2 o7 q  }+ R
            }
! `  J9 F( U' x/ ~; f+ j8 F            else if(block == string0)& w' o5 x+ ]' V: C$ q$ a2 Y6 @
            {
4 Q) ^+ h! [+ {" [7 n1 u            //---------Enter your code here-----------8 P8 M; L0 n" x/ z5 p
            }- |2 m0 {- H+ I- ]6 L3 P9 A
            else if(block == label0)
; L% Y" S6 p# `# Q  r, i6 s            {' b5 T8 s6 ^# d3 K
            //---------Enter your code here-----------
$ {5 q7 R; n+ \  B8 h            }  X9 f- w. L( g6 P' D( z
            else if(block == string01)  p4 L) p) [' M/ a4 X+ T4 Z
            {( ^! G- }  I# G, S. h
            //---------Enter your code here-----------3 v- A) E1 r4 w
            }& l$ f, p) d  C. I
            else if(block == label01)
* {1 D" L$ g: @) }$ t            {
5 E9 k* Q' y" b3 F2 x  d            //---------Enter your code here-----------
8 V: r0 A7 e  d" K* l            }) T* S# U/ A# @  [6 w: y
            else if(block == label02)
! _7 ]$ J* I* |9 f$ R            {
2 q* X2 O( f( T% _            //---------Enter your code here-----------
3 i/ W0 R2 G9 U, a# [            }5 A( {! D! X" d, _
        }
* Y6 o: c$ T, Q        catch(exception& ex)
. @- X4 P" c% W4 `0 I' P0 X/ g! Y        {
4 e0 w9 u" t' V1 Q            Shrinkage::theUI->NXMessageBox()->Show("Block Styler", NXOpen::NXMessageBox:ialogTypeError, ex.what());+ l) {0 M$ Z9 Z# G. m- ]0 Z( I
        }# g# w( |8 i" V, d1 k3 T" G
        return 0;# |! H/ {* t. x' J1 b- V! j
    }2 m" I4 S. T) w' z3 {- [  w; C4 O; G
    * K* j0 I6 O& N6 s
    int Shrinkage:k_cb()* c" i; C- Q* \& L" t/ D1 Y* ~! [
    {
# R8 M1 d# k; x% v        int errorCode = 0;
5 N, k/ H) D/ f        try% M+ a. V2 G2 @( C
        {
; w1 b" G! f+ k3 a+ ?            errorCode = apply_cb();
: c. j2 {/ |0 V. O" o. L( O        }
. z$ ]- c: h9 y& o        catch(exception& ex)( u! Z. y) |, v1 u9 l7 C: j3 [0 W
        {
' @9 d" c/ D1 x) f( U: h            //---- Enter your exception handling code here -----5 _7 Q' p0 y1 h3 o) [
            errorCode = 1;% l" P$ m( X) U& J# ?
            Shrinkage::theUI->NXMessageBox()->Show("Block Styler", NXOpen::NXMessageBox:ialogTypeError, ex.what());9 k$ ^2 D0 `0 s( ]
        }5 Y3 v# E3 H1 _9 e8 q9 U
        return errorCode;) [7 V4 i. N; f, I1 v2 Q0 j
    }7 \$ ~0 i, C4 i. i; i+ u5 @2 z
   
9 B4 J% N: P6 f! R! v    //------------------------------------------------------------------------------' N. x7 T' P' w. H  b
    //Callback Name: filter_cb6 |: A7 n, |( G3 D5 o4 }
    //------------------------------------------------------------------------------& i- R1 X" a& k# C
    int Shrinkage::filter_cb(NXOpen::BlockStyler::UIBlock*  block, NXOpen::TaggedObject* selectObject)
1 z* s) R' O% B    {
  u. P" Q3 m7 J7 U4 ?9 z( |0 l' i  m        return(UF_UI_SEL_ACCEPT);
2 z) O" q. t0 e: s    }
1 x2 C% f& e$ I   
  r( ]# I3 Y  r4 u' {; l. k6 X2 c    //------------------------------------------------------------------------------
5 [; M. z* f" F  H0 d2 U    void Shrinkage::focusNotify_cb(NXOpen::BlockStyler::UIBlock* block, bool focus)
+ u) Q' q) w: k. z/ x# e; \- u: w# v    {' A2 |2 j9 S2 D& n' F
        try
) M% `! q9 |$ X3 ?        {
& K4 x- b% s" L/ o% [; m+ k            //---- Enter your callback code here -----8 P3 L1 ^3 J  J" R4 ~& e' c- S" N
        }; C  K1 I, r: m( e  t
        catch(exception& ex)
1 y- J. \# Q' k5 Z        {
' |/ X& p% Y( P7 ~' a            //---- Enter your exception handling code here -----+ @5 O" I* J% F& u5 Q0 c3 @* H! G+ A
            Shrinkage::theUI->NXMessageBox()->Show("Block Styler", NXOpen::NXMessageBox:ialogTypeError, ex.what());
2 ?3 E, [! K1 ]/ @        }
/ V* W" _2 d7 A$ l4 H    }9 }2 X, p5 F+ N3 M6 H( T0 n
    2 \" r  z- h" S+ W
    //------------------------------------------------------------------------------
: q+ W& A3 k5 {3 W    void Shrinkage::keyboardFocusNotify_cb(NXOpen::BlockStyler::UIBlock* block, bool focus)
6 c' x1 D% i0 \; b' c    {4 z, i3 a! a0 r2 b: C; F9 v
        try! Y: U' s* [8 H* I0 F! @
        {
1 p6 j" X! r8 M5 B8 Q4 I            //---- Enter your callback code here -----5 ]! N9 Z1 L5 e) a( B/ G( F; n
        }* X: w+ V, i. X: ?& Q
        catch(exception& ex)
4 M; H( J/ t/ o0 i        {
7 R6 a5 k* D8 C3 H4 b5 m! Y3 L
( d8 m+ \8 t6 K9 D& H) y1 w            Shrinkage::theUI->NXMessageBox()->Show("Block Styler", NXOpen::NXMessageBox::DialogTypeError, ex.what());# w1 P/ b( o2 i
        }
. E3 N+ T1 ~0 X4 F    }
, A5 G" f8 N# Y/ R  X3 o) B8 ?) }9 `' ]
7 p6 ^. ?* \' o
22.jpg

application.rar

9.79 KB, 下载次数: 3

上海点团信息科技有限公司,承接UG NX,CATIA,CREO,Solidworks 等CAx软件,Teamcenter,3D Experience等PLM软件,工业4.0数字化软件的实施\二次开发\培训相关业务,详情QQ 939801026 Tel 18301858168 网址 www.diantuankj.com/ doTeam.tech
回复

使用道具 举报

发表回复

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

返回列表 本版积分规则

  • 发布新帖

  • 在线客服

  • 微信

  • 客户端

  • 返回顶部

  • x
    温馨提示

    本网站(plmhome.com)为PLM之家工业软件学习官网站

    展示的视频材料全部免费,需要高清和特殊技术支持请联系 QQ: 939801026

    PLM之家NX CAM二次开发专题模块培训报名开始啦

    我知道了