- is
) A J+ y5 |4 O9 J9 ] - r:real; file:string;! r. ^" ]- l) P% H" M. ^
- do7 w& v( U3 M' k* O
- openConsole;7 L E* L! N+ q4 M; z6 F7 }9 p
* h( T8 j0 n9 \7 z- /*
. Z" k! Q) T5 }# \ - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",) J- Y8 L$ K8 I
- when is64BitApplication then 64 else 32,& r5 R. t% N% c4 F4 N4 j
- "bit.dll");
0 D) ] B" u3 }/ k3 } - */
" r; d5 D* b: e - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";! }: h J$ r- r4 p; J
- local j := loadLibrary(file);" K0 w6 c( U* i/ D; \4 y' M
- 9 }& R4 ]/ o' z: {7 G2 [ ^; z6 |
- if j > 0 then6 A4 d% x; s# X: ^) S
- print getLoadedLibrary(j)," is loaded.";7 f! d3 y- S/ v2 l t% |. ]0 E
- . t* E& w9 R% ^1 H
- r := callLibrary(j, "calcSin", PI/6);
/ e2 e* Q. M. H5 }( _1 V$ p; M5 i% I - promptmessage(to_str("sin(PI/6) = ", r));# W% t3 ?/ _+ n' i( P7 z' X" M& F1 A
-
' n4 G) v8 @8 Y/ e* p9 _ - local str:string;% r& G$ K' w1 w1 i/ F. E1 N
- str := "I'm OK!";
' `) B0 \& h9 X1 A& L& P) l - str := callLibrary(j,"resetStr",str);# u( X* {& @. y
- promptmessage(str);
/ A( O h8 h& H* y - # S! k0 h4 z0 A% o9 F$ Q$ E
- callLibrary(j, "listAccess", Tablefile);
4 f3 j; v% w" C& A - ( w. E0 v' d$ w- W# ]6 p4 c: L
- print "Unloading: ", freeLibrary(j);
! M8 v- ]) ^7 L; v+ \ - end;
2 m% F" b% i* @& t! |! ~ - end;/ ^6 ^6 b3 v2 i- N1 C F
复制代码 |