- is
8 q' L) Y! p0 ~8 U# {1 q, Y - r:real; file:string;9 [' D7 F: ~7 L" n! }
- do$ \, V7 g3 W' Y/ i& _
- openConsole;
% d/ p( j9 O% x- M2 I( ^ \- @
- ]4 q5 M& R. T+ a4 V( `- /*: J- `. t A4 p2 t! G: H/ Y
- file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
( ?* O6 \ U9 A' S: Q+ h) ~ - when is64BitApplication then 64 else 32,
+ E0 L1 o! Q" \) z3 T8 O/ `& M - "bit.dll");; P6 A/ T; ?4 G3 o+ r2 M( `
- */( R2 I+ x# N: Q- b8 z
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
8 c2 ^) i* ^* j- C! b. h - local j := loadLibrary(file);
2 t! ]( V+ R4 z! S1 ]+ w
7 N4 g2 Q7 E( ~5 C/ ]3 N6 {- if j > 0 then
5 L- F! p* ~7 B - print getLoadedLibrary(j)," is loaded.";
! h: |$ c. U) W. I - % A1 p$ h' P; q! P% G; f7 s. }
- r := callLibrary(j, "calcSin", PI/6);, e( ^, T8 _" a6 ~
- promptmessage(to_str("sin(PI/6) = ", r));
, B! k3 R! X9 |5 T% A4 ? -
8 U- c3 }4 V1 |" o9 j0 ^$ A; _ - local str:string;
& a+ v( c* t. v* O/ `' `9 J9 t - str := "I'm OK!";
) p- [, }7 n+ Z; z' e - str := callLibrary(j,"resetStr",str);
5 Y6 T g/ k5 w' E - promptmessage(str);2 D3 I L/ J# ~) J3 n
-
$ g* @& Z/ E# K - callLibrary(j, "listAccess", Tablefile);
1 U- }$ ]2 a3 z; Y* a2 ? -
0 a+ l6 r' K) ?* w, n* f - print "Unloading: ", freeLibrary(j);
- ^' Q3 J5 a+ P# z - end;1 y/ l9 r5 f9 D" V9 M" k: _- N
- end;
) @2 l9 N$ c9 ~& ]8 J- L
复制代码 |