[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.sdk

Pass an int[,] type argument to a function in a DLL written in C

Yawen Chan

10/22/2002 5:49:00 AM

Hi,

In C#, I want to pass a 2-dimensional array (of type int[,]) to a function
in a C DLL but don't know how.

The C function's prototype:
int funcionA(int **temp);

The function's prototype defined in C#:
int functionA(int[,] temp);

When I call the function:
int[,] data = new int[10,10];
int i = functionA(data);

The above codes were compiled but I got a System.NullReferenceException at
run time. What should I do?


1 Answer

Yawen Chan

10/22/2002 8:06:00 AM

0

Please disregard my previous email. I found my problem.

"Yawen Chan" <y3chan@engmail.uwaterloo.ca> wrote in message
news:evBWvYYeCHA.1732@tkmsftngp09...
> Hi,
>
> In C#, I want to pass a 2-dimensional array (of type int[,]) to a function
> in a C DLL but don't know how.
>
> The C function's prototype:
> int funcionA(int **temp);
>
> The function's prototype defined in C#:
> int functionA(int[,] temp);
>
> When I call the function:
> int[,] data = new int[10,10];
> int i = functionA(data);
>
> The above codes were compiled but I got a System.NullReferenceException at
> run time. What should I do?
>
>