Getting an error:
C:
#include <stdio.h>
const char *print(const char *message)
{
if (message != 0) {
const char *message1 = "Connected";
return message1;
message = "";
}
return "Message empty";
}
C#:
public partial class Form1 : Form
{
/*Declaration*/
bool T;
string a;
[DllImport("DLLC.dll")]
static extern string print(string message);
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
a = print("Send");
if (T)
{
label1.Text = a ;
T=false;
}
else{
label1.Text = "BAD";
T=true;
}
}
}
The idea is learn how to use functions from c in c#.
Also I would like use open62541 library for OPC UA SERVER and make UI with windows forms.