|
int ROLL_constructor ( int dialog_id,7 S1 V7 \- u+ `7 ^# U" T
void * client_data,
! U# C4 q# J, J; ^' C, Z UF_STYLER_item_value_type_p_t callback_data); ?& w! R( `! P; w- l( T) a
{
$ d2 W$ \( t4 E' H) N; w$ ~7 k /* Make sure User Function is available. */
$ |% B8 m) F( [ char dir[100];
R$ K3 y4 l9 ]: x& } const char env[155]="ugII_USER_DIR";) @& n$ L1 ?& V/ q+ ]/ B: ]
char *basedir=NULL;
1 B& M( P( z: X+ f3 x tag_t part;
$ a% J# R* _3 `& _/ S# k' q UF_PART_load_status_t error_status;
. _" ^$ ^* q: a2 o a basedir=getenv(env);
+ l% C2 E& F/ H+ Z0 y * M: a1 m9 G4 m" e4 ?
strcpy(dir,basedir);7 K- [) }. {2 v7 D' O0 h: Y5 k2 e# W
strcat(dir,"\\roll\\J-J 2D.prt");$ m; ^4 r9 X. b7 M
if(UF_PART_open(dir,&part,&error_status)!=0)% g" @! k3 D8 [ O3 x
{. _1 r h E" b/ `, A$ D7 r
UF_free_string_array(error_status.n_parts,error_status.file_names);
+ H! @' b1 C! D6 a# m' S5 H UF_free(error_status.statuses);
) o" e `. u' {8 A8 \, B return(UF_UI_CB_CONTINUE_DIALOG);, t2 B' _8 `. S* b
}
& r8 I" C* ~2 u( |, l# ~% y UF_free_string_array(error_status.n_parts,error_status.file_names);! d; k5 B$ N" d w
UF_free(error_status.statuses);
7 u9 {, M) f' a( \) j* J double arExpValue[2];0 r. Q# O+ x1 J) J/ Z
UF_MODL_eval_exp("threeJ_a",&arExpValue[0]);
% r/ b5 }8 S8 Y# W/ O3 b UF_MODL_eval_exp("threeJ_b",&arExpValue[1]);
9 w7 k5 m, z% c$ x
' R; @) v' i4 I6 u: X" C UF_STYLER_item_value_type_t data_set;
8 K- R- i: v# ?, W# r& H data_set.item_attr=UF_STYLER_VALUE;# X; j" C( V/ T
data_set.item_id=ROLL_A; (此处报错) ) x) `& t/ k: w
data_set.value.real=arExpValue[0];
/ S- `1 C; [0 g1 _' s9 F8 N UF_STYLER_set_value(dialog_id,&data_set);) X- o6 i/ F+ u2 {+ \2 z* _5 ?
UF_STYLER_free_value(&data_set);
4 ~3 g0 e/ L- }3 J data_set.item_attr=UF_STYLER_VALUE;
1 n; s& D7 |& C, [; i0 l data_set.item_id=ROLL_B; (此处报错) : A1 |+ _" A! R
data_set.value.real=arExpValue[1];/ I% V' l: E8 w4 j& e0 G2 L7 i
UF_STYLER_set_value(dialog_id,&data_set); y1 j" y( z! |* ^0 `1 N& M
UF_STYLER_free_value(&data_set);$ V* l( N" W0 M o; V
UF_terminate ();7 b5 T$ d0 {3 ?! f0 x) k
/* Callback acknowledged, do not terminate dialog */
: p* w0 U& @* U+ b( X% v return (UF_UI_CB_CONTINUE_DIALOG);
$ @8 Z$ y& W% s+ V3 k: ` /* A return value of UF_UI_CB_EXIT_DIALOG will not be accepted */
2 n) M* v/ S& O. H% F2 r /* for this callback type. You must continue dialog construction.*/
9 s/ G7 E1 x2 F* I8 J+ L9 b1 ]& t ^}: G6 P6 X; G! Z' s# c# B
8 }: z0 b* w- F9 f+ v
$ V0 o! O1 _) Y/ j( b
报错如下:+ b+ H- B V9 @2 S @
E:\roll\roll\threeJ.cpp(438) : error C2065: 'ROLL_A' : undeclared identifier
- J! K1 }( O2 I! j% mE:\roll\roll\threeJ.cpp(438) : error C2440: '=' : cannot convert from 'int' to 'const char *'
; n! R: ]! T G& C3 Z Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
- k, m9 F* e- |2 {E:\roll\roll\threeJ.cpp(444) : error C2065: 'ROLL_B' : undeclared identifier
6 }' k1 o3 m+ ?+ i/ V5 ~E:\roll\roll\threeJ.cpp(444) : error C2440: '=' : cannot convert from 'int' to 'const char *'- |4 H& n/ m) W. l
Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast$ O9 A( f x; G' G! h
其中 ROLL 是文件夹名称
( F- O4 Z, O. h: C+ x2 Y# dJ-J 2D.prt 是部件名
* h: y! L+ J# u. WthreeJ_a3 J4 _' m8 W1 q
threeJ_b
- C7 t* i/ c" V0 `" a是表达式的两个名称' F; ^, E! Y+ d1 r2 L0 o1 U, p
, e" ^+ m' I, ^6 o
ROLL_A
5 E6 m( J5 m. I+ ?& d) }) a; oROLL_B {! l, o$ X f* D; M& u, U% ^
A和B是UISTYLE的标识符
3 {/ D8 D+ K% p7 t0 J
7 p1 L' {2 V& x: y$ V请教,我这是一个初级的二次开发表达式,我只要定义两个参数化变量,请问我这里的constructor哪里出错?
+ \7 A4 B6 v6 c, H: ^2 C% R- b& y我这也是参考一个例子编的,它的是五个变量。。- p9 b4 x0 Y6 z B$ R
6 }2 u4 b6 B, }& ^1 o请各位高手能帮我解决这个问题,感激不尽! |
|