- is% K7 A. r* U$ ~9 j( S# v$ T
- r:real; file:string;
. ^. I; c" n7 b) k J- q U# Q) E2 o - do$ \& |$ Y" o( A# |# D& \9 z
- openConsole;
1 G& w5 o" {4 y - 4 w8 K8 v. c1 s) J
- /*
, I- G" Y6 j5 g3 C" z! y2 { - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",2 n3 G9 b4 V @" k9 _0 O
- when is64BitApplication then 64 else 32," m2 r8 z4 {- j% a
- "bit.dll");* J7 a6 K8 [" U k0 k
- */- W3 {, W. w! k( ~
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";/ B7 n( F- ^% A
- local j := loadLibrary(file);
7 A& _6 E4 {# l9 m0 o, v/ e
* S7 t6 D l+ X- if j > 0 then8 Y" {! b+ }- X: c$ ~, R0 h8 S
- print getLoadedLibrary(j)," is loaded.";
4 M9 n! U% ~5 Q0 n8 w4 d
7 F" F$ ^$ t1 A; k3 Z7 `4 ^- r := callLibrary(j, "calcSin", PI/6);+ n$ j+ Q# a x q" [. q0 v3 J1 W
- promptmessage(to_str("sin(PI/6) = ", r));! n- P7 ]' ^0 @: E; X' t0 R
- . f. X' i h1 k8 t2 n' L2 y
- local str:string;
+ O8 V t0 V. U7 D2 I - str := "I'm OK!";( ?( L: d6 A9 H t: g0 N
- str := callLibrary(j,"resetStr",str);5 X; o) {$ b1 f) @
- promptmessage(str);
5 d3 I* V$ M# l) z3 g$ N6 S) F -
& M7 O8 ]4 _2 Y# I - callLibrary(j, "listAccess", Tablefile);& G+ P& m4 K/ {( v# Q
- # ^& \& P/ Y7 q# m
- print "Unloading: ", freeLibrary(j);
- Z. U+ s: o" I9 G, D+ z: V - end;
: R$ ? E# y9 \$ O, ]& c) b7 r - end;
( k0 J; f# @( `( J7 j. ~
复制代码 |