-
Com problem
I have a com dll written in VB. I am trying to call a function that takes two parameters, int() and string.
Code:
public void job()
{
jobDLL.clsMain job = new jobDLL.clsMain();
string iStr="test";
//int[] oInt = new int[1];
//System.Array oInt= new System.Array[1];
job.dc(ref oInt,ref iStr);
}
I am getting an error: "cannot convert from ref int[] to ref system.array"
As you can see in the code, I tried to place both an int[] and a system.array in as the first parameter. I cannot get it to accept. Any ideas?
-
Re: Com problem
I had this same problem. I "solved" it by re-writing the COM control to take ByVal input arguments explicitly.
-
Re: Com problem
Unfortunately, changing everything to byval won't work for these function. The arrays need to passed byref. They get populated in the functions. I suppose I could rewrite the structure, but I'd like to find a way to make it work with what I have. This dll is used in other applications, so it would be better not to have multiple versions, ya know?