Original Post
I'll be concise and to the point: I have a class that has a member string. In its constructor I'm copying an argument string (pointer) to the member string (static array). Using all methods, however (wcscpy, wcscpy_s and one-by-one character copy) the first four characters aren't copied, but the loop/copy routine exits with the string copied, always starting from the fifth character (this seems to happen for all instances of the class).
Usually I'd expect this to be a memory leak/buffer overrun problem, but this is happening very early in my startup code and, quite frankly, since it also happens at the top of the constructor with no other threads running and inside all instances of the class, I'm not sure what why or how could be causing this. To the best of my knowledge, this issue just appeared out of nowhere without my being able to attribute it to any noteworthy change (and, yes, I've tried a full rebuild). This happen when running from the command line as well as from the IDE.
Any ideas or suggestions where to start looking?
Edit - oh-oh! I just noticed something extra cool:
//ClassName is expected to be "windowclass";
WindowClass.lpszClassName = (LPWSTR)ClassName;
When I inspect ClassName, it's "owclass" while WindowClass.lpszClassName displays a proper "windowclass".
Usually I'd expect this to be a memory leak/buffer overrun problem, but this is happening very early in my startup code and, quite frankly, since it also happens at the top of the constructor with no other threads running and inside all instances of the class, I'm not sure what why or how could be causing this. To the best of my knowledge, this issue just appeared out of nowhere without my being able to attribute it to any noteworthy change (and, yes, I've tried a full rebuild). This happen when running from the command line as well as from the IDE.
Any ideas or suggestions where to start looking?
Edit - oh-oh! I just noticed something extra cool:
//ClassName is expected to be "windowclass";
WindowClass.lpszClassName = (LPWSTR)ClassName;
When I inspect ClassName, it's "owclass" while WindowClass.lpszClassName displays a proper "windowclass".