-
August 14th, 2008, 10:54 PM
#1
[RESOLVED] a little help
So now i'm screwing with SetConsoleTitle and I keep getting conversion errors.
Code:
string title = "Testing Console Functions";
SetConsoleTitle(title.c_str());
I keep getting this error whether I make it LPCSTR, LPCWSTR, Const Char, Char or String. So what am I doing wrong?
Code:
1>c:\users\cooper\documents\visual studio 2008\projects\forgotten_truths2\forgotten_truths2\main.cpp(41) : error C2664: 'SetConsoleTitleW' : cannot convert parameter 1 from 'const char *' to 'LPCWSTR'
Microsoft Visual Basic 2008 Express Edition
.NET Framwork 3.5 Beta SP1
-
August 14th, 2008, 11:11 PM
#2
Re: a little help
You can use TCHAR, and the _T or _TEXT macros to hard code in strings:
Code:
TCHAR* title = _T( "Testing Console Functions" );
SetConsoleTitle( title );
Kelly
-
August 14th, 2008, 11:17 PM
#3
Re: a little help
Originally Posted by Runt888
You can use TCHAR, and the _T or _TEXT macros to hard code in strings:
Code:
TCHAR* title = _T( "Testing Console Functions" );
SetConsoleTitle( title );
Kelly
What include do I need for _T or _TEXT. both result in identifier not found errors.
Microsoft Visual Basic 2008 Express Edition
.NET Framwork 3.5 Beta SP1
-
August 14th, 2008, 11:22 PM
#4
-
August 14th, 2008, 11:30 PM
#5
Re: a little help
Originally Posted by Runt888
I think tchar.h.
Kelly
Yeah. Thank you.
Microsoft Visual Basic 2008 Express Edition
.NET Framwork 3.5 Beta SP1
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|