Maximum length of string??
-
:confused::confused:Hi all, can anyone tell me what is the maximum number of bytes and characters i can store using a CString variable..I need to store huge data something in MB's in some string type variable and it fails..is there any way to store any size of characters or any no of bytes in a cstring by customizing it..Please help me..I need it urgently?? Hope this is not a big problem for most of u out there?? Thanks a lot in advance.. Regards, Himanshu
-
:confused::confused:Hi all, can anyone tell me what is the maximum number of bytes and characters i can store using a CString variable..I need to store huge data something in MB's in some string type variable and it fails..is there any way to store any size of characters or any no of bytes in a cstring by customizing it..Please help me..I need it urgently?? Hope this is not a big problem for most of u out there?? Thanks a lot in advance.. Regards, Himanshu
xxhimanshu wrote: store huge data something in MB's in some string type variable and it fails Fails how?
CString
uses the heap so the theoretical limit on the string size is 2GB or your total available virtual memory. --Mike-- Ericahist | CP SearchBar v2.0.2 | Homepage | RightClick-Encrypt | 1ClickPicGrabber Actual sign at the laundromat I go to: "No tinting or dying." -
xxhimanshu wrote: store huge data something in MB's in some string type variable and it fails Fails how?
CString
uses the heap so the theoretical limit on the string size is 2GB or your total available virtual memory. --Mike-- Ericahist | CP SearchBar v2.0.2 | Homepage | RightClick-Encrypt | 1ClickPicGrabber Actual sign at the laundromat I go to: "No tinting or dying.":confused::confused:Hi, Thanks for your message. I am just trying to store a encoded XMl file data into the string..so that I do not need to decode it any time..and make it physically available to the user..hence I need to store the data into a string. But after a limit it stops appending the data to the string, I hope there cannot be any NULL into a XML file. When i try to decode it, the file is decoded successfully and hence it is in proper XML format..but when i try to store the same data into string it just stops at a point..here is the piece of code i am using.. CString S; CString XML; XML=S; CFile inFile; BYTE con[65535]; CFile outFile; if(!inFile.Open(inFilePath,CFile::modeRead|CFile::shareDenyNone)) return "Error"; if(!outFile.Open(outFilePath,CFile::modeCreate|CFile::modeWrite)) return false; CArchive ar(&inFile,CArchive::load); BYTE Result[57+1]; while(ar.ReadString(S)) { char Len=Decode(Result,S); XML+=Result; // MessageBox(NULL,XML,"XML",MB_OK); outFile.Write(Result, Len); } return XML; Please help..Thanks a lot in advance..My data in XML is around 1 MB..the file size id 1.2 MB nearly.. Regards Himanshu