- is
. g5 d$ R0 f9 U/ C, v: k - r:real; file:string;- |+ U: S k% Q2 ?0 t1 m
- do
; p/ b4 J% p% H9 q% t J - openConsole;- `+ M% @' L1 n" w
0 m' Q, P3 {$ z1 h+ y) n- /*
4 q/ u9 A0 G J$ k! d# {) K& I - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
: G# k# j5 w% F - when is64BitApplication then 64 else 32,
. N8 H* s: a- E! H$ [5 g - "bit.dll");
. S% M/ g+ I/ f+ n& G: ~ - */
" v- M2 k4 G# }# P" n - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";: t0 u' e; g% Q( W& S/ F! t4 s' Q
- local j := loadLibrary(file);! ^* L x2 P" m# y3 j% I, q! Q
5 ^" ~% h9 M1 E- if j > 0 then& w# V& K. u. x( U
- print getLoadedLibrary(j)," is loaded.";( H2 x5 C. p' y C
- , a, g) \$ {) s! s( {( l
- r := callLibrary(j, "calcSin", PI/6);9 Q8 N+ ^6 {* ~! d% X# O
- promptmessage(to_str("sin(PI/6) = ", r));
) Q9 l d8 o- ]: H; R# E8 e - 2 a) Q$ G8 L& X3 H4 i
- local str:string;4 W8 ^" V, k# h
- str := "I'm OK!";5 V& E5 u7 [2 ?! t1 v: d
- str := callLibrary(j,"resetStr",str);
$ }4 n4 i% ?1 u D' O% i* p - promptmessage(str);
) `( u+ t; J# @& f - + M x, i) ]) e) _* V) q9 W9 V
- callLibrary(j, "listAccess", Tablefile);
9 r5 X0 x# \. f' A6 `% g* R/ h% | -
& ?6 G: _5 e1 B5 ? - print "Unloading: ", freeLibrary(j);1 ]) x( s: k4 l
- end;) G3 U7 E9 I$ g$ K; e- {% t
- end;
. b# r {9 ~% p$ P5 D
复制代码 |