program crashes upon closing modal form (exe only, not in ide)
Hello team,
We are working on a legacy VB6 app. We added a new dialog form and are showing it using vbModal. Upon closing this form, the program crashes when run as a compiled exe, but works fine when running in the IDE.
When it crashes, the default debugger on this machine (VS 2008) states that it is an unhandled Win32 exception, with the message "floating point inexact result" (hex = 0xC0008F).
It should be stated that we are not doing any floating point math of any kind.
As a test, we made a blank form and just call it:
MyForm.Show vbModal
After the form shows, the crash occurs upon clicking the "X" button.
Prior to this, the crash will occur with "Me.Hide" as well as "Unload Me".
Any ideas?
Re: program crashes upon closing modal form (exe only, not in ide)
Was that the entire project, just MyForm?
Otherwise, can you tell us a little bit more about it. Is it manifested for common controls and if so, how do you start the project: Sub Main, primary form? Is there any subclassing going on? Any other information that can help us 'guess' a bit better?
Re: program crashes upon closing modal form (exe only, not in ide)
Hey friend, thanks for responding ...
Only the newly created form exhibits this behavior. It's started by Sub Main. No subclassing that I can see. Not sure what you mean by if it is manifested for common controls: if you mean does it have treeview, listview, etc., then yes.
Re: program crashes upon closing modal form (exe only, not in ide)
I've not seen any posts regarding crashing by setting Me.Hide; however, have seen threads regarding crashing on normal closing. Those cases involve using a manifest file along with a vb-created usercontrol. See this thread, post 12, for more if it applies.
Is there any code in your form's unload event that is referencing other controls or forms. Sometimes, you can have a DoEvents loop that allows other code to execute, unloading the form, then the next line of code after the DoEvents executes which can reload and execute more code unexpectedly. But at this point, without more details, just guessing.
Though I've not seen this, relating to not having SP6 installed, is SP6 installed? Whenever I see questions about problems relating to simple VB behavior, SP6 is in the back of my mind.
Re: program crashes upon closing modal form (exe only, not in ide)
it crashes also if using AlT+F4 for closing the modal form?
I asks this because I found, that if clicking in the X (close button), while the MOUSEBUTTON is pressed DOWN, and not released, ALL VB code IS stopped, in ALL Forms.
So don't matter if you has TIMERs in others forms maintaining communications alive in sockets, etc.... , if the user HOLD DOWN the X on the title bar (MODAL or not MODAL), the app is unable to process anything, until the user release the X in the tittle bar.
Re: program crashes upon closing modal form (exe only, not in ide)
Quote:
Originally Posted by
LaVolpe
Though I've not seen this, relating to not having SP6 installed, is SP6 installed? Whenever I see questions about problems relating to simple VB behavior, SP6 is in the back of my mind.
I would start with this. It is both easy to accomplish and should be considered a requirement anyway.
If that is taken care of and the issue remains then we'd have to see a complete test case that reproduces the problem, otherwise we can only throw out guesses.
Re: program crashes upon closing modal form (exe only, not in ide)
Quote:
Originally Posted by
BruceG
Hey friend, thanks for responding ...
Only the newly created form exhibits this behavior. It's started by Sub Main. No subclassing that I can see. Not sure what you mean by if it is manifested for common controls: if you mean does it have treeview, listview, etc., then yes.
Make a sample source project that reproduce the problem, zip-it and public the zip.