- is1 ~7 Z* ^: C# J, c+ o T
- r:real; file:string;! O& f/ c: f2 j9 A7 m8 P# @
- do
( @" M1 g2 M" ~) I& W9 v3 X+ P# d - openConsole;: S: G% l% U8 ^- Q7 t
- 2 d3 f$ B" A/ j: E. B
- /*
" O% l" G* Q/ G8 u) O - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
$ t# I5 U, K }/ E+ s* D- D( n G: ? - when is64BitApplication then 64 else 32,
9 m- H# C$ X; S6 H' U - "bit.dll");8 {; V5 O4 u4 q7 E) S% U
- */* D, V& ?( c: m- `7 F: Y; [
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
6 V1 U" t/ N) \# O* C: z$ O. h# R - local j := loadLibrary(file);: ~) a0 A9 l4 P. ~+ q& S# \
% _4 ~) i# g. f% p1 j- if j > 0 then' M+ o% |3 U6 f$ b
- print getLoadedLibrary(j)," is loaded.";
+ Z+ y% u- m) f9 B$ v7 X
8 Y, ?& c1 q! R( J2 W: o$ [+ p- r := callLibrary(j, "calcSin", PI/6);- G' q5 y. X! y) o' k, X' U
- promptmessage(to_str("sin(PI/6) = ", r));
D% S0 u7 m: o8 j% q' N F$ N - / x2 m! o3 X) v1 G) i
- local str:string;& M( G4 J# c' O& f
- str := "I'm OK!";2 e# @! v9 ~/ j3 @7 o+ D U- W
- str := callLibrary(j,"resetStr",str);7 K6 c1 }& X1 E/ W9 V% A
- promptmessage(str);
. s" K8 W/ v/ _" ` -
) P' N4 f" E! J1 v, G) @3 e - callLibrary(j, "listAccess", Tablefile);; L. F, _1 q9 O5 e1 M! P, T* ^
-
; E: b9 ?4 g# F" H1 v/ z) D - print "Unloading: ", freeLibrary(j);2 }* [; @/ }6 {9 Q5 N2 ?; d
- end;
* a2 C- M' X3 i' ^0 c - end;
9 F. e- h8 N8 J6 u, ?+ @6 e
复制代码 |