- is
! n* T! B5 @2 z( c9 R - r:real; file:string;
7 x3 c4 h% W" ^3 ?& ^0 j3 K - do m# z6 A A F' o$ W/ E' H8 K& d/ G3 Z
- openConsole;5 L# X- t3 k$ f1 J: ~' h# S0 u: ?
7 c# }+ {$ i, U( m' z P( y) n- /*, W3 t7 k4 P! B
- file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",; V' v c( t j, l6 W: F+ u
- when is64BitApplication then 64 else 32,* c J- ], i0 N0 o* j+ T4 d. D) I
- "bit.dll");
# W7 ^( ?! `2 u; `3 S7 X4 z' J - */
. g1 u8 n& `) Y0 k4 `0 ~, P3 [ - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";- B5 O- P) l( h
- local j := loadLibrary(file);
" H5 J, N- X: f4 k - " w6 Z, A3 r" p4 c/ ]+ v- @$ H
- if j > 0 then
- ]& a" S1 e$ r9 x - print getLoadedLibrary(j)," is loaded.";2 n" O& y% g+ K; T s
- _% c7 k6 X) S1 b# u- ~- r := callLibrary(j, "calcSin", PI/6);1 z# E& E4 j+ U# C M3 q
- promptmessage(to_str("sin(PI/6) = ", r));$ e9 k" X/ J3 v' G
-
0 ^' a3 V8 b$ ]3 s4 ~' ]4 _ - local str:string;* ^$ w4 b; O1 b G" U# S% H
- str := "I'm OK!";
9 ^: {0 a$ l/ s4 L7 `' e4 b+ V - str := callLibrary(j,"resetStr",str);$ J) O" k7 J# q* L2 @( b
- promptmessage(str);5 m5 ?: h! e( r& ]! T1 P
-
/ j% L2 Z' g& Y/ D - callLibrary(j, "listAccess", Tablefile);
- {8 M& O# O9 G0 y6 l -
; C6 V- m" Y3 b0 A - print "Unloading: ", freeLibrary(j);) }/ x& k- J5 E- U/ k
- end;9 i/ y* b( e; {$ d( P$ @6 o- w
- end;
- k- j5 _- n% Y; s& V7 _
复制代码 |