Sunday, July 12, 2009

A win API question....Why do I recieve those errors?will send you the entire code if you want.?

Is a Window Programming issue .....compiler errors are as below :





1%26gt;------ Build started: Project: Project 78, Configuration: Debug Win32 ------


1%26gt;Compiling...


1%26gt;TextOut3.cpp


1%26gt;c:\documents and settings\seyed\my documents\game course\cpp2\chapter 5 cpp\projects\project 78\project 78\textout3.cpp(57) : error C2664: 'TextOutW' : cannot convert parameter 4 from 'const char *' to 'LPCWSTR'


1%26gt; Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast


1%26gt;c:\documents and settings\seyed\my documents\game course\cpp2\chapter 5 cpp\projects\project 78\project 78\textout3.cpp(97) : error C2440: '=' : cannot convert from 'const char [15]' to 'LPCWSTR'


1%26gt; Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast


1%26gt;c:\documents and settings\seyed\my documents\game course\cpp2\chapter 5 cpp\projects\project 78\project 78\textout3.cpp(105) : error C2664: 'CreateWindowExW' : cannot convert paramete

A win API question....Why do I recieve those errors?will send you the entire code if you want.?
You may a call to a function on line 57 of textout3.cpp to TextOutW. The fourth parameter rquired a pointer to a constant wide character. You passed a pointer to a (non-wide) character string. You need to learn something about wide characters, unicode in general. Oh: although I don't personally know, there might be a TextOut function (non-wide) that might work.


No comments:

Post a Comment