- is
) B" z+ m4 W: M8 }! F, w - r:real; file:string;
K# b8 T2 G4 u0 N9 ?+ K* s - do7 y" p r+ k8 q. ?
- openConsole;5 o9 ?7 `9 r3 ^* U8 U
+ e4 V3 i! a4 `; T- /*) o- U; G5 q' M$ P
- file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
* G( Q0 w5 P- X T6 m% j - when is64BitApplication then 64 else 32,
$ m1 d& T7 R; W+ r - "bit.dll");1 G9 i/ G, s$ }. m3 R1 z# [8 u
- */- Y& L8 K9 p' u( m
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";# P' I1 r5 I2 u0 k% p9 X
- local j := loadLibrary(file);5 t. Z3 `4 `9 C- _6 F7 L
9 _! i7 Q" d" a- if j > 0 then& g* h3 b0 j! P; ^) \% r( O
- print getLoadedLibrary(j)," is loaded.";
$ m& K6 U2 {+ y8 r7 u# d - 5 t! g5 }. ?$ p# W
- r := callLibrary(j, "calcSin", PI/6);' m2 G) Z0 W1 R1 K, ~. u
- promptmessage(to_str("sin(PI/6) = ", r));/ B5 h' s" C; w
-
1 y/ R8 T) Z% j - local str:string;4 r( S% i# G7 |) [; A
- str := "I'm OK!";3 @1 n4 v o; A, o* |2 k& n6 \3 V
- str := callLibrary(j,"resetStr",str);3 d. g' m1 C/ K) }: \3 C9 M, t
- promptmessage(str);6 J6 i. T1 x. E" n1 E: q
- ) Q/ J' ~# p' G( e' {, r( c: G
- callLibrary(j, "listAccess", Tablefile);
" }. |3 h$ K3 v/ n8 L5 f P - 8 H/ ?: ^2 X6 k& a& B% m
- print "Unloading: ", freeLibrary(j);
# l! K& K# @$ D - end;
* y2 R: u! l7 I+ e8 P& H - end;6 Q3 W* J+ o8 g1 q6 @8 {
复制代码 |