I don't know why it's crashing in that case, it shouldn't.

About the relative path: In one of the more recent tutorials (6, I believe) there is a function that returns the full path if you pass it a filename, or filename + subdir relative to the application. It comes in both a char and lchar version. Quite handy. You might want to check that one out.