- is' T4 o/ Q1 O% v% _4 h
- r:real; file:string;; s( A6 x- H( |0 n
- do5 Y0 ?. `+ X* H2 }
- openConsole;4 P1 r) k' i7 e
P2 ?1 |& X6 b- /*
4 l9 I! T! t& p: O2 K - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
+ X- O4 R$ T6 P - when is64BitApplication then 64 else 32,
3 {* A. r+ n4 v4 A* h( @) _& |% m - "bit.dll");
3 j% |$ x4 X: o& q6 Q - */" ^# p/ Q5 J8 B9 l+ c0 [
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll"; q6 I5 v8 z9 C, r
- local j := loadLibrary(file);: k m! \ x* h: n! p8 Y% V# i5 K
- $ {) C5 Z# y2 K
- if j > 0 then3 }/ [1 h$ A& [9 x) b
- print getLoadedLibrary(j)," is loaded.";8 \. M+ I$ u/ G& Y. n+ `% L* M
& W/ R% B' \; O/ d! h+ t8 e, f" o- r := callLibrary(j, "calcSin", PI/6);" r1 U3 z, w, O
- promptmessage(to_str("sin(PI/6) = ", r));7 r6 G: P* t, R0 W9 { o; U
-
5 |, s# |. n1 y" T9 r& q# g - local str:string;5 [2 N7 ]& \" b: Z t
- str := "I'm OK!";
/ }4 ]) x# K9 O' h" T: ] - str := callLibrary(j,"resetStr",str);
6 ^" P- K" ^/ W: }7 |, K - promptmessage(str);
# g# T- d- |8 L% ` -
8 q& J( ~, X2 h8 l1 ^- T0 { - callLibrary(j, "listAccess", Tablefile);. r" u' x0 g0 }' [! s
-
4 O0 [1 f/ \$ E0 ? - print "Unloading: ", freeLibrary(j);' V' ]5 \5 V; n$ ?0 k$ I# q5 f
- end;
$ m0 P% D+ Y a# k0 h - end;
& R; k9 u) r0 g$ ~! w( @& z- x
复制代码 |