const char error
-
Hi I am getting a number of errors in MFC functions (Using Visual Studio 2012) can't convert const char [xx] to LPCTSTR when using a literal with " double qoute it was my understanding that anything with " was a pointer now weather its char * or LPCTSTR is a different issue however it shouldn't be of type const char[xx] Thanks
-
Hi I am getting a number of errors in MFC functions (Using Visual Studio 2012) can't convert const char [xx] to LPCTSTR when using a literal with " double qoute it was my understanding that anything with " was a pointer now weather its char * or LPCTSTR is a different issue however it shouldn't be of type const char[xx] Thanks
-
Do you have the project set to use the Unicode character set? If so
LPC**T**STR
is equivalent toLPC**W**STR
, so you cannot convert achar
pointer to it. -
Hi I am getting a number of errors in MFC functions (Using Visual Studio 2012) can't convert const char [xx] to LPCTSTR when using a literal with " double qoute it was my understanding that anything with " was a pointer now weather its char * or LPCTSTR is a different issue however it shouldn't be of type const char[xx] Thanks
Try using
TCHAR
instead ofchar
, and wrapping string literals in the_T()
macro."One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
-
Hi I am getting a number of errors in MFC functions (Using Visual Studio 2012) can't convert const char [xx] to LPCTSTR when using a literal with " double qoute it was my understanding that anything with " was a pointer now weather its char * or LPCTSTR is a different issue however it shouldn't be of type const char[xx] Thanks
Please read __What are TCHAR, WCHAR, LPSTR, LPWSTR, LPCTSTR (etc.)?[^]
-
In my visual Studio project for character set I choose not sure what that means ansi? 1 byte The other two choices were Unicode and multi byte So if Unicode is character representation by 2 bytes. what is multi byte ?
ForNow wrote:
So if Unicode is character representation by 2 bytes. what is multi byte ?
See here.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
-
ForNow wrote:
So if Unicode is character representation by 2 bytes. what is multi byte ?
See here.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles