Using Visual studio 2008 and error C2664 C2440
Hi,
I've been doing basic programming with Java, and have recently started to familiarize with c++ so forgive me if this is a really noob question
I'm using Microsoft Visual Studio 2008 and looking at code examples from the internet
when I try to compile some code I usually get the errors
for the line
ofn.lpstrFilter = "Text Files (*.txt)\0*.ufc\0All Files (*.*)\0*.*\0";
error C2440: '=' : cannot convert from 'const char [56]' to 'LPCWSTR'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
which i can use the TEXT casting thing to overcome
and
for the line
HWND hwnd = CreateWindow(sClassName,(LPCWSTR)TEXT(sAppName),WS _OVERLAPPED | WS_MINIMIZEBOX |WS_VISIBLE | WS_CAPTION | WS_SYSMENU | WS_DLGFRAME | WS_BORDER, CW_USEDEFAULT,CW_USEDEFAULT,275,137,0,0,hinst,0);
error C2440: '=' : cannot convert from 'const char [56]' to 'LPCWSTR'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
which i have not been able to solve yet.
I was wondering why do I have to edit code which should already be working? I thought perhaps its to with using C code and adding it to a C++ project, but these examples were taken from C++ programs.
Thx
soong
|