Click here to Skip to main content
15,913,315 members
Home / Discussions / C#
   

C#

 
GeneralRe: Uneable to stop tcp multithreaded server process Pin
Spanky35-Apr-04 11:39
Spanky35-Apr-04 11:39 
GeneralRe: Uneable to stop tcp multithreaded server process Pin
scadaguy6-Apr-04 3:35
scadaguy6-Apr-04 3:35 
GeneralSystem.OutOfMemoryException on return from unmanaged code Pin
IOUATP5-Apr-04 7:22
IOUATP5-Apr-04 7:22 
GeneralRe: System.OutOfMemoryException on return from unmanaged code Pin
Heath Stewart5-Apr-04 9:31
protectorHeath Stewart5-Apr-04 9:31 
GeneralRe: System.OutOfMemoryException on return from unmanaged code Pin
IOUATP5-Apr-04 10:35
IOUATP5-Apr-04 10:35 
GeneralRe: System.OutOfMemoryException on return from unmanaged code Pin
Heath Stewart5-Apr-04 10:50
protectorHeath Stewart5-Apr-04 10:50 
GeneralRe: System.OutOfMemoryException on return from unmanaged code Pin
IOUATP5-Apr-04 10:59
IOUATP5-Apr-04 10:59 
GeneralRe: System.OutOfMemoryException on return from unmanaged code Pin
Heath Stewart5-Apr-04 11:23
protectorHeath Stewart5-Apr-04 11:23 
You can, I just don't know why you brought it up in this discussion. If you declared your struct as a managed struct, then you wouldn't need to P/Invoke anything anyway.

One thing you could try is to fix the memory address of the array before passing it, also changing your first param to IntPtr, something like this:
GCHandle handle = GCHandle.Alloc(myArray);
MyMethod(handle.AddrOfPinnedObject(), ...);
handle.Free();
This makes sure that the GC doesn't move it while in use, which can lead to all sorts of problems.

I do a lot of unmanaged interop and frankly have never had this problem, so I'm sorry I can't be of more help. Believe me, it's bugging me now, too.

 

Microsoft MVP, Visual C#
My Articles
GeneralRe: System.OutOfMemoryException on return from unmanaged code Pin
IOUATP5-Apr-04 11:41
IOUATP5-Apr-04 11:41 
GeneralRe: System.OutOfMemoryException on return from unmanaged code Pin
Anonymous27-Apr-04 9:05
Anonymous27-Apr-04 9:05 
QuestionDouble Buffering Theme Image via pDC? Pin
Tristan Rhodes5-Apr-04 5:53
Tristan Rhodes5-Apr-04 5:53 
AnswerRe: Double Buffering Theme Image via pDC? Pin
Heath Stewart5-Apr-04 6:03
protectorHeath Stewart5-Apr-04 6:03 
GeneralRe: Double Buffering Theme Image via pDC? Pin
Tristan Rhodes5-Apr-04 8:38
Tristan Rhodes5-Apr-04 8:38 
AnswerRe: Double Buffering Theme Image via pDC? Pin
Heath Stewart5-Apr-04 6:42
protectorHeath Stewart5-Apr-04 6:42 
GeneralRe: Double Buffering Theme Image via pDC? Pin
Tristan Rhodes5-Apr-04 13:23
Tristan Rhodes5-Apr-04 13:23 
GeneralCorrection Pin
Tristan Rhodes5-Apr-04 13:28
Tristan Rhodes5-Apr-04 13:28 
GeneralArray of objects and Serialization Pin
pedro rivera5-Apr-04 5:41
pedro rivera5-Apr-04 5:41 
GeneralRe: Array of objects and Serialization Pin
Heath Stewart5-Apr-04 6:00
protectorHeath Stewart5-Apr-04 6:00 
GeneralThanks!. Pin
pedro rivera5-Apr-04 7:05
pedro rivera5-Apr-04 7:05 
GeneralRe: Array of objects and Serialization Pin
LongRange.Shooter5-Apr-04 9:01
LongRange.Shooter5-Apr-04 9:01 
GeneralClientRectangle - No Docking Calculation Pin
Tristan Rhodes5-Apr-04 4:42
Tristan Rhodes5-Apr-04 4:42 
GeneralRe: ClientRectangle - No Docking Calculation Pin
Heath Stewart5-Apr-04 5:19
protectorHeath Stewart5-Apr-04 5:19 
GeneralHeads up on big issue if you hit it.... Pin
LongRange.Shooter5-Apr-04 3:35
LongRange.Shooter5-Apr-04 3:35 
GeneralRe: Heads up on big issue if you hit it.... Pin
Heath Stewart5-Apr-04 4:23
protectorHeath Stewart5-Apr-04 4:23 
GeneralRe: Heads up on big issue if you hit it.... Pin
LongRange.Shooter5-Apr-04 9:06
LongRange.Shooter5-Apr-04 9:06 

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.