- is
: k' X, `; i( v- b1 o; w - r:real; file:string;2 \. o' t2 h2 ?
- do
( u0 {( B! A- P; [* G* P; ` - openConsole;
" e5 i+ }' q8 U7 O. v' l( k - ; ?2 y! h1 o0 h* o& E
- /*
% v# K1 t- w! c - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf", ~+ t! u v9 m, G, W
- when is64BitApplication then 64 else 32,
0 b4 e" o; ^, T: Q7 Y$ C - "bit.dll");
- \ J( o8 B0 f5 y( K - */! W4 p" E% t8 T( b2 E9 p& Y
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";. |/ E; u V0 u0 f* G. @4 V
- local j := loadLibrary(file);
) _2 |+ h6 E/ D; w) B
7 m: |) O: g+ J) I9 ]- if j > 0 then
. e! B6 A) z; j1 k3 c - print getLoadedLibrary(j)," is loaded.";
% m! u1 t+ G" m8 A% r9 B- E+ Y5 x - - d2 i0 B$ @) J
- r := callLibrary(j, "calcSin", PI/6);
% @5 B I' m( g" ~1 S - promptmessage(to_str("sin(PI/6) = ", r));
. ?* h' z3 v% D1 k4 e. z - ; A- E5 A. ?; v" I" m
- local str:string;
- x$ r7 F7 P' D1 [4 ], J8 l7 N - str := "I'm OK!";$ E% b1 j2 N' ?
- str := callLibrary(j,"resetStr",str);
" K) j; c7 A) x9 {. m# L - promptmessage(str);& A6 s, s* A) @0 B9 K- Y
- . Q% k; P3 m! m$ x
- callLibrary(j, "listAccess", Tablefile);+ X$ n7 V' }4 m0 z% Y# U+ L
- + g) ~8 z5 @( c4 E) o# M
- print "Unloading: ", freeLibrary(j);
1 Q, C$ M8 O. O8 e* T - end;
5 W7 _. N( l* V+ D: r$ { - end;! B7 z' [" d, ]! V+ H/ H7 M: o
复制代码 |