Groups | Blog | Home
all groups > dotnet interop > november 2004 >

dotnet interop : 2 dimensional array from VB.NET to C DLL


irmars NO[at]SPAM yahoo.com
11/29/2004 11:52:38 AM
Hi,

I need to pass a two dimensional array from VB.NET to a C DLL
function. The prototype for the C function is as follows:

int _stdcall myFunction (int **matrix)

I have created an array in VB as

Dim t(2,2) As Integer and initialized. Please let me know how to do
this..

irmars NO[at]SPAM yahoo.com
11/30/2004 7:25:17 AM
[quoted text, click to view]

Hi,

I have created the dll and used the declare statement as

Declare Function TestArraysOfInts Lib "DemoDll.dll" ( _
ByRef myArray(,) As Integer, ByVal row As Integer) As Integer

But when I call this function it gives a null reference exception. I
need to be able to pass the array to dll and receive the changes made
by dll in VB.NET..Please help..

AddThis Social Bookmark Button