- is
7 B! D: i: p- I# |6 A3 G* n) q% n1 \ - r:real; file:string;
! b. T; @( P9 c - do
+ B9 Z: F: H( E: V9 I - openConsole;( X H2 T+ C, o# B: u" {6 f
- ' G: ]7 ^: s* ^4 w
- /*
, U/ o% o" P( }" X9 _2 _0 C) M - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
; m7 C( b+ Q( a2 w Q. g - when is64BitApplication then 64 else 32,& _# S/ {& [9 H# w- o0 n
- "bit.dll");+ q, m# A( p1 C: b1 ~, U4 B
- */
7 r% ]% w9 `8 `0 G. F5 M - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
5 O8 n! X2 ]# p - local j := loadLibrary(file);# a" ?" `! I9 v( L6 }- p
- 7 d3 R6 b$ G" }+ v
- if j > 0 then
' d- {' `$ Q# {' Q. v6 o; i" o; C - print getLoadedLibrary(j)," is loaded.";9 d: q4 U2 V0 P( c1 o% o- S
; X1 b5 {% [' P' {- r := callLibrary(j, "calcSin", PI/6);/ H. i* [% A8 k( A
- promptmessage(to_str("sin(PI/6) = ", r));
/ U' G1 V. e8 U$ H7 v. H7 H \ - 0 A/ t, _- I! k+ p9 Y" G% i
- local str:string;
* T! N7 F. m/ B# b3 y - str := "I'm OK!";
# d7 Q3 Y5 P) U- U' u$ g - str := callLibrary(j,"resetStr",str);" l& V6 H) K8 N
- promptmessage(str);
( E h n; s1 T8 D) r0 L$ J' L5 t7 k -
8 p2 J0 Z$ B; { D- T - callLibrary(j, "listAccess", Tablefile);" P% Q( x \- `: M0 i
- / w6 @- z& }% p" u( X
- print "Unloading: ", freeLibrary(j);; E- w6 n0 f+ B+ O' A
- end;
t5 ^/ ~4 ~* S; Q2 U6 i% Q - end;2 K' g' A3 [5 i; p4 C% l
复制代码 |