Solved

CString Mid function fails if size > 64K

Posted on 1998-07-31
2
319 Views
Last Modified: 2013-11-19
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
Comment
Question by:mganesan
2 Comments
 
LVL 8

Accepted Solution

by:
trestan earned 100 total points
Comment Utility
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
 
LVL 1

Expert Comment

by:slinky
Comment Utility
Where is the CString being created in memory?
Try doing a new CString (forcing it onto the heap).
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now