I wrote this simple example in c# :
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace DLLTest
{
public class MyDllTest
{
public int sumFunc(int a, int b)
{
int sum = a + b;
return sum;
}
public static string stringFunc(string a, int numT)
{
if (numT < 0)
{
string errStr = "Error! num < 0";
return errStr;
}
else
{
return a;
}
}
}
}
As you can see - in the first function i'm not using "static" . When I run in in Iron python using this code :
import sys
import clr
clr.addReferenceToFileAndPath(...path do dll...)
from DLLTest import *
res = MyDllTest.sumFunc(....HERE MY PROBLEM IS...)
when I pass 2 args - I get this error :
>>> res = MyDllTest.sumFunc(4,5)
Traceback (most recent call last):
File "<string>", line 1, in <module>
TypeError: sumFunc() takes exactly 3 arguments (2 given)
As I understand it asks for the fisrt argument to be from type "MyDllTest"
but when trying to write : a = new MyDllTest I get an error.
what should I do? Any help would be very appreciated!