I have a new main function that I asked the linker to point to in the Visual Studio.
I can correctly execute this function. However the command line arguments that I am getting is not correct.
Currently this is my signature
int NewMain(int argc, const char* argv[])
{
cout << "New Main" << endl;
for (int i = 0; i < argc; ++i)
{
cout << argv[i] << "\n";
}
return 0;
}
However when I use the same function with the standard main, I am getting all the arguments.
A community addon from msdn:
http://msdn.microsoft.com/en-us/library/f9t8842e%28v=vs.80%29.aspx
When you specify an entry point to the linker, the function that gets called is not passed any arguments. Its signature is
int entrypoint(void);
If you want the command line, you can retrieve it with
GetCommandLine
. If you want to parse that into arguments, you can either do so on your own, or useCommandLineToArgvW
-- but note that this is only available in a wide-character version, so if you want a standard command line (usingchar
s, notwchar_t
s) you have to do that on your own.