- is
3 J; ]/ \% v2 J3 @, | - r:real; file:string;& m2 E; t8 _- @1 x r* d$ p2 I
- do4 F, O- h3 a: o! i8 |( F1 F
- openConsole;
0 q( k3 ^" q) S- F4 l% M6 q - , n2 a% P" p3 B; ^* e9 H
- /*
2 f* C5 `. ^, U- ` - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
& r/ h% k( x+ A - when is64BitApplication then 64 else 32,
6 L: z ?' ]- D3 M& n$ w3 W - "bit.dll");
, }* G& \" o% _& ]8 `' s4 [; H: ` - */; G$ i: L/ Y- Y5 W* _3 I& Z0 U
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
7 j' z* P5 I8 O9 |, \. V - local j := loadLibrary(file);
I& F5 o( ~' o+ K) e
/ y/ {, |' p) g- if j > 0 then* M! n5 j O# A7 {* Z/ _
- print getLoadedLibrary(j)," is loaded.";) N3 f: p: Q! `. }" J+ q& k" v
- ; A$ a! g9 A. o" q: W
- r := callLibrary(j, "calcSin", PI/6);
" B/ M* ]2 E$ V' o1 n - promptmessage(to_str("sin(PI/6) = ", r));) x, U @' S4 `
-
9 V* a& Z& v- c% [9 E, V i6 N* T) _ - local str:string;
4 S" ?- f+ L1 M; ^$ w2 ^0 t4 x8 M - str := "I'm OK!";8 t3 ?6 c' K8 S/ p& Y
- str := callLibrary(j,"resetStr",str);0 G }2 C9 P; `, }2 I$ d5 V
- promptmessage(str);* v1 w. f) T; G* i: x
-
2 A4 }' w' l. H1 k- m - callLibrary(j, "listAccess", Tablefile);
% q' b3 Z) e# V -
5 @+ O3 P$ o9 y/ |$ Y - print "Unloading: ", freeLibrary(j);
+ a) T/ y1 I0 g6 Y: P, b - end;+ {9 \; t; {* T) i$ j6 Z9 r' X n# J
- end;
: y7 U" F# q! o+ k" R; w/ i8 v
复制代码 |