- is
$ n; }1 o! S7 b& s2 k* Z) p - r:real; file:string;
1 {) s$ z4 p& L, i8 G R- Q - do
) s8 n7 G2 H+ P0 H/ j* K# q - openConsole;4 E: Z( O, ^) m" a+ _5 `2 Q
; t6 f- X" V4 U3 g% T- /*
6 N$ Q F" @0 m3 w% R - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",# Q" z$ }+ W/ r2 F
- when is64BitApplication then 64 else 32,3 `, Q. \1 l! j! D
- "bit.dll");+ E* F0 h$ A* L- {9 a/ `# [# F9 b
- */+ a& |4 N& _) H7 W8 O
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";' ?: N8 j- F! h l3 e7 i( P' Q
- local j := loadLibrary(file);
$ w* @5 ~* @# J - 6 O$ y- ~! y% F' X, |
- if j > 0 then
+ F+ ~8 x$ \' d: Z4 S+ f" l3 S - print getLoadedLibrary(j)," is loaded.";
7 ^# S8 ^& s2 _$ t - * J$ l, \+ ~ X3 E
- r := callLibrary(j, "calcSin", PI/6);
9 b$ Z. d+ k ]) t- ^ - promptmessage(to_str("sin(PI/6) = ", r));; m6 K- |: `/ K
- . n% I6 ~2 f; R. Y+ P
- local str:string;0 g6 g; C1 u, Y8 M. k s% \
- str := "I'm OK!";
' u! t, u6 p9 p% q4 n - str := callLibrary(j,"resetStr",str);
- `/ b# X. F4 e! H, a. p - promptmessage(str);
& M" g9 z4 `/ U j6 _ -
3 V! A- ~ q4 | - callLibrary(j, "listAccess", Tablefile);
, f I7 \$ \0 B - : E8 x( m3 _2 M5 S: B7 n% H
- print "Unloading: ", freeLibrary(j);5 U K4 j/ x0 Z' a3 T$ @
- end;5 ?$ c" K: T/ ^+ Q/ e5 \
- end;
C) ^1 I5 A" \1 B. x1 k
复制代码 |