dcsimg
Results 1 to 7 of 7

Thread: program crashes upon closing modal form (exe only, not in ide)

  1. #1

    Thread Starter
    PowerPoster BruceG's Avatar
    Join Date
    May 2000
    Location
    New Jersey (USA)
    Posts
    2,627

    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?
    "It's cold gin time again ..."

    Check out my website here.

  2. #2
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    18,597

    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?
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  3. #3

    Thread Starter
    PowerPoster BruceG's Avatar
    Join Date
    May 2000
    Location
    New Jersey (USA)
    Posts
    2,627

    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.
    "It's cold gin time again ..."

    Check out my website here.

  4. #4
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    18,597

    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.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  5. #5
    Fanatic Member
    Join Date
    Jan 2013
    Posts
    782

    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.
    Last edited by flyguille; Sep 28th, 2017 at 06:20 PM.

  6. #6
    PowerPoster
    Join Date
    Feb 2006
    Posts
    20,851

    Re: program crashes upon closing modal form (exe only, not in ide)

    Quote Originally Posted by LaVolpe View Post
    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.

  7. #7
    Frenzied Member gibra's Avatar
    Join Date
    Oct 2009
    Location
    ITALY
    Posts
    1,683

    Re: program crashes upon closing modal form (exe only, not in ide)

    Quote Originally Posted by BruceG View Post
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width