I am working in C#, and I have created a DLL to contain a library of various math functions.
I also have an app that generates various math values that need to be passed to the DLL.
Rather than passing them one by one to the DLL, which is easy to do, Id rather populate a structure, or a class, in the app and then pass the struct or class to the DLL as one object. In other words, the app creates the values, places the values in the struct or class and then passes the object to the DLL as one object which could be used to populate a local class or struct in the DLL.
Can anyone help? Thanks in advance.
What I have tried:
I have tried in calling program:
public class Paramiters
{
public double A1;
}
Paramiters Parms = new Paramiters();
Parms.A1 = 2.0;
DllInfo dllinfo = new DllInfo();
dllinfo.InitializeInfo(ref Paramiters Parms);
Generates Errors CS0118 'Form1.Paramiters' is a type but is used like a variable
Error CS1003 Syntax error, ',' expected
in the DLL...
public class DLLInfo
{
public double A;
}
DLLInfo dllinfo = new DLLInfo();
public void InitializeInfo(ref DLLInfo dllinfo)
{
No Errors generated
}