Click here to Skip to main content
15,921,179 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How to set the "Dialog Focus" in Dialog Based Application Pin
l a u r e n29-Nov-03 13:39
l a u r e n29-Nov-03 13:39 
QuestionHow to identify a computer in a LAN from the internet? Pin
ray_li28-Nov-03 9:50
ray_li28-Nov-03 9:50 
AnswerRe: How to identify a computer in a LAN from the internet? Pin
suiram4028-Nov-03 11:13
suiram4028-Nov-03 11:13 
QuestionSpinBottonCtrl Limit? Pin
sdfdsfa28-Nov-03 9:24
sdfdsfa28-Nov-03 9:24 
AnswerRe: SpinBottonCtrl Limit? Pin
suiram4028-Nov-03 11:16
suiram4028-Nov-03 11:16 
Generalreading file properties. Pin
pnpfriend28-Nov-03 9:03
pnpfriend28-Nov-03 9:03 
GeneralStack Overflow Q Pin
suiram4028-Nov-03 9:02
suiram4028-Nov-03 9:02 
GeneralRe: Stack Overflow Q Pin
igor196028-Nov-03 10:41
igor196028-Nov-03 10:41 
Just an idea that I've used experiencing the same kind of problem in my product(http://members.cox.net/igor.tebelev/astlview2.htm).
I don't know possible depth of your recursion, but for my case, where I was traversing just 3 edges of triangular plane in order to find not connected triangles and extract different solids from multiple assembly: i had to implement alot in optimization in stack size reduction:
1. minimize stack variable usage (600bytes is alot -- I don't know specifics of your code, but why not allocate stack dynaArrays in your case on the heap?);
2. minimize call arguments size (maybe it's impossible in your case, but you may consider instead of having 2 args passed to recursive function, have just 1 pointer to the struct containing those 2 values);
3. try to replace your local stack vars with possible static equivalents if not used from different thread ( for example in your case, why can't CMiniNode* fn can't be static? or Poly frontPoly; Poly backPoly?);
4. declaring your recursive function static (if possible), so this will not occupy place on the stack...
5. it all depends on the logic, but you may look into some kind of optimization that will protect from possible reentrance and attempt to analyze something that could of been done before (not sure you have this case)...

After doing all of the above in my case: I was still getting stack overflow cases. So, what eventually I've done: reinvested some time in changing algorithm, so I limited my recursion by some constant depth of the recursion, and as soon as it was getting reached I was interrupting it and restarting again from the top, however I was saving important data in one huge array, so my next recursive call doesn't process entities already processed and was using that arrays data however. Not sure it's possible in your case, but only you can come up with something like that.
I've managed to resolve that problem back then. However, there maybe another approach that I've tried more advanced approach back then and it worked just fine: It requires some adavanced ASM skills, but basically it was like that as soon as constant depth of the recursion was reached: you allocate some memory on the heap, change stack pointer and etc...

Regards

"...Ability to type is not enough to become a Programmer. Unless you type in VB. But then again you have to type really fast..."
Me
GeneralRe: Stack Overflow Q Pin
suiram4028-Nov-03 11:05
suiram4028-Nov-03 11:05 
GeneralRe: Stack Overflow Q Pin
igor196028-Nov-03 11:58
igor196028-Nov-03 11:58 
QuestionStreet address parsing? Pin
Ed K28-Nov-03 8:28
Ed K28-Nov-03 8:28 
AnswerRe: Street address parsing? Pin
JWood28-Nov-03 10:18
JWood28-Nov-03 10:18 
GeneralRe: Street address parsing? Pin
User 58385230-Nov-03 17:06
User 58385230-Nov-03 17:06 
AnswerRe: Street address parsing? Pin
jhwurmbach30-Nov-03 21:39
jhwurmbach30-Nov-03 21:39 
Generalopening file !!help me Pin
mitil2039048230428-Nov-03 7:53
mitil2039048230428-Nov-03 7:53 
GeneralRe: opening file !!help me Pin
vancouver77728-Nov-03 9:08
vancouver77728-Nov-03 9:08 
GeneralRe: opening file !!help me Pin
mitil2039048230428-Nov-03 9:12
mitil2039048230428-Nov-03 9:12 
GeneralRe: opening file !!help me Pin
hyph3n28-Nov-03 14:57
hyph3n28-Nov-03 14:57 
GeneralHelp ME PLEASEEEE!! Simple QUESTION! Pin
Anonymous28-Nov-03 7:39
Anonymous28-Nov-03 7:39 
GeneralRe: Help ME PLEASEEEE!! Simple QUESTION! Pin
(Steven Hicks)n+129-Nov-03 7:37
(Steven Hicks)n+129-Nov-03 7:37 
GeneralCDataGrid with Another Language Pin
sdfdsfa28-Nov-03 6:50
sdfdsfa28-Nov-03 6:50 
Generalfinal Class Pin
Anonymous28-Nov-03 5:43
Anonymous28-Nov-03 5:43 
GeneralRe: final Class Pin
Roger Allen28-Nov-03 5:58
Roger Allen28-Nov-03 5:58 
GeneralRe: final Class Pin
Michael Dunn28-Nov-03 6:37
sitebuilderMichael Dunn28-Nov-03 6:37 
GeneralReading video file Pin
rrrado28-Nov-03 2:41
rrrado28-Nov-03 2:41 

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.