Application Current Directory?
An exe run/debugged from IDE will set the current directory of application explicitly, and it may be any that your IDE implicitly decides.
Yet if your program starts manualy as is, it uses the exe location as application current directory- unless your program states otherwise.
Considering you do not use absolute file paths (and yes, you should not), and that you blow on file reads, that perhaps do not check and you blow some memory pointer afterwards, I am pretty sure it is that issue.
You can set current directory of aplication any time, or you can dynamicly construct your file paths from some observed constants like:
EXELOCATIONONHOST+CONSTANTSTRINGTORESOURCE