Can someone help explane

Started by Martin Francom, December 30, 2009, 11:41:41 PM

Previous topic - Next topic

Paul Squires

Hi Marty,

I found your problem by a simple process of elimination. I figured there must be code in the WM_CREATE that was causing the program to fail to load, otherwise we would at least see the GUI flash on to the screen and then vanish.

I commented out the calls to "ClearMask" and "RecSearch" and the program appeared. I then uncommented the "ClearMask" and it ran okay, however once I uncommented the "RecSearch" then the fail happened again.... so, I started to dig into the "RecSearch".

What I normally do when digging into a problem like this is that I will place either MsgBox's or "?" calls at various points in the function. I number them consecutively so I can watch them appear on the screen. Things like, ? "1", ?"2", ?"3", etc... I take note of the last number that appears on screen so I know that the bad code occurs between that number and the next one in sequence. I continue the process until I narrow it to the point of where the fail happens. This process works well most of the time. It will fail of course if you are trying to debug a SetFocus problem or similar because the MsgBox's will screw up the focus.

I guess that I could have tried running the whole program through PB's Debugger.... but I didn't. Haven't used that tool in a long while.

Not sure about the Theme Support thing you're talking about.... I haven't done any investigation into that. If I get some time this afternoon then I'll try to tackle that.  :)




Paul Squires
PlanetSquires Software

Paul Squires

Quote
Not sure about the Theme Support thing you're talking about.... I haven't done any investigation into that. If I get some time this afternoon then I'll try to tackle that.

Something has changed between the code you sent me before Christmas and the code you sent to me today. The code before Christmas will compile and run fine with both Themes On or Off. The new code GPF's about half way through showing the main Form.

I'll see if I can find an answer.
Paul Squires
PlanetSquires Software

Paul Squires

Marty - I sent you a modified version of your masked edit functions. They were causing recursion in your code that eventually caused the GUI to crash. For some reason with Themes turned on, this recursion did not crash Win7. Windows can be so weird.
Paul Squires
PlanetSquires Software

Martin Francom

Paul,
   Thanks greatly for your help.  Maybe with Themes set ON, that created enough of a delay that these functions were able to finish before the recursion could occur???

   I will add the change you suggested to the MaskEdit Sample program that I posted so that others don't run into this problem, if they should be using that MaskEdit code in their programs.