- is
0 r0 }1 Z/ i. k0 |/ W) A; B - r:real; file:string;5 N I; _8 L1 I! M7 w$ J
- do
+ w3 ]3 q3 n8 S0 F7 ] - openConsole;. g7 s! I) k3 o3 e# G4 ^- j2 H
7 H7 N; L6 Q$ u- /*8 p* Z! p% D( Q
- file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
; z6 ~- ^& R; V' `0 A - when is64BitApplication then 64 else 32,
# U- l( u. O3 O% C3 i7 g - "bit.dll");' V% F/ E M, S3 `3 T
- */7 X% ]: p+ S, R7 N+ l
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";$ [2 Q/ L6 X" R2 W
- local j := loadLibrary(file);( D6 |" @+ s. n! }3 N; a
9 [. q# i5 _, ^- if j > 0 then
2 F( `. H- V9 q3 v. J" N% @: b - print getLoadedLibrary(j)," is loaded.";
- _. {% e0 T0 x- F: w P
: C% f/ ^8 x ]/ z5 V; f- r := callLibrary(j, "calcSin", PI/6);. m" f3 b# ^: `% l- x' ^
- promptmessage(to_str("sin(PI/6) = ", r));
8 J: C; i; L2 X5 m( p D% g - , D) `7 ?# L2 ^+ O6 q; |
- local str:string;- W7 [+ ^ x& l/ }
- str := "I'm OK!";: e! Q/ y, f6 k$ g
- str := callLibrary(j,"resetStr",str);$ l4 D( t8 x2 X, u- x* F9 m) L6 d- [
- promptmessage(str);* ^. y0 c3 Y0 H( g$ X T0 H7 B
- & \( N5 f9 U+ s# M% t) E0 E
- callLibrary(j, "listAccess", Tablefile);
. L% {5 o- j. Z2 H+ U) D# R0 } - ; A9 ~( U- t* \
- print "Unloading: ", freeLibrary(j);+ H f% n! v! t7 z+ |
- end;9 g/ u4 b8 F. I: S& |
- end;4 Q' C( u7 \/ I* y3 c
复制代码 |