Advertisement

Loading WAV and BMP from CURRENT_DIR$\sounds and CURRENT_DIR$\graphics

Started by December 01, 2000 11:58 AM
1 comment, last by bios10h 24 years, 1 month ago
Hi, I just programmed a tetris-clone for learning purpose and fun. Eveything is working well now but I have a ton of files in my program (.exe) directory. I would like to create child directory .\sounds and .\graphics and load my files from these dir. I uses PlaySound for wav and LoadImage for BMP. Summary : I need a Win32 function to get my program location when running. I will then concat the child dir and filename ! Anybody can help with that ? Or bring another solution than this one ? sorry for bad english, bios10h ------------------------------------------ Stephane Duguay DMI C.S. student, University of Sherbrooke, Province of Quebec, Canada.
Look up:

GetCurrentDirectory()
SetCurrentDirectory()

Those should be all you need.
Advertisement
GetModuleFileName() gives you filename of your application, regardless of current folder, easily.

I recommend you to look up CreateDirectory(), splitpath(), and makepath(). They also help you, I guess.

Kurie

Kurie Itoh

This topic is closed to new replies.

Advertisement