Skip to main content

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"

Rate this page:

(0 users)Average rating

Copyright and trademark information

IBM, the IBM logo and ibm.com are trademarks of International Business Machines Corp., registered in many jurisdictions worldwide. Other product and service names might be trademarks of IBM or other companies. A current list of IBM trademarks is available on the Web at "Copyright and trademark information" at www.ibm.com/legal/copytrade.shtml.

Rate this page:


(0 users)Average rating

Add comments

Document information

Rational Rhapsody

Rational Rhapsody Developer


Software version:
8.0


Operating system(s):
Windows


Reference #:
1615742


Modified date:
2012-11-13

Translate my page

Content navigation