Visual C++ General: How to use different character sets?

Q: I have this simple function call:

MessageBox(NULL, "Test message", "Title", MB_OK);


The compiler raises the following error and I don't understand why.

error C2664: 'MessageBoxW' : cannot convert parameter 2 from 'const char [13]' to 'LPCWSTR'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast

A: Simply answered, that happens because the project is built for UNICODE.

Microsoft run-time library provides Microsoft-specific generic-text mappings for many data types, routines and other objects, mappings that are defined in TCHAR.h. There are three supported character sets:[/list][*]ASCII (single-byte character set





Personal Loans - Loans - Debt Consolidation - Credit Counseling