I have a static library. This library have the following function defined
int WriteData(LPTSTR s)
The sample to call the function is
I think you're confused, as your function should work just fine:
int TestFun(LPTSTR lpData)
{
return WriteData(lpData); // Should be happy
}
But when you call your function, you'll have to be careful:
TestFun((LPTSTR) L"ABC"); // Will work fine
TestFun((LPTSTR) "ABC"); // Will not work
This is because "ABC" and L"ABC" are two different things. If you look at them in memory:
"ABC" | 65 66 67 00
L"ABC" | 65 00 66 00 67 00 00 00
Edited to add:
There is nothing like L prefix in .Net
This is just wrong. I just opened "New Project->C++->CLR Console" in VisualStudio, and the first line is:
Console::WriteLine(L"Hello World");