- is
9 Y9 }. e% s4 f( i: U" t - r:real; file:string;7 S) S3 I3 Y2 @2 d
- do' B( o5 \. n; V# }3 }" o& o, L) K
- openConsole;
* ]4 Q3 N- N2 M6 ?9 V: k5 X
* c2 F: p6 i; {# Z% y' c& I: y- /*
/ N1 ~9 \% P' N8 _ - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",6 j4 ~8 k. y' w" `" J
- when is64BitApplication then 64 else 32,9 E& e4 y& T% n5 S8 j
- "bit.dll");/ K( H8 X* s& I+ Y7 B3 x- d
- */
; I9 I9 `8 s, M7 I - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
& O' E6 d0 l! a/ {: S7 U5 f - local j := loadLibrary(file);
% `, O* O/ c' R0 Z - , @8 ~( Y% r7 ~
- if j > 0 then. o6 O5 S$ U4 u
- print getLoadedLibrary(j)," is loaded.";' H: s% D% E# U3 r
- $ Z, c+ A4 J% @: D. @% E
- r := callLibrary(j, "calcSin", PI/6);) q2 h5 i% L1 H- G
- promptmessage(to_str("sin(PI/6) = ", r));
# C g& h, o1 j( B" ] -
2 m0 b& q; K. z$ Q" X - local str:string;. D& P+ G/ O" V; b4 E
- str := "I'm OK!";, d& F% l _% ^0 [) i$ g' S
- str := callLibrary(j,"resetStr",str);( A, S, r. X$ ^2 W7 `3 w8 O
- promptmessage(str);# K% J* Y0 ?; l% m
-
0 ^3 t) S( v7 t, T( r! }% ~8 }9 U) R - callLibrary(j, "listAccess", Tablefile);+ h! A: n" ?+ e; u6 Q1 Q0 `
- , f" k; i* h) ?4 Y- j1 F
- print "Unloading: ", freeLibrary(j);
1 F- I( }6 H9 B c& f1 P* Y! ^ - end;1 t. v3 ^: u% Q; |2 e
- end;
5 d& s" L! O6 b# x+ K% ?
复制代码 |