Runs fine in IDE but crashes normally!

This is a discussion on Runs fine in IDE but crashes normally! within the Windows Programming forums, part of the Platform Specific Boards category; Hey, I just made a *working* version of "Theseus and the Minotaur" (the puzzle game, where you have to escape ...

  1. #1
    Carnivore ('-'v) Hunter2's Avatar
    Join Date
    May 2002
    Posts
    2,879

    Unhappy Runs fine in IDE but crashes normally!

    Hey, I just made a *working* version of "Theseus and the Minotaur" (the puzzle game, where you have to escape from a maze). It runs perfectly fine when I hit the "execute" button in Microsoft Visual C++ 6.0, but when I try double-clicking the executable (not in VC++), it crashes right away:

    Runtime Error!

    Program: (...).EXE


    abnormal program termination



    The caption at the top of the messagebox was "Microsoft Visual C++ Runtime Library".


    Does anybody know what's wrong? (or have an idea?) If anybody wants, I can email the exe/code to them (my email: Hunter_Guy_2@hotmail.com).
    Just Google It. √

    (\ /)
    ( . .)
    c(")(") This is bunny. Copy and paste bunny into your signature to help him gain world domination.

  2. #2
    Registered User
    Join Date
    Dec 2001
    Posts
    421
    It could be almost anything! Post a link to the code so we can see it.

    U.
    Quidquid latine dictum sit, altum sonatur.
    Whatever is said in Latin sounds profound.

  3. #3
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,856
    Try changing the build from debug to release.

    Run and when crashes look at the 'call stack' window to see (if lucky) where it crashed.
    "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
    Friedrich Nietzsche

    "I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
    George Best

    "If you are going through hell....keep going."
    Winston Churchill

  4. #4
    Carnivore ('-'v) Hunter2's Avatar
    Join Date
    May 2002
    Posts
    2,879

    Lightbulb

    Sounds like a good idea. But... the problem happened not when I hit "execute", but when I went into Internet Explorer and double-clicked the executable.

    Oh yes, here's the link to the code It's zipped along with the executable - could someone try the exe out for me?

    http://www.geocities.com/hunterguy_2/
    (then click on "Click here for Theseus and the Minotaur" - a direct link wouldnt work for some reason).
    Last edited by Hunter2; 05-06-2002 at 09:33 PM.
    Just Google It. √

    (\ /)
    ( . .)
    c(")(") This is bunny. Copy and paste bunny into your signature to help him gain world domination.

  5. #5
    Registered User
    Join Date
    Dec 2001
    Posts
    421
    I know what your problem is. When you run the program through the IDE, the working directory of the exe is the same directory that the .dsp file is for the project. This means that is able to find your gamedata.dat file in the current directory.

    but when you run it through windows explorer, the working directory is the debug/release directory (depending on the build) and it crashes because the file isn't in the directory.

    so 2 things:

    1) either copy the gamedata.dat file into the same directory as your exe or
    2) put a check in to make sure the file open worked, if it doesn't then display an error saying "unable to open file gamedata.dat"... this will help you with this problem in future.

    hope that helped!
    U.
    Quidquid latine dictum sit, altum sonatur.
    Whatever is said in Latin sounds profound.

  6. #6
    Carnivore ('-'v) Hunter2's Avatar
    Join Date
    May 2002
    Posts
    2,879
    Oooooooooooooh, I see! Thanks a lot, that would have taken me a while to figure out
    Just Google It. √

    (\ /)
    ( . .)
    c(")(") This is bunny. Copy and paste bunny into your signature to help him gain world domination.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Program crashes and memory leaks
    By ulillillia in forum Tech Board
    Replies: 1
    Last Post: 05-15-2007, 10:54 PM
  2. Program does not run outside of the IDE
    By darksaidin in forum C++ Programming
    Replies: 3
    Last Post: 08-09-2003, 01:31 AM
  3. making ide cable::things i need to know?
    By Waldo2k2 in forum Tech Board
    Replies: 3
    Last Post: 06-19-2003, 01:14 PM
  4. Replies: 5
    Last Post: 08-05-2002, 07:14 PM
  5. Program crashes and I can't figure out why
    By Unregistered in forum C Programming
    Replies: 6
    Last Post: 09-19-2001, 05:33 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21