![invalid conversion from ‘const char*’ to ‘char*’ invalid conversion from ‘const char*’ to ‘char*’](https://aws1.discourse-cdn.com/arduino/original/4X/2/a/f/2af3966b2427a6458d83ab75477e2a43e5290b9d.jpeg)
Which of these functions is actually used when you compile your application, depends on the setting described in resolution #1 above. In case of multi-byte, the function would be MessageBoxA (ASCII). In case of a unicode build, the actual functions are postfixed W, such as the MessageBoxW seen above. A lot of the Microsoft provided libraries, such as the Platform SDK, have got two variations of each function which takes strings as parameters. This problem can be resolved primarily by using solution #2, but in some cases also #1. Where LPCWSTR maps to a wchar_t pointer, regardless of your build configuration. The latter will expand to the L prefix if you are compiling for unicode (see #1), and nothing (indicating multi-byte) otherwise.Īnother error message, indicating the same problem, would be:Ĭannot convert parameter 1 from 'const char ' to 'LPCWSTR' This can be done through either prefixing it with L, such as L"Hello world!", or surrounding it with the generic _T("Hello world!" ) macro.
![invalid conversion from ‘const char*’ to ‘char*’ invalid conversion from ‘const char*’ to ‘char*’](http://whitey.net/zzz/pic-My20051014-14-BatuCavesEntrance.jpg)
#Invalid conversion from ‘const char*’ to ‘char*’ code#
I'm trying to compile a piece of code such as: You didnt include all the code, but Im gonna guess because the signature for the function displayStringCondensed() defines its second parameter as type char. Note: This is a FAQ, not a question being asked.