- is1 X- J) ?6 b* }1 X# t" j
- r:real; file:string;
. e' d7 k1 U3 b! c - do
! a5 i4 L5 m- V) I9 r# M - openConsole;8 m' w4 q1 ]% Q! |5 A6 {: n
- 6 y- R, ~* s0 p, ]) x
- /*
( H9 X( f+ H: s) D% ?! a - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",8 [$ \: A: S: u8 L& Q# t
- when is64BitApplication then 64 else 32,
. p: F! F% G6 ^/ h8 U ^4 U+ R% I - "bit.dll");9 [9 K2 S0 ^6 M/ u: @$ [
- */
. a/ I( @9 r4 y8 X3 J, Y2 O - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";) S+ D1 Q6 p+ m
- local j := loadLibrary(file);
: y" G3 B+ f/ x0 E% w - + v7 k- F: J; {5 }: q$ K6 A* @3 o
- if j > 0 then
; O; F! t$ ~9 d: s% S! w - print getLoadedLibrary(j)," is loaded.";
! Q$ {8 i/ s1 T) ?5 f& f& Y, C( u - 2 F# E2 M; I3 |, v3 _' Q Y
- r := callLibrary(j, "calcSin", PI/6);
6 ~1 H) o5 B+ b# P. o, \1 ^# O! {4 H - promptmessage(to_str("sin(PI/6) = ", r));1 N% [) b4 I3 ~: ~
-
h. ?1 D# e" ?; x+ Y$ p - local str:string; F; j5 v& H1 N0 q- E: R3 H
- str := "I'm OK!";. e' j2 Z$ l" a+ f$ C- E1 y! h* {
- str := callLibrary(j,"resetStr",str);
9 j0 S r( h" g. g! |8 V* ~ - promptmessage(str);0 g8 ]; ]* m8 |
-
9 L( a/ |+ }3 t - callLibrary(j, "listAccess", Tablefile);6 P) d) v' a9 Q) l
- / m# l5 D3 `' L0 x
- print "Unloading: ", freeLibrary(j);5 i% e8 H6 N4 A: j2 [
- end;8 ^( b! V) [- _8 {* y6 F. z# P
- end;/ n8 U" U$ t6 J% v, N6 Z$ ^
复制代码 |