I'm working on a Win app that opens another Win app with additional arguments.
The thing is that I don't want a user to be able to open the 2nd one without turning on the 1st one. It should always be opened by app 1. Therefore, app 1 passes some string (password) as an argument to app 2. In app 2 there is comparison between two strings, but for some reason they are seen to be "not equal".
In 2nd app I use following piece of code to compare these two strings:
> Since you use wchar_t you also need to use wofstream.
No, the OP is trying to print out the result of the function wcscmp(). He was not trying to print out any wchar_t string.
As I was using App1 to open App2 which was Chromium open-source version for developers, i.e. CEF (Chromium Embedded Framework), it passed also some arguments I wasn't aware of.
Now the question is: am I able to send some arguments on certain position in command line? Argument 14 (or maybe I should say 15 as we're counting from 0) seems to be first one available.
In general you should not expect command-line arguments to be in any particular order. (If you do, your program will break when the calling program changes its output!)
In the end, it was the problem of the architecture of 2nd app (CEF) as I mentioned earlier. I was getting arguments of incorrect part of the program, i.e. renderer, instead of browser itself. After reorganizing some part of code I got proper arguments that I actually was passing from the 1st app.
Thanks for your help. Couldn't make it without help of all of you.