Click here to Skip to main content
15,896,063 members
Home / Discussions / C#
   

C#

 
GeneralRe: Passing dynamic 2 dim float array in c# to unmanaged c++ dll Pin
f4hd11-Dec-07 3:46
f4hd11-Dec-07 3:46 
GeneralRe: Passing dynamic 2 dim float array in c# to unmanaged c++ dll Pin
m@u11-Dec-07 4:15
m@u11-Dec-07 4:15 
GeneralRe: Passing dynamic 2 dim float array in c# to unmanaged c++ dll Pin
f4hd11-Dec-07 8:33
f4hd11-Dec-07 8:33 
GeneralRe: Passing dynamic 2 dim float array in c# to unmanaged c++ dll Pin
m@u11-Dec-07 22:33
m@u11-Dec-07 22:33 
GeneralRe: Passing dynamic 2 dim float array in c# to unmanaged c++ dll Pin
f4hd13-Dec-07 4:23
f4hd13-Dec-07 4:23 
GeneralRe: Passing dynamic 2 dim float array in c# to unmanaged c++ dll Pin
m@u13-Dec-07 5:02
m@u13-Dec-07 5:02 
GeneralRe: Passing dynamic 2 dim float array in c# to unmanaged c++ dll Pin
Skippums11-Dec-07 9:02
Skippums11-Dec-07 9:02 
GeneralRe: Passing dynamic 2 dim float array in c# to unmanaged c++ dll Pin
f4hd11-Dec-07 9:34
f4hd11-Dec-07 9:34 
Hi Jeff

Thanks for your answers.

1. Change the C# import declaration type from float[,] to float[][] (they are NOT equivalent types A:I know Smile | :) )
A: tried that before, gives a marshalling error.

2. Change the C++ method signiture to take parameters of type float[][] instead of float**
A: this doesnt work too, C++ gives lots of error if using flaot[][] instead of float**

3. Convert the float[][] to a float[] in your c# code, and change your method to either float* or float[] in your C++ code
A: I think this will work so if I got it right ill do the following:
float[,] --> float[] in c#
float* --> float** once in c++
float** --> float* when exiting from the function in c++
float[] --> float[][] in c#

it should work but isnt desireable.

4. Convert the float[][] to an IntPtr pointing to the address of the array
A:Can you help me with this please.

5. Convert the float[][] to a float* (requires unsafe code in C#)
A:Im not sure about this but perhaps dont want to try it right now.

6. Try combinations of the above, where you attempt a method signature in C++ using float[][], float[], float**, float*, and change the type you are sending from C# between IntPtr, float[], float*, float[][], float[,], float**, and in addition try mixing in the keywords out and ref as well

A Smile | :) have tried many combinations already including Out and Ref but in all ive noticed that because memory isnt properly handled i can only access part of the 2d array accessing other parts causes access violation.

7. Do the same as you did in #6, but try copying the data to public memory using Marshal.Copy prior to making all the above calls
A: I dont know about this. Need to dig in to it.

I did read about pinning pointers and stuff but all that is for C++ not C#, if Im not mistaken 'ref' takes care of it, but i may be wrong.

>>The above suggestions give you hundreds of combinations to try, and my guess is that at least one >>of them will work. Let us know if you get this figured out,
A: sure ill let u all know Smile | :)

kind regards
Questionregarding to dll hell with code Pin
creative2002guy11-Dec-07 2:57
creative2002guy11-Dec-07 2:57 
GeneralRe: regarding to dll hell with code Pin
Pete O'Hanlon11-Dec-07 3:17
mvePete O'Hanlon11-Dec-07 3:17 
GeneralRe: regarding to dll hell with code Pin
Colin Angus Mackay11-Dec-07 3:22
Colin Angus Mackay11-Dec-07 3:22 
JokeRe: regarding to dll hell with code Pin
Luc Pattyn11-Dec-07 4:15
sitebuilderLuc Pattyn11-Dec-07 4:15 
GeneralRe: regarding to dll hell with code Pin
creative2002guy11-Dec-07 7:09
creative2002guy11-Dec-07 7:09 
GeneralEnterprise Library configuration tool Pin
PaulPrice11-Dec-07 2:19
PaulPrice11-Dec-07 2:19 
Generaldatatable column size Pin
arkiboys11-Dec-07 1:55
arkiboys11-Dec-07 1:55 
GeneralRe: datatable column size Pin
pmarfleet11-Dec-07 2:47
pmarfleet11-Dec-07 2:47 
Generalerror in execution of SSIS package.. Pin
tasumisra11-Dec-07 1:05
tasumisra11-Dec-07 1:05 
GeneralRe: error in execution of SSIS package.. Pin
pmarfleet11-Dec-07 2:48
pmarfleet11-Dec-07 2:48 
GeneralRe: error in execution of SSIS package.. Pin
mecca15-Feb-09 7:17
mecca15-Feb-09 7:17 
Generaldatagridview cell size limit Pin
arkiboys11-Dec-07 0:31
arkiboys11-Dec-07 0:31 
GeneralPop3 mail attachment download Pin
energeticsridhar11-Dec-07 0:18
energeticsridhar11-Dec-07 0:18 
GeneralRe: Pop3 mail attachment download Pin
m@u11-Dec-07 2:10
m@u11-Dec-07 2:10 
Generalunable to find database of webservice Pin
Member 447840010-Dec-07 23:53
Member 447840010-Dec-07 23:53 
GeneralRe: unable to find database of webservice Pin
pmarfleet11-Dec-07 2:31
pmarfleet11-Dec-07 2:31 
GeneralCustom Form.Region under Win 2000 Pin
Stevo Z10-Dec-07 23:51
Stevo Z10-Dec-07 23:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.