I hope the title was good enough to help explain what I am having problems with. I think once I solve this problem my project will be pretty much finished. Just a note, both projects are compiled under Unicode.
I am working with a CLI/C++
DLL that takes in a LPCTSTR
and returns a const char*
. If I store the value of the return in a const char*
in my project while stepping through I can see the value its returning is what I expect to be returned.
Now if I do the following:
LPCTSTR strValue = L"test";
const char* Return = MethodCall(strValue);
LPCTSTR Final = CString(Return);
Return will equal "Xmkk=Asmks" (which is what it should). This method encrypts a string. The problem is when I do CString
, Final will equal "ﻮﻮﻮﻮﻮﻮﻮﻮﻮﻮﻮﻮﻮﻮﻮﻮﻮﻮﻮﻮﻮﻮﻮﻮ㹙癞鞮᠀諸²⤐²". How do I turn the onst char*
into a LPCTSTR
without changing its data"
Thank you.