Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

LoadString() returning bad data. Also, are resources mutable?

Status
Not open for further replies.

SBreslin

Programmer
Mar 12, 2006
2
0
0
US
I've made an independant game using VC++ 6.0. Upon setting up an installer for it, I found out that when shortcuts are used to run the executable, it cannot find the level data files or the save file. It I redirect the shortcut to a batch file that sets the directory first, it works, but the game's icon does not appear on the shortcut.

One possible solution is to set the directory in the code. That would require a static install directory though.

Another possibility is to move the level data and save file inside the executable. These are simply char arrays dumped into files anyway, so they're essentially just strings. LoadString() advertises that it loads a string from a resource. For some odd reason though, when I use it, the first char reads as "00", and the rest all as "CC". (Hex values) I'm probably misunderstanding how to use this function.

Also, this way requires me to alter the save file from within my own executable. Is this possible? The size of the save file is a fixed 54 chars, no variation.

Thank you,
- Sean
 
When you go into the shortcut properties, is the "Start in" directory set to the game directory?
 
It's not. Setting that fixed it. Thanks a lot.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top