The Lounge is rated PG. If you're about to post something you wouldn't want your
kid sister to read then don't post it. No flame wars, no abusive conduct, no programming
questions and please don't post ads.
He posted in the wrong forum for sure but that's rude and in violation of rule #1 and #6 of this very forum. He obviously has an issue. To post this 10 hours after the initial post and 9 hours after he re-posted in the appropriate section after being told to is uncouth.
I had a C++/CLI project I had to migrate from VS2013 to VS2015 that wouldn't compile in VS2015. I had to manually edit the .csproj file because of nuances between the two versions. I'm not saying it's not his fault but to assume that incurs the assumption you've never run into the same situation.
I think the issue has more to do with the character encoding used. He's attempting to assign an 8-bit encoding to a 16-bit value (char to wchar_t). Any non-character-encoding expert has probably run into the same problem before - I know I have. The base Windows types don't have very descriptive names so often I have to look up what they mean. Personally, I've never dealt with an LPCTSTR before only LPCSTR and LPTSTR.
It's a problem if you don't even understand the basic premise of why that encoding is different. I've said it in the past - programming is an infinitely complex topic in which no one, and I mean NO ONE, has a full grasp. Lifetimes of work can be encapsulated in a single topic.
Just cast them and all will be well.
That's an easy statement to say when you're familiar with the topic being discussed. That's an entirely different monster when you have no character encoding experience or experience with Windows types. You even mention the fact that wchar_t is a header definition for an unsigned short in your response. How many average coders do you really expect to have read the header file for wchar.h or its equivalent? wchar_t isn't even universally accepted and the char32_t standard was implemented in 2011 to deal with that issue.
Assuming the basic types are fundamentally correct, else it would have crashed anyway, all it needs is a cast. And it meerely takes a minute or two to read up the types if you are in doubt. Posting a question to a forum is lazy, and NOT the behaviour of an engineer.
Off-by-one errors, as the simplest form of error in possibly computing history, would like to have a word with you. Sometimes being blind to your own code or simply being ignorant of the context of your code is a fatal mistake. It is in this time of need that developers turn to their peers. Not to be berated but to be educated.
Being too lazy to do your own research IS an indication of a bad engineer.
It is only when you have researched and boiled a problem down to a single, distinct question, that you seek the help of senior engineers. If I hadn't done that in my early days I would have got a roasting, and rightfully so!