- is
' j% W% p( |% w2 U - r:real; file:string;
5 r, v7 \* ^! l# f) z - do
* z7 R) M% q2 ]! G4 ~ - openConsole;. Q7 |; |, V" t/ k/ i
) N. X! `2 e% ^: ^5 I5 H0 E- /*
7 F+ o5 m3 i; m$ Y/ U2 [1 U { - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
* l+ B/ d8 g; E5 f2 ?9 D - when is64BitApplication then 64 else 32,
6 M" F* l; ?* w1 M- a - "bit.dll");
! d8 } |8 j7 O& N4 x& A - */' x, i2 `6 O* G
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
2 h0 w* x$ y. R0 A1 x# y1 A - local j := loadLibrary(file);
: I& E$ T% k& |! Z9 B* { - 8 {7 `9 N, f6 A! S
- if j > 0 then; l A7 O2 [ j% D. d
- print getLoadedLibrary(j)," is loaded.";5 {$ a8 i" X4 e) a
- s: r1 R' F2 J0 C$ F
- r := callLibrary(j, "calcSin", PI/6);+ Q! I' |0 _5 L+ o7 q0 r9 {
- promptmessage(to_str("sin(PI/6) = ", r));
( k3 L, L* o; P- X7 M/ i -
" S4 e8 T+ k, i: i- p. p - local str:string;
! R2 x$ B5 V* u1 Q X) h6 q - str := "I'm OK!";* H# O9 \. e6 ? B l; K r7 {4 b4 O
- str := callLibrary(j,"resetStr",str);
6 i! b) R3 f5 b# Z# R8 K. b - promptmessage(str);7 t! D j7 K8 g6 e! S. K
-
9 g4 h$ d1 j$ G& w7 A0 ] - callLibrary(j, "listAccess", Tablefile);# }! A8 [, h) j* A( Y$ v
-
( A6 c0 U- l) {% y: z8 j9 w - print "Unloading: ", freeLibrary(j);! [* s9 m) ^1 O; K' K
- end;
0 t$ ?( Y+ _7 Y* B! Z - end;
" j+ y. E8 j! O
复制代码 |