vendredi 27 février 2015

LPWSTR comparison


How do I properly deal with the if statement in this example:



int n_args = 0;
int i;
LPWSTR *args = CommandLineToArgvW(GetCommandLineW(), &n_args);
if (args)
{
if (n_args >= 2)
{
for (i = 1; i < n_args; i++)
{
std::cout << args[i] << "\n";
if (args[i] == L"/D") // <-- here
{
std::cout << "Condition met\n";
}
}
}
}


The first std::cout shows that the command line parameter has been passed, but the following if statement fails.




Aucun commentaire:

Enregistrer un commentaire