Game Development Community

Where is it looking for main.cs?

by Ian Omroth Hardingham · in Technical Issues · 05/27/2010 (12:31 pm) · 2 replies

Hey guys.

I'm running Torque in an unusual way, as a dll loaded from a different application.

Unfortunately, the other application is obviously running Torque in the wrong "working directory", as it does not immediately find main.cs.

To help diagnose this other application issue, it would be helpful if I could get Torque to tell me where it thinks it is running - does anyone know how to do this?

Thanks,
Ian

#1
05/28/2010 (6:04 am)
In TGE (winFileio.cc) i found that:

StringTableEntry Platform::getWorkingDirectory()
{
   static StringTableEntry cwd = NULL;
   if (!cwd)
   {
      char cwd_buf[2048];
      GetCurrentDirectoryA(2047, cwd_buf);
      forwardslash(cwd_buf);
      cwd = StringTable->insert(cwd_buf);
   }
   return cwd;
}
#2
05/28/2010 (6:25 am)
Perfect, thanks Thomas!