469,647 Members | 1,689 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,647 developers. It's quick & easy.

Getting a Error trying to make an DLL Injector

1
error C2440: '=' : cannot convert from 'char [13]' to 'LPCWSTR'
Nov 18 '20 #1
2 1539
Banfa
9,064 Expert Mod 8TB
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;
  3.  
Your problem is that the type LPCWSTR is a wide character type based on the underlying type wchar_t which is incompatible with char.
Nov 18 '20 #2
dev7060
518 Expert 512MB
mbstowcs() can be used for conversion to wide char representation.
Nov 20 '20 #3

Post your reply

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

Similar topics

3 posts views Thread by IMS.Rushikesh | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.