[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

CString Mid function fails if size > 64K

Posted on 1998-07-31
2
Medium Priority
?
332 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 8

Accepted Solution

by:
trestan earned 200 total points
ID: 1320049
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
ID: 1320050
Where is the CString being created in memory?
Try doing a new CString (forcing it onto the heap).
0

Featured Post

Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
In this post we will learn different types of Android Layout and some basics of an Android App.
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.
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

649 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