I've set the command line args for my app in the project properties -> debugging -> command arguments
section.
If I run the program from command line directly I do:
progname arg1 arg2
So I've set the command line arguments in VS to
arg1 arg2,
as described here.
But, the program doesn't seem to run the same way as in running it from command line. The arguments are text files, and in the command line it can load those text files correctly, in VS2010 it doesn't somehow. Any ideas why?
Edit: update/clarification of post:
I am not getting any exceptions.
I may have oversimplified the problem too much in my explanation. I'm not actually loading text files, I'm loading a physics engine, which should be determined at runtime, so I need command line arguments.
The code used for loading the physics engine, on a high level, is:
if ( argc > 2 )
{
#ifndef PAL_STATIC
PF->LoadPALfromDLL();
#endif
//DebugBreak(); // for debugging ;)
PF->SelectEngine(argv[1]);
if (!pp) {
#ifdef _WIN32
MessageBox(NULL,L"Could not start physics!",L"Error",MB_OK);
/* ^ This is the error I am getting, i.e. pp is NULL,
so "PF->SelectEngine(argv[1]);" is not loading engine correctly */
#else
printf("Could not start physics engine %s!\n",argv[1]);
#endif
return -1;
}
I am using Bullet, which is run like this:
progname.exe arg1 arg2,
arg1
is the physics engine name and arg2
is a physics file to load, but it hangs on arg1
.
The specific way I invoke this on the command line is:
progname.exe Bullet filename.
If i do this on command line it works, but if I pass these arguments to the debugger, I get a problem saying could not load physics engine
.
This may be a result of the internals of the physics engine loader, which is from another source, but my guess is that this should work the same way whether I pass these arguments in the command line or in the debugger settings of VS.
I will look into the UAC settings and see what they say.