- is
5 c% ~, b# M- ~$ j, L - r:real; file:string;! ?! w/ G4 I, {
- do8 k: T2 D; a7 U
- openConsole;8 V4 n# M- u* ]/ N
- 4 p# o& Y: k4 x! C
- /*
$ U& _* c; [5 n( v! L - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
0 e0 L( b3 E# O4 f - when is64BitApplication then 64 else 32,
1 g1 l, ~9 {3 T. P u( f5 H8 h: C - "bit.dll");
/ Q2 l" _0 r( C2 _& ` - */& I% Q% j6 }& E. L8 ^5 T
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";. }* I, G/ G) r1 X4 Q2 n W
- local j := loadLibrary(file);/ ~/ a# M! o/ ~
- 8 `0 B" O$ y: E; @0 |, o' S. ~
- if j > 0 then; H9 W6 t; H' \' j& e$ f# n9 n
- print getLoadedLibrary(j)," is loaded.";
# K8 y# C6 j# x" W - - d* c4 b# I8 @! P6 Q
- r := callLibrary(j, "calcSin", PI/6);2 ?& Q1 e* s0 Y
- promptmessage(to_str("sin(PI/6) = ", r));0 }8 P8 R* f6 C
-
4 ^8 i4 H4 k- O* m7 K" R - local str:string;
4 f5 |+ i$ [, v/ i" _' | - str := "I'm OK!";
* y( Q7 J. V+ x% [" z. } - str := callLibrary(j,"resetStr",str);
- w3 u+ j2 x+ w* ~ - promptmessage(str);. n& T6 [& o) @) I
-
. a2 g* t9 @2 L/ |6 \7 {4 e' H - callLibrary(j, "listAccess", Tablefile);' f" n* Z9 y$ J4 b T% [8 p0 }. I
-
( H3 u4 x6 @0 [( S: o+ l. x - print "Unloading: ", freeLibrary(j);
4 \* m" D% K5 ~2 z" L - end;
/ {" `1 Z- R, u; L - end;
4 p/ b& V# b% n D
复制代码 |