- is
3 a/ o0 Q3 Z7 v9 J# H - r:real; file:string;6 [' E( N! ^3 r5 |
- do
$ }) {9 A& Z7 n( V - openConsole;
9 Y; j. c; x' z$ f, z+ T - & `& |. s% w# O7 O, x; I# ]4 ^
- /*
* t: x8 V4 ]: a3 { - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
* \& q, B) P5 x; Z9 v$ o - when is64BitApplication then 64 else 32,% r# J9 @0 @- h( d
- "bit.dll");
! ~# y7 l8 p! a1 T( M; U - */
2 E$ D5 f2 v) I$ u( X2 V7 } - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
! r/ m+ o# Z9 m H# v1 W% G) p - local j := loadLibrary(file);7 }/ ^. x8 x4 f( V* T5 k
$ y' Q: {* V. n( e9 ?) |, a8 \+ F) f- if j > 0 then1 F ^7 m1 t: p7 I$ p$ y5 ]
- print getLoadedLibrary(j)," is loaded.";
% C$ C5 l( k8 }
! E8 ]- i& y+ q, U+ _- r := callLibrary(j, "calcSin", PI/6);
1 l8 ^2 ?: }$ F# U! V6 E1 r - promptmessage(to_str("sin(PI/6) = ", r));+ T# r, Q3 x# V
- ' S8 y" j& s1 ~' h* x$ Y4 e
- local str:string;
; \5 d( \& ?7 O5 K: i, f5 P' ] - str := "I'm OK!";7 ^0 o# c) E F& `. N
- str := callLibrary(j,"resetStr",str);
, y# l6 Z" X# L% w - promptmessage(str);
( m% q# l r6 z/ ^4 u -
% J3 v2 z. }# c4 M y& j" V# { - callLibrary(j, "listAccess", Tablefile);6 V, l' ^6 T8 C( r: l, h1 g
-
8 w" J- c* s' t0 s - print "Unloading: ", freeLibrary(j);+ I$ B6 X4 U6 j7 R, a% X
- end;
6 G$ m! W5 W1 K" Y: t, }7 t - end;
0 F4 F7 l% s( I7 Y& g8 H" S
复制代码 |