windows agony :-)

Started by
1 comment, last by d_strand 21 years, 7 months ago
I am new to windows programming (have mostly worked with unix before) and i have a silly problem.. I am trying to learn directX (and also Visual Studio 6) and my problem is probably some stupid switch in Visual C++ or something. My little program (an animatated sprite on a scrolling starfield... pure 2d) works great inside VS6, but when i try running the .exe by itself (outside VS) a window just appears on screen for like half a second and then nothing more.. I''ve never had this problem with my old DOS programs, and i feel a bit ridiculous for asking, but nothing seems to help. Does anyone know what i am doing wrong? I''m sure it is something silly :-) -Daniel (on WinXP pro)
Advertisement
When you execute a program from with in visual C++ it''s run time path usually defaults to one level up for example:

You''ve got a project in c:\test\
You create a debug version of the project and execute it, the exe is stored in c:\test\debug\.
But visual C++ takes you one level up by default so it searches for files in c:\test\ rather than c:\test\debug\ where the executable actually lives.

Now if you were to execute the program in it''s native directory from out side of visual C++ it will look in c:\test\debug\ for all the files it needs such as .bmp files, .wav files and so on.

So basically your problem is that you need to place all the files nessassary to run your .exe file in the same directory as the executeable, when running your application outside of visual C++.
doh! you are right of course... thanks a lot!

This topic is closed to new replies.

Advertisement