In C#, I can do something like:
public partial class Form1 : Form
{
[DllImport("veie_dll.dll", EntryPoint = "my_multiply"]
public static extern int my_multiply(int x, int y);
But when I try to use a variable for the dll name (so I can use it in error messages) like this:
public partial class Form1 : Form
{
string dllName = "veie_dll.dll";
[DllImport(dllName, EntryPoint = "my_multiply"]
public static extern int my_multiply(int x, int y);
I get an error: CS0120 An object reference is required for the non-static field, method, or property 'Form1.dllName'
Any suggestions on how to do this properly?