Click here to Skip to main content
15,925,061 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Hex addition and Hex-to-ASCII string conversion with VC++ Pin
George L. Jackson7-Dec-06 23:57
George L. Jackson7-Dec-06 23:57 
QuestionProblem with CString length [modified] Pin
Milos Djokovic2-Dec-06 14:23
Milos Djokovic2-Dec-06 14:23 
AnswerRe: Problem with CString length Pin
David Crow2-Dec-06 15:23
David Crow2-Dec-06 15:23 
GeneralRe: Problem with CString length Pin
Milos Djokovic2-Dec-06 16:20
Milos Djokovic2-Dec-06 16:20 
GeneralRe: Problem with CString length Pin
Joe Woodbury2-Dec-06 18:39
professionalJoe Woodbury2-Dec-06 18:39 
GeneralRe: Problem with CString length Pin
Joe Woodbury2-Dec-06 18:46
professionalJoe Woodbury2-Dec-06 18:46 
GeneralRe: Problem with CString length Pin
Milos Djokovic2-Dec-06 20:58
Milos Djokovic2-Dec-06 20:58 
GeneralRe: Problem with CString length Pin
ThatsAlok3-Dec-06 20:05
ThatsAlok3-Dec-06 20:05 
Milos Djokovic wrote:
while(!tagFound) { chPrev[0] = chCurrent[0]; this->Read(chCurrent, 1); // typeof (this) == CFile* ... rValBuffer += chCurrent; // <- here is the problem ... }

this is very Bad!! as reallocation of Memory in CString is taking place at every iteration!.. you have to come out of some better method! since you reading one char at time you can follow this strategy!

list<TCHAR> listCharacter;
list<TCHAR>::Iterator itList;

while(!tagFound) {
chPrev[0] = chCurrent[0];
this->Read(chCurrent, 1); // typeof (this) == CFile*
...
listCharacter. push_back(*chCurrent);
...
}

CString str(" ",listCharacter.size()+1);

int iCount=0;
for(itList = listCharacter.begin(), ;
itList != listCharacter.end();
itList ++)
{
str.SetAt(iCount++)=*itList ;

}

rValBuffer =str;



<div class='ForumSig'>"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers, Alok Gupta VC Forum Q&A :- I/ IV Support CRY- Child Relief and you </div>
GeneralRe: Problem with CString length Pin
David Crow4-Dec-06 3:28
David Crow4-Dec-06 3:28 
GeneralRe: Problem with CString length Pin
ThatsAlok4-Dec-06 18:27
ThatsAlok4-Dec-06 18:27 
QuestionRe: Problem with CString length Pin
David Crow5-Dec-06 2:33
David Crow5-Dec-06 2:33 
Questionstd::sort in Debug builds Pin
Bartosz Bien2-Dec-06 11:43
Bartosz Bien2-Dec-06 11:43 
QuestionHow to get the file handle of an ifstream Pin
Vancouver2-Dec-06 9:55
Vancouver2-Dec-06 9:55 
AnswerRe: How to get the file handle of an ifstream Pin
CPallini2-Dec-06 10:27
mveCPallini2-Dec-06 10:27 
GeneralRe: How to get the file handle of an ifstream Pin
Vancouver2-Dec-06 15:01
Vancouver2-Dec-06 15:01 
GeneralRe: How to get the file handle of an ifstream Pin
CPallini2-Dec-06 22:00
mveCPallini2-Dec-06 22:00 
QuestionWM_VSCROLL simple question Pin
LightTD2-Dec-06 9:39
LightTD2-Dec-06 9:39 
GeneralRe: WM_VSCROLL simple question Pin
prasad_som10-Dec-06 23:25
prasad_som10-Dec-06 23:25 
QuestionCan't Find gdiplus.h in Cylinder Progress Ctrl Demo files Pin
Larry Mills Sr2-Dec-06 9:25
Larry Mills Sr2-Dec-06 9:25 
AnswerRe: Can't Find gdiplus.h in Cylinder Progress Ctrl Demo files Pin
Joe Woodbury2-Dec-06 9:59
professionalJoe Woodbury2-Dec-06 9:59 
AnswerRe: Can't Find gdiplus.h in Cylinder Progress Ctrl Demo files Pin
Christian Graus2-Dec-06 10:09
protectorChristian Graus2-Dec-06 10:09 
GeneralRe: Can't Find gdiplus.h in Cylinder Progress Ctrl Demo files Pin
Larry Mills Sr2-Dec-06 10:22
Larry Mills Sr2-Dec-06 10:22 
AnswerRe: Can't Find gdiplus.h in Cylinder Progress Ctrl Demo files Pin
PJ Arends2-Dec-06 11:31
professionalPJ Arends2-Dec-06 11:31 
QuestionNon-modal CDialog vanishing Pin
mav.northwind2-Dec-06 9:17
mav.northwind2-Dec-06 9:17 
AnswerRe: Non-modal CDialog vanishing Pin
mav.northwind4-Dec-06 18:33
mav.northwind4-Dec-06 18:33 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.