Strange Compile/Run Time Problem

Started by Marty Francom, July 27, 2005, 12:04:43 PM

Previous topic - Next topic

Marty Francom

Paul,
...When I compile my project, everything compiles without any error messages, but the I run the project I get a  Windows Error Message stating:
..
   "Rx32W  main startup program has encountered a problem and needs to close. We are sorry for the inconvenience."
..
..If in FireFly's Enviroment Options, Code Generation,  I check "Use Debug Error On"  then the compiled program will run with out the above error.
..Any idea why this is happenning?  :?:
..You have a copy of my project, compile both ways and let me know if this happens for you.

Marty Francom

Paul,
..  I have tryed compiling on two different computers both running Win-XP-home OS.   Same thing happens on both computers.  The program will compile without any error messages from the PB compiler.  But when I go to run the program I get the Windows error message (above).  Then if I compile with "debug" set on then the compiled program will run properly.
.. Mark uses  Win-XP-Pro and it compiles and runs without this problem.
..Could it be something with the home edition that is causing the problem?
..Do you have a computer with XP-home OS,  could you try to compile on that computer?  If so then maybe their is some problem with PB and XP-home.

TechSupport

Hi Marty,

Sorry for being so slow in testing your problem. I downloaded your source on a different computer than this one. When I get home I will fire it up and see what happens.

I am running Windows 2000. I had WinXP Home installed on a laptop a couple of months ago but I unistalled it in order to load on a copy of Linux to play with. :)  I will reload that laptop if necessary.

TechSupport

For what its worth, usually these types of errors are due to memory being corrupted via a stary pointer or trying to access an array out of bounds. Using the Debug statement basically hides these types of errors.

Marty Francom

Paul, would XP-Pro and Win-2000 have features that handle this type of error better?  When compiled on Mark's XP-Pro the program will run fine on my XP-home.
We will check to see if we can find a stray pointer or an array that might have an out of bounds problem.  
Maybe I can do a binary read of the two program files,  the one compiled on Mark's Pro and the one compiled on my XP-home and see if I can find were the files differ.  (Size wise both files are exactly the same size.)[/b]

TechSupport

I compiled and ran the program. I have the same trouble as you. The program GPF's unless Debug Error ON is enabled. I am on Win2K.

Roger Garstang

If Debug Error makes it work then it has to be something that it handles-  Math errors like Div by 0, Array out of bounds, or pointer problems.

Marty Francom

I have isolate the crash to be in a Tooltips routine.  The program crashes on exicuting this line:
...
SendMessage(hWnd_XPToolTip, %TTM_SETTITLE, IconPic, ByVal VarPtr(Title))
...
Any suggestions?

Roger Garstang

I replied to the post over at PB about this, but just in case you get here first, post the Function call to my tooltip code.  It must be something with the icon or title passed to it.  I'd probably say the icon without looking at it since the title seems to work fine, but the icon portion in my opinion looks incomplete (on M$'s part) from what the docs talk about.  You can specify certain static numbers for the main Windows messagebox type icons, and according to the docs even specify an icon handle, but you have to clean it up yourself, etc and it doesn't really go into more detail.

Marty Francom

Thanks Roger,  I will let you know how it goes.

Roger Garstang

Michael found the problem over at the PB Forum.  It is the optional parameters, when it is ByRef and VarPtr is used on it then it goes boom!  You'll need to either test for it or make the parameter(s) ByVal in the function like BalloonTip is.  Then they are 0/null strings.

Marty Francom