- is
9 r. L0 A! y, E% H5 u" ] - r:real; file:string;8 u y8 e: R: ?/ o% v
- do
4 `& j' ?. h0 m. Q" l6 p7 o - openConsole;
0 j3 S* p( y8 a9 k9 j. \
1 i# b, s' B2 p% d4 \3 P* `" j- /*
# ^6 f; `! K, U* m - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",% q# A0 E1 N9 U: V
- when is64BitApplication then 64 else 32,0 b$ R$ |- ~" W: h% r
- "bit.dll");
t8 A) ~. H9 ^5 i( Q+ B+ C) s - */
; p2 m' l7 j3 Z9 s( K5 f - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
" B' K x6 t9 a; b- \+ p+ W - local j := loadLibrary(file);" T3 S( N3 j+ G
- ( u1 }8 j$ p; T( F3 u$ W4 j9 a
- if j > 0 then
( }8 }9 H3 @! B - print getLoadedLibrary(j)," is loaded.";
6 b% u0 {" G- P0 G3 K6 g0 t6 @4 p - . N9 m9 p6 W* N2 p! O
- r := callLibrary(j, "calcSin", PI/6);, l6 |4 V( K9 Q3 b
- promptmessage(to_str("sin(PI/6) = ", r));
6 y: h* e! a9 ^5 m \& j - * q6 ?/ S1 } ~( F$ f. H
- local str:string;
6 u _, ?) ? U# F - str := "I'm OK!";
6 ~6 T# O4 h ~% j, ^$ ^ - str := callLibrary(j,"resetStr",str);
% V" n+ s {- R* m! U5 R - promptmessage(str);4 U% W3 J+ P3 ], ~' f6 @
-
8 W; f8 K7 i; a" T N' k- i - callLibrary(j, "listAccess", Tablefile);, W/ Q) J5 M; c2 S+ v
- & P2 |4 Y& h6 h* W
- print "Unloading: ", freeLibrary(j);) O' S% X/ C9 Y0 w7 h
- end;
; }/ [7 L! f$ M - end;2 A C$ o! Q4 U" {: L% m
复制代码 |