- is
$ b! }5 H( l$ z, J* m - r:real; file:string;
' k" H. f+ u' F8 R! N - do' k. U+ L/ r9 |& T* F
- openConsole;9 k3 x! w; F. J
- f2 l# X' B; f7 V
- /*. S: z2 e* Y9 ?% X
- file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",6 M- H1 n2 T- R1 Q E& j) s1 |
- when is64BitApplication then 64 else 32,
! C9 T: K- J2 i - "bit.dll");
; [/ C8 Z- {; G2 q8 Z - */
3 e6 U4 ?" `& J: l2 F - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
' i0 R, z6 W+ L- z$ b9 N - local j := loadLibrary(file);
) B1 o3 c8 p& J' J! P6 Q, p
* w# V( X# U( G. M# T$ t- if j > 0 then
4 r. D: ~: F- f6 \9 _9 H) U - print getLoadedLibrary(j)," is loaded.";" Q. v/ _7 k: G) T2 |, i$ m
- + i$ V9 q* S3 p: }* p
- r := callLibrary(j, "calcSin", PI/6);
2 E9 q; L- o! W# } - promptmessage(to_str("sin(PI/6) = ", r));4 o0 ]2 ^/ t8 q; F: z# ]' L
-
5 P5 d2 q$ ^5 w2 x7 S p - local str:string;
4 B0 p- E: ]* v - str := "I'm OK!";$ Z7 a( v4 f3 W2 \5 f8 S
- str := callLibrary(j,"resetStr",str);
5 M* ]- K8 W7 V - promptmessage(str);5 U0 D: f! j' J; P; X. B! m$ F8 m2 z
-
$ ]# n2 T" k y1 h8 v - callLibrary(j, "listAccess", Tablefile);% V, V% f5 j) @7 ?0 f* a9 S$ s
-
% L# d- p9 c3 W" A( b) K4 i - print "Unloading: ", freeLibrary(j);# B0 h7 m/ q! K- _1 Q6 U% I# @/ X
- end;+ M) Q4 e+ U5 Z# |* e
- end;
) `# G4 {7 u+ {, K
复制代码 |