- is
& A9 Z0 R* W" z9 }9 K7 ? - r:real; file:string;
1 `9 ]5 {9 m! @1 l \( i - do
; J+ v- {& z* t& w% Q- Y, m3 i1 A - openConsole;! D6 m# y5 v5 i" b- l) `
F9 P& f$ z( W9 d6 l% C- /*+ L& x8 H/ j; W5 M, G
- file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
) F) R- ~& y; @3 D - when is64BitApplication then 64 else 32,
* ~) L8 n) f0 I g e3 P8 @ - "bit.dll");0 A, \& E; z3 V) z3 d# S" X
- */# L D; f1 j; t2 {: E
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";0 B3 T/ C! M! j# N- |
- local j := loadLibrary(file);
2 J4 \2 L* Z1 `2 c# N - 2 X) E: n3 F; V+ h% H& _5 m+ [$ `
- if j > 0 then
: i, U M" ~, V% o - print getLoadedLibrary(j)," is loaded.";/ N- ^8 p# K/ X+ f2 V5 S
- 2 `8 f# B& S& r+ X2 ^( i
- r := callLibrary(j, "calcSin", PI/6);" e) {9 w3 L8 |. C6 B
- promptmessage(to_str("sin(PI/6) = ", r));' J, I) [" D. c. ?; R
-
( J" n& d# w- @: s - local str:string;: {2 d1 S0 `7 ]
- str := "I'm OK!";$ p6 A; c% W0 K1 N" f
- str := callLibrary(j,"resetStr",str);; ?3 |0 J& y3 Y, o3 l8 c. V% w
- promptmessage(str);2 u- N; _/ Y- P5 z" Z O
-
0 U: B! l% ?7 v* V# N - callLibrary(j, "listAccess", Tablefile);. t% A8 S4 G- O; E9 R7 W
-
( F- q" Q1 h/ O4 G# ], g' Z - print "Unloading: ", freeLibrary(j);
) ~5 i: m& b2 [& g0 b# T - end;9 N# [: y8 x" J- X2 Q7 O
- end;9 O! a6 h O1 t: T8 ~( w y( b
复制代码 |