|
int ROLL_constructor ( int dialog_id,
: {8 ^( O0 c5 }1 b- A2 |- p void * client_data,
; g; d4 x6 T2 N' J, E UF_STYLER_item_value_type_p_t callback_data)" }8 x" D) L2 A9 Q) P4 E# J
{# n; T( f. }5 D% r* e
/* Make sure User Function is available. */
$ d3 U% V! A1 Z char dir[100];
' c3 D5 s% Y" _" b2 ` l4 ] const char env[155]="ugII_USER_DIR";
' i, f( i. M' e4 x- }- i/ V char *basedir=NULL;
7 N9 L/ Q; Y c" E* |- x" r+ T7 b& ^+ _ tag_t part;
! h# F" y4 N' b% M9 l P* G UF_PART_load_status_t error_status;7 c3 D& z7 W; a( J$ g
basedir=getenv(env);
7 Y+ b" }" j, M9 d $ [" W1 F% V: T/ f/ o% Z
strcpy(dir,basedir);
% ~, B. D6 O3 n strcat(dir,"\\roll\\J-J 2D.prt");# ^" J2 s/ T6 L
if(UF_PART_open(dir,&part,&error_status)!=0)
; E) R/ b/ Z. X2 Z' g {
$ x) `; n; w# |$ [ UF_free_string_array(error_status.n_parts,error_status.file_names);: V+ u8 b7 l H) L: K
UF_free(error_status.statuses);# D% k% l W' w9 t# {9 f
return(UF_UI_CB_CONTINUE_DIALOG);
% d1 v; P# e* B }+ R$ x- _" F$ T# t
UF_free_string_array(error_status.n_parts,error_status.file_names);% {4 i4 K% h+ q( P
UF_free(error_status.statuses);
; h3 v" z! L# P2 w- K double arExpValue[2];
0 T- j3 O, t I: C4 W: p5 q UF_MODL_eval_exp("threeJ_a",&arExpValue[0]);, c2 U5 ~* C' |5 m* C
UF_MODL_eval_exp("threeJ_b",&arExpValue[1]);
) y) X# l- S! d7 W; [ % ~* U$ C8 g8 m0 i, J- {6 g
UF_STYLER_item_value_type_t data_set;
$ {& h- L, n9 a( {& }4 u data_set.item_attr=UF_STYLER_VALUE;
_5 e# \2 C* t% ~: O$ R4 ~ data_set.item_id=ROLL_A; (此处报错)
& m+ A9 B; Q1 I0 l data_set.value.real=arExpValue[0];6 k3 r* F7 u0 F o" u3 J, S7 Y+ n
UF_STYLER_set_value(dialog_id,&data_set);6 p" c& K& T( ^ A7 h* l9 c R
UF_STYLER_free_value(&data_set);3 x- C" f8 ~) B; v, O7 ~; x
data_set.item_attr=UF_STYLER_VALUE;- Q* a/ w3 _4 l4 w7 R, i* _
data_set.item_id=ROLL_B; (此处报错)
}: o$ C. l, t- Z2 x0 _) r data_set.value.real=arExpValue[1];
9 u; Z% Q4 V: k2 Q! ?% | UF_STYLER_set_value(dialog_id,&data_set);; h" s: ^( ^8 j0 T# }- z. |
UF_STYLER_free_value(&data_set);
) [$ Y/ x3 g- T3 ^* Q UF_terminate ();
4 I& J* R S1 U9 Y+ ~( ? /* Callback acknowledged, do not terminate dialog */* |: F6 E/ x' _6 K
return (UF_UI_CB_CONTINUE_DIALOG);
u# |3 p2 Z1 Z) M( P# C8 G7 X& P /* A return value of UF_UI_CB_EXIT_DIALOG will not be accepted */
) t6 ^! D: A! @4 t& c /* for this callback type. You must continue dialog construction.*/& z J3 h3 C4 ]+ r' f
}
# j0 b/ u6 P! J! J6 T( _9 y8 c9 ~5 g: }% N* x4 f) y* ?
- T }1 n5 G6 Y
报错如下:
$ a4 M2 j, L: [: fE:\roll\roll\threeJ.cpp(438) : error C2065: 'ROLL_A' : undeclared identifier& X8 k) H) i# p. O- t( z& @9 \
E:\roll\roll\threeJ.cpp(438) : error C2440: '=' : cannot convert from 'int' to 'const char *'. v# t& `( F5 O
Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
: K7 u4 `% f) b( Q4 t) iE:\roll\roll\threeJ.cpp(444) : error C2065: 'ROLL_B' : undeclared identifier, W# h& P9 u0 |. W; Q2 N) c
E:\roll\roll\threeJ.cpp(444) : error C2440: '=' : cannot convert from 'int' to 'const char *'
' ~+ _# X4 ?6 K ~- H3 J/ O; i Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast2 U" B) D: } n; D6 c0 i
其中 ROLL 是文件夹名称7 t; W' N. W! {, _$ q) l; @1 n
J-J 2D.prt 是部件名! H) y8 L8 A% B! I* E1 J
threeJ_a6 C8 J3 l9 r/ g8 _% n2 Z
threeJ_b, _# b4 S- e2 x5 O( N3 x- `/ a
是表达式的两个名称
/ H8 ^! I" V: I6 r
9 g& @) C0 q$ W/ I/ Y$ J/ C9 ?; GROLL_A
5 j+ w* m; J. r4 f& S2 PROLL_B& K3 q0 X, G6 l7 b, ^! V
A和B是UISTYLE的标识符
( v. m. H9 c3 q' S3 m/ y; V% ]4 g& f2 v, o. i2 t( e# s
请教,我这是一个初级的二次开发表达式,我只要定义两个参数化变量,请问我这里的constructor哪里出错?
/ Y+ ?7 a, W0 j- b% @2 e5 I* L我这也是参考一个例子编的,它的是五个变量。。
/ |: A J6 w5 N0 M5 P `7 D9 a9 _5 K3 g/ N
请各位高手能帮我解决这个问题,感激不尽! |
|