Advertisement

I'm a little puzzled here...

Started by March 19, 2000 11:32 PM
2 comments, last by Trigon 24 years, 11 months ago
Okay. I made this little program with DirectX, yadda, yadda. I thought I got everything to work, and it runs from the VC++ 4 IDE, but when I try to run it outside (just by double-clking the program) it crashes immediately. The source is at http://www.geocities.com/mighty_vikings_2000/source.txt (You have to split it apart into the .cpp and the header file called "usperhead.h" - GeoCities wouldn''t let me upload .cpp or .h files) I have the art in the above directory in "see.bmp", "char.bmp", and "eegg.bmp". Sorry my code''s so messy. Please help, it''d be nice if it ran on someone else''s computer...
Without even looking at your code I think I have a good guess as to what is happening. Your program is in a "debug" directory (or a directory further than your project files) and the pictures you use are in the project directory. The funny thing about VC (4,5,and 6) from the ide it runs the program as if it is in the project directory, so it can find the pictures.

Solution:
Copy (don''t move, because then it will crash from the ide) the pics to the debug directory.
OR
When you want to run the app from outside the ide, move the exe file into the same directory as the pics

Hope this helps
-Omalacon
Advertisement
I also had a problem like this a while back, and I changed the calling convention (in Project Options, C/C++ tab, Code Generation) to stdcall instead of cdecl. I have no clue why this worked, but it did. (My problem was not with the image directories, so if that fixes it, then this isn''t the problem).

Hope you fix it!

------------------------------
Jonathan Little
invader@hushmail.com
http://www.crosswinds.net/~uselessknowledge
Thank you! I almost never get two responses that quickly on other boards!

This topic is closed to new replies.

Advertisement