|
int ROLL_constructor ( int dialog_id,) j! m" m- u& d1 s5 \1 p# r
void * client_data,. `6 _/ Z$ H( }
UF_STYLER_item_value_type_p_t callback_data)
- x$ D6 l* \9 y7 b; {6 y{1 T" \8 g% ] D2 p0 p
/* Make sure User Function is available. */ 4 f1 J9 e* M: ^" ?" S8 J9 h
char dir[100];
/ z# \1 P7 G( v, J6 D9 ? const char env[155]="ugII_USER_DIR";" E; Q; v* E/ Q
char *basedir=NULL;
3 u' i( T: p6 ?8 } M9 Z! M6 S2 j( G tag_t part;
7 \ A: y6 m3 G8 [# { UF_PART_load_status_t error_status;
0 X* o. v7 e9 G$ c1 r basedir=getenv(env);
: n2 E) C5 l$ ?9 |! Y
( e$ F/ f1 l+ u6 Y strcpy(dir,basedir);
4 r( ]8 M2 n3 n- Q ~ strcat(dir,"\\roll\\J-J 2D.prt");
+ S/ ?" i/ k- c8 l% ]5 ?" u2 c if(UF_PART_open(dir,&part,&error_status)!=0); _: C4 |( `- b6 v& [. j0 P
{
' k' |7 g1 u. f F$ d1 ^ UF_free_string_array(error_status.n_parts,error_status.file_names);% a+ S. |6 f8 _5 L4 ?5 ?5 j$ i
UF_free(error_status.statuses);9 Y- s; \9 _% d3 G7 K- H8 B, R/ D
return(UF_UI_CB_CONTINUE_DIALOG);: }1 i- H% q, s r9 S
}% q# V1 l- e7 q$ r y
UF_free_string_array(error_status.n_parts,error_status.file_names);+ w( v* \5 x* [7 `# i
UF_free(error_status.statuses);
: |# u5 z) ~! |# Z7 W, D; Q double arExpValue[2];
6 f( ^, J; b! d UF_MODL_eval_exp("threeJ_a",&arExpValue[0]);5 l! R9 d5 g7 \+ o
UF_MODL_eval_exp("threeJ_b",&arExpValue[1]);
8 b0 U9 Z, L6 M$ V% D8 k$ W5 h+ g; l / B1 n& E& ]2 m
UF_STYLER_item_value_type_t data_set;
0 i1 D/ e4 d1 B& I4 S- Z* w data_set.item_attr=UF_STYLER_VALUE;! F0 Q6 V# v; j! [
data_set.item_id=ROLL_A; (此处报错)
! y3 f- S) _9 m: l5 m data_set.value.real=arExpValue[0];
4 R: }+ I. X+ ^# A& t( X UF_STYLER_set_value(dialog_id,&data_set);
+ y) \, v& U- p) T: G8 F+ ~ UF_STYLER_free_value(&data_set);/ ~( W$ @1 k7 H
data_set.item_attr=UF_STYLER_VALUE;- k, l( c% t3 s/ P8 K- Y
data_set.item_id=ROLL_B; (此处报错)
- p/ G0 z$ G) t' t' q data_set.value.real=arExpValue[1];
* c- S, }- e# A/ J% Z UF_STYLER_set_value(dialog_id,&data_set);
7 X+ M f' ^1 R3 t2 e UF_STYLER_free_value(&data_set);; o7 N7 t5 X0 m$ T, D
UF_terminate ();
, e- c3 I* N+ ]7 `* G; B, A$ } /* Callback acknowledged, do not terminate dialog */
0 f8 e4 v: {6 ] b$ ]; J1 ^) c' g return (UF_UI_CB_CONTINUE_DIALOG);
0 o, R: R/ i I# r /* A return value of UF_UI_CB_EXIT_DIALOG will not be accepted */
3 j/ W0 |. y: F' w" {9 p' K /* for this callback type. You must continue dialog construction.*/2 t, A7 T* u% G1 R4 \3 ]- f' ]- g
}
1 r) h, O6 e. C( H5 A* z! p" s# J& h" \8 v
- n- p0 E2 E5 y' |7 Q( B
报错如下:
. e- D$ D+ T& V, d( wE:\roll\roll\threeJ.cpp(438) : error C2065: 'ROLL_A' : undeclared identifier2 {. @6 k6 q$ w* \( k! H
E:\roll\roll\threeJ.cpp(438) : error C2440: '=' : cannot convert from 'int' to 'const char *'
1 n1 r5 }5 g' l* [2 y Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast; M( U+ b2 E/ t( b
E:\roll\roll\threeJ.cpp(444) : error C2065: 'ROLL_B' : undeclared identifier" w' o/ ]; u: r6 r7 q% q
E:\roll\roll\threeJ.cpp(444) : error C2440: '=' : cannot convert from 'int' to 'const char *'. k& y D/ G. f: w
Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
- P; i8 A& J: t' ?其中 ROLL 是文件夹名称
( g! i! G7 x/ o. RJ-J 2D.prt 是部件名
/ Z) j/ C" c) a$ y. {threeJ_a
$ K$ D# E+ U. @" t" p* TthreeJ_b; N+ D1 [7 ]" ]+ F- D9 t- W1 R
是表达式的两个名称4 X9 C2 J. b1 y j2 r
, ]4 m+ X" T2 D6 S1 F
ROLL_A! Q; ` r+ t Q
ROLL_B& N: [; ~; r6 ]) Z0 E& K* }
A和B是UISTYLE的标识符
, A4 i* g0 |" k+ b+ V, Q2 X d# o6 e) S; {* }& e1 a
请教,我这是一个初级的二次开发表达式,我只要定义两个参数化变量,请问我这里的constructor哪里出错?/ j6 O, T, a5 @# e, e6 j6 Z3 k( e4 g
我这也是参考一个例子编的,它的是五个变量。。
3 L3 N; k; m6 u/ n4 q) t, @& ]& K/ q B& {) e
请各位高手能帮我解决这个问题,感激不尽! |
|