Hi everyone,
I'm trying to create a .DLL to access a database from within iLogic. I'm new to VB.net so I'm having some trouble. I need to pass a multidimensional array as an argument to the DLL, but when I try to run the code I get an error that says "Number of indices exceeds the number of dimensions of the indexed array."
I've search the web for VB.net help, but all of the examples I've found are doing what I'm doing.
Any suggestions would be appreciated!
Here is my code..
The errors occur on the sData(0,i) and the sData(1,i)
I left all the database code off, because passing the array is the big issue I believe.
Public sub AddRecord(ByRef sData() As String)
For i = 0 to FieldQty
rst.Fields.Item(sData(0,i).Value = sData(1,i)
Next
End Sub
a sample loop for accessing multi diemsional array
For i = 0 To strArr.GetUpperBound(0)
For j = 0 To strArr.GetUpperBound(0)
MsgBox(strArr(i, j))
Next
Next
full source code
http://net-informations.com/vbprj/programflow/multi-dimensional-array.htm
antonio.
Hello,
I'm trying to send a dll an array (it's only a 2D array) and I've looked all over the internet, but I can't find anything that helps. I have found a couple of posts saying it can't be done, but I don't believe that.
I have a program that launches AutoCad. It is then supposed to create an array and then launch another program in AutoCad and pass it the array. The last program will take the array and run with it.
Is there a way to do that? If so, can you explain?
I'm using AutoCad 2010.
Thanks
Hi Mgorecki,
It is not clear what you are looking for, you would need to provide a bit more context... From my understanding you are trying to pass an array between two .Net applications but what kind of interprocess communication are you using? If you use COM then you will have to use COM-supported types. If your 2 exes are .Net you may want to choose a different kind of communication than COM.
That question doesn't seem like an Autodesk-specific topic, unfortunately we focus here on queries that are directly related to the use of our APIs. You will have more chances asking this on a general purpose programming forum. Here is a link I found while googling "passing array com .net", it may be relevant for you:
http://stackoverflow.com/questions/2863779/passing-a-safearray-from-c-sharp-to-com
Regards,
Philippe.
I have a .dll that launches AutoCad and will create a drawing based on the input from the array passed to it.
What I don't have, is the way to pass the array from an exe to my dll.