/* This example demonstrates calling a native (Win32) LF95 DLL * The stdcall calling convention is used by default. The LF95 * DLL must be built with the "-ml msvc" option. */ #using #include using namespace System; using namespace System::Runtime::InteropServices; // DLLIMPORT ATTRIBUTE FOR .NET PLATFORM INVOKE SERVICES [DllImport("dll1.dll")] // PROTOTYPE FOR THE NATIVE LF95 DLL extern "C" int dll1(float *a, float *a1, long *i, long *i1, bool *l); int _tmain(void) { float a; float a1[10]; long i; long i1[10]; bool l = false; long result; Console::WriteLine("C++.NET Calling Native LF95 DLL (ML MSVC) Example"); Console::WriteLine(); // LF95 DLL FUNCTION CALL result = dll1(&a, &a1[0], &i, &i1[0], &l); Console::WriteLine(a); for (int n=0; n<=9; n++) { Console::Write(a1[n]); Console::Write(" "); } Console::WriteLine(); Console::WriteLine(i); for (int n = 0; n<=9; n++) { Console::Write(i1[n]); Console::Write(" "); } Console::WriteLine(); Console::WriteLine(l); return 0; }