- is
- l4 P. B( T1 U - r:real; file:string;
% @. ?7 u! m n1 p - do+ t* q# |; p, O+ D
- openConsole;, v- s$ V) h. V9 |
; i" f! T5 w/ M7 u% W( k" [& ^- /*8 T {0 c$ y) p2 Z, p1 F4 X
- file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",7 v3 V+ W% z3 K8 n" T
- when is64BitApplication then 64 else 32,
, g! D. H7 \# S+ [* A' I' ` - "bit.dll");+ g, h# ^% l) o
- */
3 w/ h; k6 w* x3 q3 n - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";$ ?; r. |3 h9 {3 Z! D
- local j := loadLibrary(file);6 Y' L9 ~5 ?$ w6 X) ^# z' X( ?
- * p L+ w. k. e0 v5 _. B2 x- f/ O
- if j > 0 then
7 x( T0 z* H- d) g - print getLoadedLibrary(j)," is loaded.";1 G* h* f$ k2 \+ X5 W. C5 ~! A
- 0 u1 V! b% |% y; a, Q9 m T
- r := callLibrary(j, "calcSin", PI/6);
+ D( n" ]7 g0 R$ s9 e4 n1 _. J - promptmessage(to_str("sin(PI/6) = ", r));" u/ ]5 _2 B! O
- % m, o4 p6 u/ H0 w6 W* {7 `6 J
- local str:string;
1 L2 d3 L$ O: z& y7 N9 V - str := "I'm OK!";
' Q& Y5 Z# M1 C1 ]4 s' R - str := callLibrary(j,"resetStr",str);5 J W$ z* e& b" m5 m5 h
- promptmessage(str);) I( |) r. X+ }$ \4 i/ y( r. K: O
-
" Q; [; |- X$ [7 j9 L - callLibrary(j, "listAccess", Tablefile);
$ B2 {2 y" S2 ~% P' k - ; A- A+ v1 e3 t1 P$ a: W; E
- print "Unloading: ", freeLibrary(j);3 X+ z8 |5 v' f. U
- end;' i- X$ d# O( ^6 Z+ y$ [5 I
- end;) _! ]8 B) B" T" G
复制代码 |