![]() |
| | #1 |
| Registered User Join Date: Jul 2007
Posts: 11
| Visual Studio Express 2008 problems. http://www.winprog.org/tutorial/simple_window.html. I've just copy pasted to get around any mistypes, but i keep getting 4 errors: .\first_vc.cpp(40) : error C2440: '=' : cannot convert from 'const char [14]' to 'LPCWSTR' .\first_vc.cpp(46) : error C2664: 'MessageBox' : cannot convert parameter 2 from 'const char [28]' to 'LPCTSTR' .\first_vc.cpp(57) : error C2664: 'CreateWindowExW' : cannot convert parameter 2 from 'const char [14]' to 'LPCWSTR' .\first_vc.cpp(61) : error C2440: 'initializing' : cannot convert from 'const char [24]' to 'LPCTSTR' .\first_vc.cpp(63) : error C2664: 'MessageBox' : cannot convert parameter 3 from 'const char [7]' to 'LPCTSTR' there seems to be some kind of conversion error like VC++ can't handle Char's. Thanks for any help |
| Normac is offline | |
| | #2 |
| System Novice Join Date: Jan 2006 Location: Tehran
Posts: 1,074
| It is because you should use unicode. But you are using ASCII. You may change its settings. [edit] Use wchar_t[/edit]
__________________ Microsoft Visual Studio 2008 Professional (On Microsoft Windows XP SP2) Learn the language before using it. (C++ Books and C Books) Read the FAQ before making a problem. Then make a Google and Forum search. My code painter new version Version 0.97 DOWNLOAD NOW! (Let the pop up, pop!) SiavoshKC |
| siavoshkc is offline | |
| | #3 |
| and the hat of vanishing Join Date: Aug 2001 Location: The edge of the known universe
Posts: 21,214
| See http://msdn2.microsoft.com/en-us/lib...tz(VS.80).aspx Rather than char message[] = "hello"; You would say _TCHAR message[] = _TEXT("hello"); // _T() is a shorter macro for _TEXT() Or printf("hello"); would be _tprintf(_T("hello")); If you use these macros correctly, then your code will compile in ASCII or UNICODE mode.
__________________ If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut. Up to 8Mb PlusNet broadband from only £5.99 a month! |
| Salem is offline | |
![]() |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| sorting the matrix question.. | transgalactic2 | C Programming | 47 | 12-22-2008 03:17 PM |
| Avoiding Global variables | csonx_p | Windows Programming | 32 | 05-19-2008 12:17 AM |
| Crazy errors caused by class, never seen before.. | Shamino | C++ Programming | 2 | 06-10-2007 11:54 AM |
| Compiling from DOS Prompt using Visual Studio Express 2005 | The SharK | C++ Programming | 8 | 06-13-2006 01:24 AM |
| Using 'if' with char arrays or string objects | c++_n00b | C++ Programming | 36 | 06-06-2002 09:04 PM |