04-04-2020 05:11 AM - edited 04-04-2020 05:12 AM
Hi,
I need to use a dll which is created using visual studio 2019 c# library.
I saw some discussion in the forum. But I am not clear about it, especially in the exported function signature. Can anyone share me an example codeset, please?
My Example C# code
using System;
// namespace declaration
namespace HelloWorld{
// Class declaration
public class program
{
public static void MainEntry()
{
MyFunction();
Console.ReadKey();
}
}
}
static int MyFunction()
{
Console.WriteLine("Hello World!");
return 0;
}
MainEntry()"
in my CVI application. Can anyone help me?
04-07-2020 02:50 AM
I use Robert Giesecke's "Unmanaged Exports," installable with Nuget.
https://sites.google.com/site/robertgiesecke/Home/uploads/unmanagedexports
using System;
using RGiesecke.DllExport;
// namespace declaration
namespace HelloWorld{
// Class declaration
public class program
{
[DllExport( "MainEntry", CallingConvention = CallingConvention.Cdecl )]
public static void MainEntry()
{
MyFunction();
Console.ReadKey();
}
}
}
04-08-2020 10:14 AM
Much thanks for the replay.
Can you please key in few lines of example code which I should use in CVI for the same example provided. In CVI side do I need to do any thing with RGiesecke.DLLExpor ?
Regards,
Rahul.