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.
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 (usingchars, notwchar_ts) you have to do that on your own.