|
-
Jun 2nd, 2005, 11:04 AM
#1
Thread Starter
Hyperactive Member
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?
-
Jun 2nd, 2005, 08:07 PM
#2
Re: Com problem
I had this same problem. I "solved" it by re-writing the COM control to take ByVal input arguments explicitly.
Nobody knows what software they want until after you've delivered what they originally asked for.
Don't solve problems which don't exist.
"If I had eight hours to cut down a tree, I'd spend six hours sharpening my axe." --- Abraham Lincoln (1809-1865)
2 idiots don't make a genius.
-
Jun 3rd, 2005, 07:32 AM
#3
Thread Starter
Hyperactive Member
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?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|