/* This example demonstrates calling a native (Win32) LF95 DLL * The cdecl calling convention and the trailing underscore are * required when the LF95 DLL is built with the "-ml lf95" option. */ #using #include using namespace System; using namespace System::Runtime::InteropServices; // DLLIMPORT ATTRIBUTE FOR .NET PLATFORM INVOKE SERVICES [DllImport("dll2.dll", CallingConvention=CallingConvention::Cdecl)] // 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 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; }