Solved

how to pass an array as parameter to C function ??

Posted on 2003-11-03
1
275 Views
Last Modified: 2010-04-16
I have a DLL in C code (win32 DLL)

I want to use it in my C#.

the prototype of my C function :       int** allocation(int** r, int m, int n)

in my C#, i have made a DLLImport.
The return "work". In an usafe part i create an int**, ...

But i don't know how to create an int** and affect it in order to pass it in param

unsafe
                  {
                        int** tutu;
                        int** toto;

                        tutu = allocation(toto, 2, 2);     // toto is not assigned

                                                               .....
                                                  }

I can access to "tutu" after ... but assign "toto" ????

Is it the right way ? How create the array ?

Thanks
0
Comment
Question by:regdobey
1 Comment
 

Accepted Solution

by:
nicog76 earned 250 total points
Comment Utility
In your DLLimport you had to put " [In] int[,] " for the int*, and use an int[,] in safe.

good luck
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

In order to hide the "ugly" records selectors (triangles) in the rowheaders, here are some suggestions. Microsoft doesn't have a direct method/property to do it. You can only hide the rowheader column. First solution, the easy way The first sol…
Article by: Najam
Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now