- is
( y8 z A" w, z+ ~ - r:real; file:string;
8 s V9 y$ k( t5 B% d - do0 V) d$ E3 \0 _ J3 C1 x; j/ ^" Q( u
- openConsole;5 m" {8 G: B% f
! w2 r! B! {5 l2 w& M: c) |) A- /*
( _* F4 x; r) |0 {6 J8 s - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
6 ^' G! L+ k; o$ Q - when is64BitApplication then 64 else 32,. A6 |3 n/ ?3 D* A9 r
- "bit.dll");
$ S( F. s1 ?8 q - */
5 b) e$ J3 K) c+ G$ S - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll"; l: ^ L8 t/ t4 M2 U
- local j := loadLibrary(file);6 M9 ?; |* R) [
- V3 T& ?: [, n/ T5 a: w6 `* P
- if j > 0 then6 i$ k' a& b- G1 I. T7 [
- print getLoadedLibrary(j)," is loaded.";
8 M0 H% m T, U* v/ r8 a
5 E8 P) W! b5 f( L' _6 j3 v# C- r := callLibrary(j, "calcSin", PI/6);" [3 f+ V6 @7 h. U( z2 h0 h9 P* ~
- promptmessage(to_str("sin(PI/6) = ", r));9 y& ]8 T$ M/ t! n ?- j
- * Q* o/ e* X( ?& v) g2 A
- local str:string;: l8 E* e! N8 |, J% }5 z
- str := "I'm OK!";7 c2 l' s- m5 ?# E' Q: W
- str := callLibrary(j,"resetStr",str);' a2 a$ \; i+ B& o
- promptmessage(str);
$ H, f. e! B5 n1 ] -
' P8 i- Y/ _! o u/ p1 M/ c - callLibrary(j, "listAccess", Tablefile);
# F4 H; X( r' E4 f -
4 u. r; X; @ w/ I - print "Unloading: ", freeLibrary(j);
2 E/ m& M1 j1 K* w6 o; R - end;+ v* K0 E8 D* Z. ~: E
- end;
: Y) J5 r- [7 J0 r: ~
复制代码 |