how can i increase the stack size on my ui thread from within my app?
my app recursively draws onto a bitmap which is then displayed in a picturebox + only causes an error when i increase the size of the bitmap. i.e. the same drawing operation on a smaller bitmap works ok.
I think you'd need to edit the MSIL to do that... but anyways, if you're overflowing the stack, you need to change your code to use loops instead of recursion (or something else). Can you post your code, please? Or at least the recursively called part?
The Application.DoEvents would make sense if the method were called recursively, but I'm missing the recursion... could you highlight the line, please?
That is normal, the mouse event will fire near all the time, its something that is a real pain in debugging. There should be no recursion, as in, the mouseevent should not be calling the mouse event and its not. Because you have a doevents in your likely to be running the same event back-to-back, (your blocking the first event to allow the 2nd, which blocks to allow the 3rd) which as been suggested you should take out unless you have a specific reason and completly understand where to use it. Its not recursion your seeing, its bad use for the doevents .
That is normal, the mouse event will fire near all the time, its something that is a real pain in debugging. There should be no recursion, as in, the mouseevent should not be calling the mouse event and its not. Because you have a doevents in your likely to be running the same event back-to-back, (your blocking the first event to allow the 2nd, which blocks to allow the 3rd) which as been suggested you should take out unless you have a specific reason and completly understand where to use it. Its not recursion your seeing, its bad use for the doevents .
i removed the doevents. same problem. i'm looking at increasing the stack size for the app with editbin.exe
it is recursive because it redraws the rectangle everytime i move the mouse. it's definitely a stack size problem as it doesn't happen with a smaller bitmap
Oh and I'm 100% sure you don't need to edit the IL because I've made a photo editor that actually returned a Bitmap object every time the mOuse moved and it didn't even run slowly.
it is recursive because it redraws the rectangle everytime i move the mouse. it's definitely a stack size problem as it doesn't happen with a smaller bitmap
Oh and I'm 100% sure you don't need to edit the IL because I've made a photo editor that actually returned a Bitmap object every time the mOuse moved and it didn't even run slowly.
I won't try it and see, because I trust that you're not lying about the error and I can't download zip files on my iPod Touch I'm just saying that I've made a graphics program before similar to this and it works fine. It has slightly less effecient design than yours because I want it to be extensible. It returns a whole new Bitmap object each time with rectangles drawn "recursively" on it and it doesn't overflow the stack. It's probably just a coding problem.
That isn't recursion, at least any typical recursion. When the exception occurs, take a look at the call stack. Post a screenshot of it, if you can, but take a look at it. There should be one function on there MANY times. Which function is it?