- is
" [ X' q3 e1 { - r:real; file:string;
5 r/ }# O# q- J4 p - do3 D4 {& y; L# H& K- c
- openConsole;
. D# C$ y% M# K/ F3 f - ) r6 B. ^7 r. ^% q) c3 X
- /*9 `' g* E1 C/ @, F; X2 I* u
- file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
/ u9 ?9 G0 [, A- _8 S' C- [ - when is64BitApplication then 64 else 32,
/ j0 `9 Y! Z( v0 ~7 c - "bit.dll");
) S) c; y) }8 i- C+ c/ e3 r5 S+ Q - */0 M K5 A/ A( @9 O1 {
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
$ m- X0 M* \; ]& I$ S4 l - local j := loadLibrary(file);
G# E- ]7 \% b1 B: A - 1 k, A$ _8 x7 `, d
- if j > 0 then) w' I; v# o4 _9 a
- print getLoadedLibrary(j)," is loaded.";; ^: [, M# `: \; V- v5 n- o( _
- : i5 r3 R3 }; E5 p6 @8 f. l- I g* X0 I
- r := callLibrary(j, "calcSin", PI/6);6 Y, W V7 M& j
- promptmessage(to_str("sin(PI/6) = ", r));" z4 M# Q; \; J& s9 T2 n% Z" S
- ' j+ e4 [$ m$ w G( @. [' h
- local str:string;3 T; I P5 V8 h9 C$ K- J
- str := "I'm OK!";
! |( J+ i' g- H- X- L, o- |9 _ - str := callLibrary(j,"resetStr",str);* ?- P8 K1 s: D0 M3 K
- promptmessage(str);
2 v8 p$ T, o$ [5 n" H9 t -
3 P* V' t, c; `" b+ h+ | - callLibrary(j, "listAccess", Tablefile);/ {1 p3 L5 e) h5 X$ |0 R8 T: w
-
8 j( K1 k7 x) V( h$ r) } - print "Unloading: ", freeLibrary(j);# V: b4 K. I8 {6 h: y; l5 F5 f# t
- end;
" r0 S% e0 |5 o# T v: G - end;
" z4 G* ^2 Q+ n2 X r( |
复制代码 |