- is
7 t% f. F* D- X - r:real; file:string;
0 L7 A) I$ z! `, f* N* o4 m - do8 Q# i7 P8 \7 T
- openConsole;
H" t* G5 x# W# q! u" E7 |- a - & ?) [) K' p( m4 g/ u, z' e
- /*
8 V' }, u3 K6 l/ G7 J6 H: C# `* } - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",9 m1 i4 \+ L+ v3 A, W6 [" b
- when is64BitApplication then 64 else 32,
$ d, f3 a* h X1 s - "bit.dll");
# d( L- d ]/ v4 w# I* e, Z - */( E3 r2 ?, D3 b1 K& _6 V) e
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";" Y- t$ u7 T1 l* B z( Q1 G# h
- local j := loadLibrary(file);7 y0 z3 {; w$ p# [. @
+ c5 B3 s4 i0 K, i c: h4 `2 a- if j > 0 then
- s1 R4 c; u, W8 U: ~: Y5 ~+ q - print getLoadedLibrary(j)," is loaded.";* t" I& V1 a) w; ~
( r t/ |) n3 e' _3 h- H/ W- r := callLibrary(j, "calcSin", PI/6);
$ e- g6 B( [! z: T2 ^6 I) m, a9 } - promptmessage(to_str("sin(PI/6) = ", r));
6 Q( X! }' U, p4 N3 ]. \2 l5 X8 { -
" [1 I. _3 U6 b/ ` - local str:string;5 s, n2 X/ c' t% e4 U
- str := "I'm OK!";
/ y' v; j1 [9 i% B - str := callLibrary(j,"resetStr",str);
3 U8 v! O* t5 s5 z8 n4 Q4 i% g - promptmessage(str);2 j: B2 ], V; \0 X
-
9 u8 p2 z& L- D% K: _ - callLibrary(j, "listAccess", Tablefile);
+ S. Z8 C( y( D O0 x -
) Q. x, T1 ?7 N9 t1 G9 r - print "Unloading: ", freeLibrary(j);
9 Q, J- R8 N* I - end;2 Z8 ?' `* |% ]9 W
- end;
+ a: c/ d- k6 V& t. \' c
复制代码 |