- is d4 e' l% ]& C- z O. x2 [' @
- r:real; file:string;
, t+ {: K9 z$ P5 d - do
$ {# C- ?! w, ~ v7 A - openConsole;
7 k+ D: E5 J) E+ V2 p, B
- N4 b( q/ R# ^- /*+ Z$ h9 d( g& g A7 b, Q) Q
- file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
0 C& y/ _" c, B8 J6 {, {9 s) t - when is64BitApplication then 64 else 32,+ k) \7 I Y. n- T
- "bit.dll");2 A! p* y* l4 X$ O( I# u3 ^
- */
5 x. \" ]3 I6 m7 L) M% x - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";6 M$ n% a( H+ d L% K
- local j := loadLibrary(file);
1 }9 K4 c, \, w% M% F* Q - , Y( d3 c! |; c2 S
- if j > 0 then2 ], a- I k7 g5 z- w
- print getLoadedLibrary(j)," is loaded.";
3 q9 c/ Y6 J- g( [ - - n" v \- f, U, Y. K
- r := callLibrary(j, "calcSin", PI/6);5 o1 A- C4 `! w% E) O: D0 {7 k) y
- promptmessage(to_str("sin(PI/6) = ", r));
9 M u& X: G: k2 Z; Q -
4 ~$ G; Y1 M U: C$ B - local str:string;/ k; c2 Q# f+ f. p8 ?, s3 f k
- str := "I'm OK!";
( j6 h% J5 {( b - str := callLibrary(j,"resetStr",str);- p8 m5 G) [ V5 r0 X. y
- promptmessage(str); W" L9 w: s4 V3 r3 s* E- N
-
$ U% B1 ~) J4 B+ \ - callLibrary(j, "listAccess", Tablefile);
/ X/ Z0 v7 t2 W' C& t, o+ v4 R -
+ h7 j4 i. @* y% s, k( J - print "Unloading: ", freeLibrary(j);
5 f1 h, G ~0 z S& ~: { - end;
, n4 R5 F% h2 E" G4 W! J - end;
) R/ I! ^: v1 L) m$ G8 {
复制代码 |