- is! G/ }- }7 F0 V/ o& |! o
- r:real; file:string;
7 Y1 }1 R5 K0 g! a - do% Q2 M# X- D- S7 i$ a4 x
- openConsole;
7 R; Z/ ~7 Q& j7 k
0 b) w! A! U" e$ Q* k9 }. E- /*
) |! K$ A' Z. T q - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",; T+ c& P n2 g" a0 b3 e
- when is64BitApplication then 64 else 32,
- V/ w, O7 l3 d: w - "bit.dll");
, c) W) W6 R1 E7 V" t m - */
# I" c& [' R0 a - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
! e1 l/ o2 |8 h1 R% F8 q7 m$ ]6 a - local j := loadLibrary(file);) `. y: J& x m* d. _* n" `. U
6 u% Y1 N+ O/ T( `8 c- if j > 0 then
- M8 ~; ?' m% S - print getLoadedLibrary(j)," is loaded.";
6 q" \0 Q! t5 I1 d& j7 p* _0 G! v - $ A Y! o/ C, D% h
- r := callLibrary(j, "calcSin", PI/6);5 q9 W5 T6 n5 ?, X- C$ G8 b
- promptmessage(to_str("sin(PI/6) = ", r));
! S+ h2 Q6 k: n -
( s9 {; s9 Y9 B' y - local str:string;; w M5 l* I# a( o
- str := "I'm OK!";
S$ f$ ~) t- {: o F, | - str := callLibrary(j,"resetStr",str);
) ], Q7 v& G2 q- E) a - promptmessage(str);
4 H7 n P0 d, R/ R s -
! A7 S F% i" l, P, Y) a' N - callLibrary(j, "listAccess", Tablefile);' a0 f8 g* ?8 f
- ) v' S5 F1 f4 e! F7 D$ @' m
- print "Unloading: ", freeLibrary(j);
Y2 ~ U8 S$ T% V! p6 ]3 M- n8 p - end;
* O3 j! O+ s, v: z - end;1 }2 O0 o8 A5 z
复制代码 |