- is
8 {( j3 ?+ O5 S - r:real; file:string;
: H9 S& } M9 l" E4 M% c - do
& M2 P* }' g! q7 F+ O - openConsole;
2 T3 E. L6 ~3 y% ~6 u e
4 M6 @+ b1 _2 C3 E2 i- /*3 \, _6 p5 ^5 d- x
- file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",0 I. W* T( v) k1 R5 H+ s( {8 f0 m
- when is64BitApplication then 64 else 32,
: z' } S* A" x, M. f - "bit.dll");7 b, ?4 X+ |/ T4 V9 J5 Q
- */
8 w y. r$ m( Y+ R - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";* m9 ~/ e. h3 u0 U5 _* I ^% u. \ \! H
- local j := loadLibrary(file);
7 Z2 b& Z: O! N9 z# A! r2 T - 1 q; H+ y/ H4 P7 f/ u6 Q- A$ p
- if j > 0 then
6 m, U3 d' A- @: h - print getLoadedLibrary(j)," is loaded.";: C, N) I6 d+ o$ E
- ' q5 `5 [( K# r7 [/ M
- r := callLibrary(j, "calcSin", PI/6); Y/ N8 j6 F& A1 |$ M
- promptmessage(to_str("sin(PI/6) = ", r));2 `" Q- M& U, `: a" n( a6 l
-
4 w0 V% z) Y& D; z$ T - local str:string;
K. Y. n# s# |" m2 b& I1 a - str := "I'm OK!";7 p. P# a$ R( f6 v" j5 e! f5 G" V9 Q
- str := callLibrary(j,"resetStr",str);, R; o' \2 _' R. J0 Z
- promptmessage(str);
) n. X2 N( R' Q7 i `( \3 B -
2 `1 y, C& T- _2 b* ]4 ] - callLibrary(j, "listAccess", Tablefile);
, L; y+ W' j3 @& U -
+ V3 B5 ^! n# c/ Y( |5 Z% l - print "Unloading: ", freeLibrary(j);
9 Y/ @7 R5 ?' g: l8 B$ p2 G - end;
1 O& F4 [* q+ @$ S - end;1 Y2 C) t2 R& i; g; N' Q
复制代码 |