Solved

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

Posted on 2003-11-03
1
314 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 

Accepted Solution

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

good luck
0

Featured Post

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

622 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