IBM Support What's New?

Compiling with Rhapsody 8 results in "cannot convert parameter 3 from 'wchar_t [256]' to 'LPCSTR'" error

Technote (troubleshooting)


Problem(Abstract)

Attempts to compile code with IBM Rational Rhapsody 8 on Windows 7 using Microsoft Visual Studio 2008 results in the error "error C2664: 'SetDlgItemTextA'".

Symptom

The full error message is as follows:

FOO.cpp(574) : error C2664: 'SetDlgItemTextA' : cannot convert

parameter 3 from 'wchar_t [256]' to 'LPCSTR'


Cause

This is due to the CPP_CG::MSVC::CompileSwitches property value having the /D _UNICODE switch set.

Resolving the problem

Change the switch from:

"/D _UNICODE"

to

"/D UNICODE"

Document information

More support for: Rational Rhapsody
Rational Rhapsody Developer

Software version: 8.0

Operating system(s): Windows

Reference #: 1615742

Modified date: 2012-11-13