|
int ROLL_constructor ( int dialog_id,5 h) k- R* z" P& Y# z; R" H
void * client_data,& C5 N+ P' Y3 I* j
UF_STYLER_item_value_type_p_t callback_data): i4 y7 f( J0 H/ W' [, y( G0 W
{1 y& X \* i& |3 \8 W) _7 K3 f
/* Make sure User Function is available. */ 7 S3 g [+ X7 E+ R0 x
char dir[100];
4 z* o9 k( O: L2 Q4 g7 \ const char env[155]="ugII_USER_DIR";2 q {3 J4 i! m# m3 E
char *basedir=NULL;) @+ o) ?, r: L3 D' f: n
tag_t part;* a+ }2 m9 A( s$ S( _7 L' P
UF_PART_load_status_t error_status;1 L. u) S B# L0 m6 d
basedir=getenv(env);3 e, ~7 ]+ `% u5 q Q; |* \+ K2 u
# N: A) h% {. m. m
strcpy(dir,basedir);$ X. D1 `! Q8 }& _$ O
strcat(dir,"\\roll\\J-J 2D.prt");; {+ o" o/ S8 r0 v, g& V5 U6 |
if(UF_PART_open(dir,&part,&error_status)!=0)+ z5 ?/ ?! c# K2 K4 |
{
+ G5 Y( J, _. a) b( K; O UF_free_string_array(error_status.n_parts,error_status.file_names);/ F+ a; `4 @5 {* z
UF_free(error_status.statuses);
- W3 W# P: Z) E8 i return(UF_UI_CB_CONTINUE_DIALOG);- {( _. O: g, v3 Z5 x
}
3 w) l( W* t, Z* l$ P8 \) h UF_free_string_array(error_status.n_parts,error_status.file_names);5 d: N$ _# p g. w
UF_free(error_status.statuses);
' [2 n j5 G9 h: z double arExpValue[2];7 H% x- S! V* {/ U2 p t4 t
UF_MODL_eval_exp("threeJ_a",&arExpValue[0]);5 K- a J1 I$ P
UF_MODL_eval_exp("threeJ_b",&arExpValue[1]);5 O; w& v6 C+ G% V5 R7 P8 i
. U Q/ K. f6 T7 B! |8 j UF_STYLER_item_value_type_t data_set;7 y$ m& n) T& Z! Q
data_set.item_attr=UF_STYLER_VALUE;* O. D Y# Y& p
data_set.item_id=ROLL_A; (此处报错)
# A! _+ {- X( p' E, f data_set.value.real=arExpValue[0];
5 b& o6 \. R1 z UF_STYLER_set_value(dialog_id,&data_set);( n0 K# B. F0 a2 C7 W1 z- X
UF_STYLER_free_value(&data_set);
/ o r' L( i: V% L5 ]% A, [ data_set.item_attr=UF_STYLER_VALUE;. ~! x0 R! h7 C0 ?9 c# n. L) W4 V: x
data_set.item_id=ROLL_B; (此处报错) # u. p& @+ h' K& Z0 x8 P& r {; s
data_set.value.real=arExpValue[1];$ }& a0 b$ N! S' E: y
UF_STYLER_set_value(dialog_id,&data_set);9 S1 H4 R1 u: [1 c; o7 V3 C+ w% U
UF_STYLER_free_value(&data_set);# b% E0 Q; @# V9 H, u
UF_terminate ();! F1 f6 B7 }9 Z- G& f$ t& T
/* Callback acknowledged, do not terminate dialog */4 ?) h( Z* ^3 c, A, i. N
return (UF_UI_CB_CONTINUE_DIALOG);
* {* E! Z3 l; G( l /* A return value of UF_UI_CB_EXIT_DIALOG will not be accepted */3 N9 O' h, K4 D3 T% d6 v& O2 R
/* for this callback type. You must continue dialog construction.*/
: M4 q$ \! c( A0 |8 h. N3 }: R}
! E; Y# R n0 f ?6 A5 f/ T4 n
: F6 S7 A+ y8 q
+ @+ X S* [1 o4 Y6 x7 q# D5 \9 J报错如下:
0 V% z: T- x" r' w. `2 yE:\roll\roll\threeJ.cpp(438) : error C2065: 'ROLL_A' : undeclared identifier+ j9 T5 O+ A. d) I; ^) K! L% r. J
E:\roll\roll\threeJ.cpp(438) : error C2440: '=' : cannot convert from 'int' to 'const char *'+ J. S. b: ~. e2 q( f
Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast; q2 q' A$ b* h4 I3 v8 I
E:\roll\roll\threeJ.cpp(444) : error C2065: 'ROLL_B' : undeclared identifier. j. E; s2 p8 p! W
E:\roll\roll\threeJ.cpp(444) : error C2440: '=' : cannot convert from 'int' to 'const char *'
7 H2 w: D3 X& L; m# P Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast" l. K t. ^* ^7 A0 Y) [
其中 ROLL 是文件夹名称
$ M9 u; d0 M4 d/ N) m: V# A" hJ-J 2D.prt 是部件名) j/ N% p2 ], N8 Y4 `2 W* {
threeJ_a( D. Y( \* L0 A( z7 r
threeJ_b
- U, ~7 \8 ^4 Q, W$ U6 ^是表达式的两个名称
2 e+ p/ Z- T9 w- B& f& E( B/ f; e. m6 H# U4 p5 ?& V: c7 {; ]- o$ U
ROLL_A
! I1 u/ T8 ~6 M9 ^; F6 IROLL_B
1 ^7 y( U4 Q* y& h8 A, ~& cA和B是UISTYLE的标识符
: }/ ]: {/ j. h1 Z! `) L7 k; D# b$ j9 W0 @: l+ ]+ k
请教,我这是一个初级的二次开发表达式,我只要定义两个参数化变量,请问我这里的constructor哪里出错?8 {1 b% Z6 p- M
我这也是参考一个例子编的,它的是五个变量。。 F4 A+ g/ a' t( k: b
* u' A8 ~; b8 U) r# \: F, ~请各位高手能帮我解决这个问题,感激不尽! |
|