- is
0 W2 [+ X3 S$ G/ P - r:real; file:string;
1 B" s6 q( j, h( f: E - do" P1 p2 a) q4 J# O0 l. [0 v: p0 e
- openConsole;
& a& d0 ^% s* ~- K7 M
; D: X" J, B5 B4 Z, d$ o- M# G- /*: i) [. n. {) P
- file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
$ }" D; h9 V' ]$ z0 v2 f - when is64BitApplication then 64 else 32,
. ~5 t3 y" v5 \1 ] - "bit.dll");% a5 G; e# g. a5 y" T
- */
+ Y: _8 z/ u. _ - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";. G9 Q; |% E7 ?, c+ ~
- local j := loadLibrary(file);! X2 i6 Y+ q3 f5 @( U& |. b9 y
- . B, `, C$ T- t8 m4 O; T
- if j > 0 then
" ], W) m- _* k X1 |. p. B - print getLoadedLibrary(j)," is loaded.";
' K E0 J e. e
4 @3 X3 {7 j1 f; u6 d6 h- r := callLibrary(j, "calcSin", PI/6);! s4 V% G$ `/ s4 ^, c
- promptmessage(to_str("sin(PI/6) = ", r));) _. i) k9 I" A4 c8 F
-
3 S$ `( Y8 y+ n; }' H5 H - local str:string;/ H/ d4 z l" ^. X0 e( A5 c9 A
- str := "I'm OK!";; l* W" F( q; ]' T
- str := callLibrary(j,"resetStr",str);. O9 X' H- c( \+ R' R
- promptmessage(str);1 K" G; q- |' \7 `2 J
- 2 ~) r0 w* M2 t2 Q u* z
- callLibrary(j, "listAccess", Tablefile);
+ N5 I- x' s6 r3 F% y - , F6 _+ l- u$ J) ~1 U% Q# u- z- I. E7 x
- print "Unloading: ", freeLibrary(j);* g% ^3 o: t n/ f2 v. h
- end;
- B, N" G, n/ N6 n! d6 J3 G - end;
. @7 ~! w; H* j
复制代码 |