Click here to Skip to main content
15,905,325 members
Home / Discussions / C#
   

C#

 
GeneralGarbage collector not freeing memory - honest! Pin
Judah Gabriel Himango11-Dec-07 4:48
sponsorJudah Gabriel Himango11-Dec-07 4:48 
GeneralRe: Garbage collector not freeing memory - honest! Pin
Luc Pattyn11-Dec-07 7:01
sitebuilderLuc Pattyn11-Dec-07 7:01 
GeneralRe: Garbage collector not freeing memory - honest! Pin
Judah Gabriel Himango11-Dec-07 7:55
sponsorJudah Gabriel Himango11-Dec-07 7:55 
GeneralRe: Garbage collector not freeing memory - honest! Pin
Luc Pattyn11-Dec-07 8:21
sitebuilderLuc Pattyn11-Dec-07 8:21 
GeneralRe: Garbage collector not freeing memory - honest! Pin
Judah Gabriel Himango11-Dec-07 9:14
sponsorJudah Gabriel Himango11-Dec-07 9:14 
GeneralRe: Garbage collector not freeing memory - honest! Pin
Pete O'Hanlon11-Dec-07 9:49
mvePete O'Hanlon11-Dec-07 9:49 
GeneralRe: Garbage collector not freeing memory - honest! Pin
Luc Pattyn11-Dec-07 9:52
sitebuilderLuc Pattyn11-Dec-07 9:52 
QuestionON_MESSAGE in C# Pin
PKR11-Dec-07 3:57
PKR11-Dec-07 3:57 
GeneralRe: ON_MESSAGE in C# Pin
Anthony Mushrow11-Dec-07 4:08
professionalAnthony Mushrow11-Dec-07 4:08 
GeneralRe: ON_MESSAGE in C# Pin
PKR11-Dec-07 5:08
PKR11-Dec-07 5:08 
GeneralObject cannot be cast from DBNull to other types. Pin
eyeseetee11-Dec-07 3:51
eyeseetee11-Dec-07 3:51 
GeneralRe: Object cannot be cast from DBNull to other types. Pin
Anthony Mushrow11-Dec-07 4:12
professionalAnthony Mushrow11-Dec-07 4:12 
GeneralRe: Object cannot be cast from DBNull to other types. Pin
Pete O'Hanlon11-Dec-07 5:26
mvePete O'Hanlon11-Dec-07 5:26 
GeneralPassing dynamic 2 dim float array in c# to unmanaged c++ dll Pin
f4hd11-Dec-07 3:14
f4hd11-Dec-07 3:14 
GeneralRe: Passing dynamic 2 dim float array in c# to unmanaged c++ dll Pin
m@u11-Dec-07 3:25
m@u11-Dec-07 3:25 
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 

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.