- is
1 {: h% ^/ o% U4 H - r:real; file:string;
* @& N& | K& }( P8 z - do9 q5 S. Y- q: f( H* V5 ?/ V+ O
- openConsole;: C& L6 @2 P; a$ f4 E+ r
5 @/ \. m. ?- w- /*3 Q: [& H+ P, X* u0 m! L
- file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
* ~3 G' J6 U( k9 |8 j - when is64BitApplication then 64 else 32,
3 ~5 }6 v- w* C- Y( G) \; P) d$ Q% U - "bit.dll");
- H1 Y6 e+ \% K- S! A/ k8 A - */
2 g2 i; _; L+ n - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
+ g8 [: [4 I% b - local j := loadLibrary(file);
$ E6 V! c9 K" [2 |) B8 w: N1 g+ i - 1 p2 Z1 J- W. u
- if j > 0 then' u0 G/ R3 I, q) K$ G) a8 B( q
- print getLoadedLibrary(j)," is loaded.";( r6 ]; t1 T( g+ s6 J
- ) X. g- t5 T* e7 `
- r := callLibrary(j, "calcSin", PI/6);
: \6 |, D9 w9 f% s+ s) ^1 B) |+ u. \ - promptmessage(to_str("sin(PI/6) = ", r));
8 Y# F+ M: @& P* p: o* Y7 K" s - 6 l, K8 N" O* J5 X2 ]7 ]; P! @
- local str:string;
; s) _2 k$ d" h! Y y- r' Y - str := "I'm OK!";
" [8 Q" W& ^0 U; j( f. G - str := callLibrary(j,"resetStr",str);
$ R/ u2 e H; n: x( \# A - promptmessage(str);2 h9 ~/ O8 ?3 \
- 7 `1 n5 I; M( r' F% N& |2 b8 L
- callLibrary(j, "listAccess", Tablefile);
& N+ T% [" L- n. a, V W: {+ J! a -
8 A1 b# x" a; H3 d - print "Unloading: ", freeLibrary(j);
; X. h" E' X# V1 Y" b( v5 q - end;7 [% u- |. u7 K
- end;1 H; Q2 B( N- n$ |7 d# b8 S
复制代码 |