Re: TCHAR to std::string Programming Software Development by Ancient Dragon TCHAR is just a macro that is defined to be either … Re: TCHAR and std::map Programming Software Development by welcomepro … main() { map<TCHAR*,int> theList; TCHAR text1[100] = _TEXT("Hello World"); TCHAR text2[100] = _TEXT(&…from editbox and save in a temp, defined as // TCHAR tempo [100] GetDlgItemText(handle, ID_EDIT, temp, MAXTEXT); …in the map db.insert(pair<const TCHAR*,int>(temp,1));[/CODE] This code … Re: TCHAR and std::map Programming Software Development by Ancient Dragon …++. [code] int main() { map<TCHAR*,int> theList; TCHAR text1[100] = _TEXT("Hello World"); TCHAR text2[100] = _TEXT("DaniWeb…>(text1,1)); theList.insert(pair<TCHAR*,int>(text2,2)); map<TCHAR*,int>::iterator it = theList.begin(); cout… TCHAR and std::map Programming Software Development by welcomepro Hi to all, i want to save an array of tchar with his value in the map, as std::map<TCHAR [100], int> word; but when i say [CODE=C++]insert(pair<TCHAR [100],int>(text,1))[/CODE] the error is: cannot specify explicit initializer for arrays... Why???? Re: TCHAR and std::map Programming Software Development by welcomepro [QUOTE=welcomepro;997884]yes i tried but the map unordered...[/QUOTE] this method not work... It's possible to save an array of TCHAR as TCHAR text[100] in a map? I obtain the text from the edit box... Re: TCHAR and std::map Programming Software Development by Ancient Dragon Did you try pointers? [icode]insert(pair<TCHAR*,int>(text,1))[/icode] Re: TCHAR and std::map Programming Software Development by welcomepro [QUOTE=Ancient Dragon;997862]Did you try pointers? [icode]insert(pair<TCHAR*,int>(text,1))[/icode][/QUOTE] yes i tried but the map unordered... TCHAR to std::string Programming Software Development by disc Goodmorning, Can anyone tell me how to convert a TCHAR to a std::string ?? Thanks.... Re: const TCHAR* to System::String? Programming Software Development by Ancient Dragon TCHAR is a macro -- you can't convert System::String to a macro, it doesn't make any sense. You can convert it to char* or wchar_t*, depending on whether you are compiling for UNICODE or not, but can't convert it to a macro. See [URL="http://msdn.microsoft.com/en-us/library/system.string_methods.aspx"]ToCharArray() here[/URL] Re: Using tchar to convert lowercase to uppercase Programming Software Development by valleymorning …? Thanks so much for your help. ============================== [code] TCHAR* MyToUpper(TCHAR *input) { static TCHAR buffer[1000]; TCHAR *s = input; TCHAR *t= buffer; while (*s != '\0') { *t… Using tchar to convert lowercase to uppercase Programming Software Development by valleymorning …, The code below is to converts a tchar from lowercase to uppercase. Could you tell … Thank you very much. VM =============================== [code] tchar* MyToUpper(tchar *input) { static tchar buffer[1000]; tchar *s= input; tchar *t= buffer; while (*s!= '\0')… Re: Using tchar to convert lowercase to uppercase Programming Software Development by valleymorning … this work? Thanks very much, VM ============================= [code] TCHAR* MyToUpper(TCHAR *input) { static TCHAR buffer[1000]; TCHAR *s = input; TCHAR *t= buffer; while (*s != '\0') { *t… Re: Using tchar to convert lowercase to uppercase Programming Software Development by Ancient Dragon … simply remove the [b]static[/b] keyword. [code] TCHAR* MyToUpper(TCHAR *input, TCHAR* buffer) { TCHAR *s = input; TCHAR *t= buffer; while (*s != '\0') { *t = _totoupper… Re: Using tchar to convert lowercase to uppercase Programming Software Development by valleymorning … problems? Will that cause memory overflow? [code] TCHAR* MyToUpper(TCHAR *input) { TCHAR buffer[1000]; TCHAR *s = input; TCHAR *t= buffer; while (*s != '\0') { *t = _toupper… Re: Using tchar to convert lowercase to uppercase Programming Software Development by Ancient Dragon … no such data type as "tchar". Do you mean TCHAR that is defined in tchar.h? If that is right, then… TCHAR is defined as either char* or wchar_t… how to convert TCHAR to Boolean Programming Software Development by Nemo_NIIT …is [/B] [CODE]void convertStringBoolean(String* TCHAR) { bool boolVal = false; try { boolVal = …*) { System::Console::WriteLine(&quot;The string TCHAR* System::Boolean::TrueString or System::Boolean::flasestring&quot…but no use i want to convert TCHAR to boolean I am writing code in … Re: Using tchar to convert lowercase to uppercase Programming Software Development by Sudar_Gudi … the project is built by undefining UNICODE and _UNICODE macros, TCHAR in your routine defaults to ASCII 1 Byte char * string… input string. Example: If the call is as follows: [CODE]TCHAR *input = (TCHAR *) L"sudar"; Toupper(input); [/CODE] Problem with TCHAR/CHAR Programming Software Development by Excizted Hello DaniWeb. ;) I have a problem with char->tchar conversion, that i cant seem to solve. I want to … to a file, read, and then in tchar format, from the file. The TCHAR just contains some chineese symbols, and the only…);[/COLOR][/CODE] I use the messagebox to monitor how my TCHAR is doing. I hope anyone can help me solve this… Re: how to convert TCHAR to Boolean Programming Software Development by Ancient Dragon … hell is that??? >>void convertStringBoolean(String* TCHAR) Don't use TCHAR as a variable name because it's a macro… defined in standard header file tchar.h which expands to either char and wchar_t depending on… Re: how to convert TCHAR to Boolean Programming Software Development by Ancient Dragon …;>i want to mention is i have not use TCHAR as variable Yes you did. In this line [icode]void… convertStringBoolean(String* TCHAR)[/icode] the use of TCHAR is a variable name, String is a type… Re: Problem with TCHAR/CHAR Programming Software Development by cikara21 … you.. [code] /* * mbstowcs(wchar_t *wcString,char *mbString,size_t nCount); */ ... TCHAR *wcBuf=new TCHAR[100]; CHAR *mbBuf="MB STRING"; #ifdef _UNICODE… std::string to TCHAR* (Unicode) Programming Software Development by crazylunatic … am having some trouble with converting this std::string to TCHAR* (which is passed an an argument to some other … and I used mbstowcs_s to convert this const char* to TCHAR*. The compilation works fine(using VC8 compiler) but during run… character set and there the mbstowcs_s gives me a proper TCHAR*. Has anyone any suggestions? I fear I am doing… Re: std::string to TCHAR* (Unicode) Programming Software Development by crazylunatic … am having some trouble with converting this std::string to TCHAR* (which is passed an an argument to some other … and I used mbstowcs_s to convert this const char* to TCHAR*. The compilation works fine(using VC8 compiler) but during run… character set and there the mbstowcs_s gives me a proper TCHAR*. Has anyone any suggestions? I fear I am doing… Re: how to convert TCHAR to Boolean Programming Software Development by Nemo_NIIT ok Very first thing dont be so rude... i want to mention is i have not use TCHAR as variable I have use it as a type and i want to convert Converting tchar array to string array Programming Software Development by GeekInTraining …;direct.h> #include <stdio.h> #include <tchar.h> #include <Lmcons.h> #include <sstream… << "Hello, unnamed person!\n"; TCHAR szBuffer[1024]; ::GetLogicalDriveStrings(1024, szBuffer); TCHAR *pch = szBuffer; while (*pch) { _tprintf(TEXT("… Re: Problem with TCHAR/CHAR Programming Software Development by cikara21 …,const wchar_t *wcstr, size_t count) // ... CHAR *mbBuf= new CHAR[100]; TCHAR *wcBuf=_T("hello"); #ifdef _UNICODE wcstombs(mbBuf,wcBuf… Re: Problem with TCHAR/CHAR Programming Software Development by Excizted …,const wchar_t *wcstr, size_t count) // ... CHAR *mbBuf= new CHAR[100]; TCHAR *wcBuf=_T("hello"); #ifdef _UNICODE wcstombs(mbBuf,wcBuf… assigning a TCHAR char array to std::string Programming Software Development by Ashu@sym I want to assign a TCHAR char array to std::string in VC++ 2005, how should i do that? a simple assignment gives error i.e TCHAR buffer[MAX-1]; std::string data; //some operation for filling the buffer data = buffer; //This gives error Plz help me in doing this operation. Re: assigning a TCHAR char array to std::string Programming Software Development by Ancient Dragon … didn't turn it off then the compiler is mapping TCHAR into wchar_t. go to Project --> Properties (bottom menu item… Re: assigning a TCHAR char array to std::string Programming Software Development by Ashu@sym [QUOTE=Narue;437817]What error do you get?[/QUOTE] I tried to build this code in Visual C++ 2005 and i got this error: error C2679: binary '=' : no operator found which takes a right-hand operand of type 'TCHAR [260]' (or there is no acceptable conversion)