|
|
楼主 |
发表于 2014-3-23 21:32:53
|
显示全部楼层
mildcat您好,我加入了第二个对话框的头文件,并在int dialog1::apply_cb()里添加了show方法,编译没有出问题,但运行程序的时候点击dialog1的OK按钮后跳出一个错误信息:cannot launch the dialog。请问这是怎么回事啊。(dialog2头文件及成员函数定义都没有问题)
2 R6 ^0 d4 H/ F# ?int dialog1::apply_cb()+ z; R% U3 ?& b a" T
{
4 R( A- i0 |6 d int errorCode = 0;+ h9 A) V- A, A# |- }
try
2 q8 ^) Z" @; ?3 n& l: e+ a+ j {$ W0 g9 S7 J Q. ?
//---- Enter your callback code here -----
- t6 r" t n D8 N" p dialog2 *thedialog2 = NULL;//添加了这三行
- T+ q8 `5 D8 l' r2 e thedialog2 = new dialog2();//添加了这三行
; O" w; H6 c% D! S thedialog2->Show();//添加了这三行
1 ^6 y) _# A: M1 y, a# } }
1 V1 A, f' k4 s5 y catch(exception& ex)8 j# R& X7 y5 V5 ~# M
{
, s. Q, V2 |/ C# F! g& S9 m: C //---- Enter your exception handling code here -----; ~, }& }5 y8 K+ S$ J- q! U
errorCode = 1;
: o$ f' F f9 G& h8 L dialog1::theUI->NXMessageBox()->Show("Block Styler", NXOpen::NXMessageBox: ialogTypeError, ex.what());6 G; K" ?. v- B) }1 \
}: i4 w7 N9 z; G' |
return errorCode;5 s: y5 q0 I. f, _5 C
}/ _5 y# I2 _# \' `' e
3 E, e% x( w" O5 ~# Q6 M- G$ a$ [; K//------------------------------------------------------------------------------
) e3 s4 F9 @6 H% i: d- ]5 u9 G//Callback Name: update_cb
9 }* o9 m, [- B+ i6 d E//------------------------------------------------------------------------------
: Z0 P" C* W) }& h# v4 Cint dialog1::update_cb(NXOpen::BlockStyler::UIBlock* block)
B( @$ |( d7 k% \5 b{
% ^% E' j5 T* S2 N5 b% E try, x, B$ ], u) G" a- T
{7 Q8 u/ A# N. d! y( o* u, ~& l P
if(block == double0)
( y1 \9 T2 f' O- L {* v2 Q, P$ T7 p1 ]; K
//---------Enter your code here-----------
' f: s H) d6 s7 ?8 E }3 q" A; B0 f1 S9 Z! w: q
}
5 \9 D: M$ N6 | catch(exception& ex)
8 z- U7 n$ W, }" F# {" P( x {9 x) D/ A1 f9 k. P Q! j
//---- Enter your exception handling code here -----+ C# C9 @5 d n2 J: v+ ^! |" n
dialog1::theUI->NXMessageBox()->Show("Block Styler", NXOpen::NXMessageBox: ialogTypeError, ex.what());: d) ]" ?2 K; l& ]) b% s0 S C9 p
}
2 v+ h! h0 D! W% P return 0;6 Q! }4 w) R) A* g* o
}. y- ]# @5 r9 ^& c8 b3 `/ s
|
|