- is! D' a0 w9 Q2 b) Y% y; ?3 l
- r:real; file:string;* I4 x( @8 x" d7 Q1 Y! o
- do* D. p' S) x; ?2 r
- openConsole;. C$ ~* D) t$ p2 k" s% i; `% W
; n# U/ }# C' j; A9 G- /*
- o3 ?# A9 b7 d& F1 i* Q - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
$ W9 P! u# A6 s c - when is64BitApplication then 64 else 32,: h2 N0 `9 L% q) l# B6 o
- "bit.dll");2 W8 i2 c2 p) U
- */
* `. O+ h: a' B3 e - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";+ v1 F1 F7 f+ Q: R) ]/ S
- local j := loadLibrary(file);
& s F1 ~7 B$ T% H, G( Q
- ~9 J2 Q" S3 y {1 k7 Z5 y- if j > 0 then
0 N. E% C' T9 c3 m# @1 ?6 D% u - print getLoadedLibrary(j)," is loaded.";
9 x! }5 K' n6 P0 M - 0 F0 g# x, ^- M2 `
- r := callLibrary(j, "calcSin", PI/6);$ }5 ?7 `0 R2 h+ e9 v0 T
- promptmessage(to_str("sin(PI/6) = ", r));# _% C$ k2 K3 |
- + _) K0 `! M$ U
- local str:string;' i M: [$ H" y
- str := "I'm OK!";
) A7 s7 |2 _/ @/ U' s3 S, L d6 R( k* n - str := callLibrary(j,"resetStr",str);% u* ~+ g% {& k( {( L" }/ L
- promptmessage(str);
& H* x( U) H) |) a- B8 c -
$ Z. h5 k6 q% R3 m& [, I Y+ G - callLibrary(j, "listAccess", Tablefile);' Y0 v" t, x( k; f& f
-
1 Q! t2 ]- g7 _2 S - print "Unloading: ", freeLibrary(j);
! v5 C, B) k J4 \# Z- ] - end;
! @1 C3 C( @2 J K1 g - end;# ]2 \+ q1 s O3 ?% V z
复制代码 |