By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,953 Members | 1,109 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,953 IT Pros & Developers. It's quick & easy.

Executable File Doesn't Work (Visual C++ 2003)

P: 4
I wrote a program with Visual C++. It compiles and runs fine wiith Visual Studio, but wyen I open the executable (release and debug) file the DOS window pops up, then immediately closes. I tested this with all of my other programs that I could find and in about 2/3 of them the same thing happened. I can't find any one thing different in the working and non working programs that would explain why this is happening. I'd appreciate any input any of you might have on the subject.

Thanks
Sep 23 '06 #1
Share this Question
Share on Google+
4 Replies


P: 4
The common element that the non-working programs have and the working ones don't is reading/writing to/from data files. I think I can see the error message that's supposed to be displayed if the data file cannot be opened in the flash that the DOS window is open for. Is it an illegal shift to read/write from data files in the application or is something else wrong? Also, I do have all files included in the solution and the programs do run and compile inside of Visual Studio.
Sep 23 '06 #2

Banfa
Expert Mod 5K+
P: 8,916
Are these programs console or window applications?

That is do they have a main or a WinMain?
Sep 23 '06 #3

P: 4
They have a main, which makes them console, correct?
Sep 23 '06 #4

P: 4
Well I got to thinking about how in unix you need to have the file in the same folder as the program or include a path to get to it. So this led me to try putting the text file in the release folder, which apparently isn't done automatically, and it makes the program work. However, having user accessible text file is not a good idea, since it contains information such as passwords. Is there any way to build the file into the application?
Sep 24 '06 #5

Post your reply

Sign in to post your reply or Sign up for a free account.