• ### Popular Now

• 16
• 15
• 11
• 9
• 10

#### Archived

This topic is now archived and is closed to further replies.

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

This topic is 6319 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

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.

##### Share on other sites
Look up:

GetCurrentDirectory()
SetCurrentDirectory()

Those should be all you need.

##### Share on other sites
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