Solved

CString Mid function fails if size > 64K

Posted on 1998-07-31
2
328 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 100 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
zeroFront challenge 7 123
noX challenge 17 134
mapAB Challlenge 35 173
SQUD PROXY SERVER, UNIX, SLL/HTTPS 5 115
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…
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
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.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

749 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