- is4 Z4 W1 Q, b- Z: ]
- r:real; file:string;
( g5 @) \5 L+ Q% v - do3 @% y U4 H+ [ r
- openConsole;
) @. i1 t! K" i5 Z - , J4 e: s* E% @" M
- /*7 W0 e; k; U0 W+ ~) `
- file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",6 y o) `/ T% [
- when is64BitApplication then 64 else 32,
8 m, T, e& d, V% i! x8 \" r8 ~7 \ - "bit.dll");2 d4 R; T7 Q5 m) ^# l
- */
* p [; J$ d- S# C0 v: ^ - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";1 e, P% g- |/ q( F- V( l
- local j := loadLibrary(file);9 O* h& q; q% N6 V/ \2 H
- . A5 U7 V+ Q$ T; _
- if j > 0 then
]; R* y) E; G) A1 h - print getLoadedLibrary(j)," is loaded.";# f" v$ o/ _- v7 w, @' r7 O
, M& ]+ k; K) D" V- r := callLibrary(j, "calcSin", PI/6);
% a! l* A' {3 M0 Q0 K! ]' _ - promptmessage(to_str("sin(PI/6) = ", r));
4 z" V" `0 J- r) W# V - $ A0 E9 Y1 S/ l( u
- local str:string;
( N8 l" t2 G& B( @2 [2 u - str := "I'm OK!";
' X0 {6 F0 X6 O' b; T! p" v - str := callLibrary(j,"resetStr",str);& E0 [; o) R# q$ r3 ]' |
- promptmessage(str);
3 x P. m9 w# h/ G; V& J -
3 i5 a |* S" Z" H& l; v4 ~4 y3 U - callLibrary(j, "listAccess", Tablefile);7 T O/ B3 @2 M7 @9 A$ b6 o
- ' _$ @) l7 X1 m$ s: K& o
- print "Unloading: ", freeLibrary(j);1 ~$ ~1 t5 V/ u* d* t3 g; F
- end;
. e, w4 z$ q8 }& n+ h: z - end; Z: ^: ^/ o" D+ |1 ^9 `( U4 [2 A
复制代码 |