I set the command line arguments for my application in the project properties -> debugging -> command arguments section.
If I run the program from the command line directly, I do:
progname arg1 arg2
So, I set the command line arguments in VS to
arg1 arg2,
as described here.
But the program does not seem to work the same as when launched from the command line. The arguments are text files, and on the command line it can load these text files correctly, in VS2010 this is not so. Any ideas why?
Edit: update / clarify message:
I do not get any exceptions.
Perhaps I have simplified the problem too much in my explanations. I do not load text files, I load a physical engine that must be determined at runtime, so I need command line arguments.
Code for loading a high-level physical engine:
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, ie 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 use Bullet, which runs as follows:
progname.exe arg1 arg2,
arg1 is the physical name, and arg2 is the physical file to load, but it hangs on arg1 .
The specific way I invoke this on the command line:
progname.exe Bullet filename.
If I do this on the command line, it works, but if I pass these arguments to the debugger, I will have a problem with the expression could not load physics engine .
This may be the result of the internal components of the loader of the physical engine, which is from a different source, but I assume that this should work the same way as passing these arguments on the command line or in the VS debugger settings.
I will look at the UAC settings and see what they say.