By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,553 Members | 823 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,553 IT Pros & Developers. It's quick & easy.

Getting a Error trying to make an DLL Injector

P: 1
error C2440: '=' : cannot convert from 'char [13]' to 'LPCWSTR'
1 Week Ago #1
Share this Question
Share on Google+
2 Replies

Expert Mod 5K+
P: 8,996
The error message really says it all, the types in the assignment are incompatible, I guess the code looks something like

Expand|Select|Wrap|Line Numbers
  1. char text[] = "Hello World!";
  2. LPCWSTR pointer=text;
Your problem is that the type LPCWSTR is a wide character type based on the underlying type wchar_t which is incompatible with char.
1 Week Ago #2

Expert 100+
P: 336
mbstowcs() can be used for conversion to wide char representation.
1 Week Ago #3

Post your reply

Sign in to post your reply or Sign up for a free account.