Click here to Skip to main content
15,906,708 members
Home / Discussions / Managed C++/CLI
   

Managed C++/CLI

 
AnswerRe: How to create C# Control for any language Pin
Paul Conrad18-Sep-08 6:50
professionalPaul Conrad18-Sep-08 6:50 
QuestionRe: How to create C# Control for any language [modified] Pin
Andy Rama18-Sep-08 21:11
Andy Rama18-Sep-08 21:11 
AnswerRe: How to create C# Control for any language Pin
Paul Conrad19-Sep-08 4:02
professionalPaul Conrad19-Sep-08 4:02 
QuestionDll throws when loaded from a network path Pin
doug_ayers17-Sep-08 5:25
doug_ayers17-Sep-08 5:25 
AnswerRe: Dll throws when loaded from a network path Pin
Scott Dorman17-Sep-08 6:18
professionalScott Dorman17-Sep-08 6:18 
GeneralRe: Dll throws when loaded from a network path Pin
doug_ayers17-Sep-08 9:19
doug_ayers17-Sep-08 9:19 
GeneralRe: Dll throws when loaded from a network path Pin
Scott Dorman17-Sep-08 9:37
professionalScott Dorman17-Sep-08 9:37 
QuestionCallback and buffer overrun message Pin
Robert Swan16-Sep-08 11:28
Robert Swan16-Sep-08 11:28 
Confused | :confused: I have some unmanaged code that invokes a callback function to display a series of bit map images in a picturebox in a managed GUI.
The unmanaged code is called from a worker thread, it loops, creating the bitmap images and passing the image address and a serial number as parameters to the callback routine. When all the images have been displayed the unmanaged code finishes, and the worker thread terminates.
The callback routine copies the bitmap to a stream and uses invoke to get the gui to display the image.
The images are set to display at 1/second.

I thought I had everything working nicely, but after about 30 seconds everything dies and a 'Buffer Overrun' message is generated.
The error is generated when/in/by calling the callback routine. If I don't invoke the callback all is ok. If I invoke the call back but do nothing except return immediately everything still goes wrong after about 30 seconds.

If I make the delay 10 sec everything runs happily for about 100 seconds, but then dies again.


I've reduced the code to a simple skeleton, but still get the crash.
The unmanaged code is called using a delegate, GCHandle, and Marshall::GetFunctionPointer.
I suspect something to do with garbage collection, or the lifetime of a thread, but I'm tearing my hasir out over this.


Can anyone suggest what I may have overlooked?

Bob Swan
QuestionRe: Callback and buffer overrun message Pin
Mark Salsbery16-Sep-08 11:48
Mark Salsbery16-Sep-08 11:48 
AnswerRe: Callback and buffer overrun message Pin
Robert Swan17-Sep-08 11:49
Robert Swan17-Sep-08 11:49 
GeneralRe: Callback and buffer overrun message Pin
Robert Swan11-Oct-08 9:26
Robert Swan11-Oct-08 9:26 
GeneralRe: Callback and buffer overrun message Pin
Mark Salsbery11-Oct-08 9:35
Mark Salsbery11-Oct-08 9:35 
QuestionHandles and destructors - C++/CLI Pin
N a v a n e e t h15-Sep-08 16:41
N a v a n e e t h15-Sep-08 16:41 
AnswerRe: Handles and destructors - C++/CLI Pin
George L. Jackson16-Sep-08 6:53
George L. Jackson16-Sep-08 6:53 
GeneralRe: Handles and destructors - C++/CLI Pin
N a v a n e e t h16-Sep-08 19:19
N a v a n e e t h16-Sep-08 19:19 
GeneralRe: Handles and destructors - C++/CLI Pin
Scott Dorman17-Sep-08 1:29
professionalScott Dorman17-Sep-08 1:29 
AnswerRe: Handles and destructors - C++/CLI Pin
Scott Dorman17-Sep-08 1:28
professionalScott Dorman17-Sep-08 1:28 
GeneralRe: Handles and destructors - C++/CLI Pin
N a v a n e e t h17-Sep-08 2:04
N a v a n e e t h17-Sep-08 2:04 
GeneralRe: Handles and destructors - C++/CLI Pin
Scott Dorman17-Sep-08 3:06
professionalScott Dorman17-Sep-08 3:06 
GeneralRe: Handles and destructors - C++/CLI Pin
N a v a n e e t h17-Sep-08 5:17
N a v a n e e t h17-Sep-08 5:17 
GeneralRe: Handles and destructors - C++/CLI Pin
N a v a n e e t h17-Sep-08 16:47
N a v a n e e t h17-Sep-08 16:47 
GeneralRe: Handles and destructors - C++/CLI Pin
Scott Dorman17-Sep-08 17:27
professionalScott Dorman17-Sep-08 17:27 
QuestionReference Casting question. Pin
peterdrozd11-Sep-08 3:07
peterdrozd11-Sep-08 3:07 
AnswerRe: Reference Casting question. Pin
led mike11-Sep-08 4:35
led mike11-Sep-08 4:35 
AnswerRe: Reference Casting question. Pin
Mark Salsbery11-Sep-08 4:56
Mark Salsbery11-Sep-08 4:56 

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.