- is
; P. l% Y, G, ^8 p: Z - r:real; file:string;
& j E: h3 I; @, z/ A! T5 `6 q1 C - do
' X) m2 z) A! j9 }+ L+ u% l - openConsole;
6 n/ r) ?* w N- Z6 _- b - ; N. A( V: M* K# Z1 A
- /*
& q( L" N& [3 Y3 \ - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
2 _# @9 I" W5 T: V0 z9 c - when is64BitApplication then 64 else 32,( p% M% Z3 V) ^; E* z& F
- "bit.dll");* b# p9 T) c i b5 n; Y
- */1 \) e7 ~2 x4 }
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
! V" k8 e! G8 q; i3 x - local j := loadLibrary(file);) W. c6 y7 l3 S! t: O* e; r
7 v, y7 g$ \- L5 j6 C- if j > 0 then
8 y+ ^" B7 A% \! z - print getLoadedLibrary(j)," is loaded.";
9 i" M! E* Q1 e& _9 l$ w. Z7 S* O
* b# m. h1 H2 Q8 y- r := callLibrary(j, "calcSin", PI/6);$ k9 a! I4 S9 J$ a3 E
- promptmessage(to_str("sin(PI/6) = ", r));
/ \# v8 V7 A, K; }/ J$ a7 }% T( } - ( i# Z- b# u: {' n
- local str:string;" k% M. f e. ^) R7 k' r
- str := "I'm OK!";
8 i- K7 W# C4 y2 W - str := callLibrary(j,"resetStr",str);+ L& E* r/ p" `; w6 K- {* w
- promptmessage(str);
! o; s# ]0 ~: C$ P -
: C4 b+ i. x$ ^: j; } n( m - callLibrary(j, "listAccess", Tablefile);" I$ L! b& T1 S# ], a1 q3 |2 p9 E( U
-
" V2 t- e K7 x; }* m" L6 @' x - print "Unloading: ", freeLibrary(j);
* j) |+ j. x J, P' N5 M - end;
0 Z: J9 q& Z2 m4 ]3 E - end;* x" M) ~5 |% e8 P" f' V1 ~: I
复制代码 |