• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 333
  • Last Modified:

CString Mid function fails if size > 64K

I have a CString whose size is > 64K. I need to use the Mid of the string from 64300 to end.
But it returns only upto 65,535. But i need to get the whole string .  Is the best solution?
0
mganesan
Asked:
mganesan
1 Solution
 
trestanCommented:
I did not find the documentation about the length limit, may be it is sth about the memory. But to solve your problem, I think you can try this method:
int StartPosition = 64300;
OriginCStrn += '\0';
CString SubStrn = OriginCStrn[StartPosition];
while(OriginCStrn[StartPosition]!='\0')
{
StartPosition++;
OriginCStrn += OriginCStrn[StartPosition];
}
I think it should work. Or use GetAt() if it works. Pls try it. Good luck.
0
 
slinkyCommented:
Where is the CString being created in memory?
Try doing a new CString (forcing it onto the heap).
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now