Click here to Skip to main content
15,920,956 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionRe: A question about locking thread Pin
Toubou4-Sep-06 18:51
Toubou4-Sep-06 18:51 
AnswerRe: A question about locking thread Pin
Waldermort4-Sep-06 23:35
Waldermort4-Sep-06 23:35 
Questionuser.dmp issue Pin
Rob Caldecott4-Sep-06 6:40
Rob Caldecott4-Sep-06 6:40 
Answerwindbg to the rescue! Pin
Rob Caldecott4-Sep-06 6:58
Rob Caldecott4-Sep-06 6:58 
GeneralRe: windbg to the rescue! Pin
Waldermort4-Sep-06 7:03
Waldermort4-Sep-06 7:03 
Questionreplacing a string with a sub-string Pin
jon-804-Sep-06 6:29
professionaljon-804-Sep-06 6:29 
AnswerRe: replacing a string with a sub-string Pin
Graham Shanks4-Sep-06 12:28
Graham Shanks4-Sep-06 12:28 
Questionreduce the size of an array of chars.... Pin
jon-804-Sep-06 6:22
professionaljon-804-Sep-06 6:22 
This function REMOVES sub-string of strText starting at iStart and resuming at iStart + iNoOfChars:

string CSentenceList::subString(char* strText, int iStart, int iNoOfChars)
{
int iLength = strlen(strText);
char l_Substring[MAX_SENTENCE_LENGTH];

// copy character by character till iStart
for (int iFirstCount = 0; iFirstCount < iStart; iFirstCount++)
{l_Substring[iFirstCount] = strText[iFirstCount];}

// copy from iContinue till the end of the text
int iContinue = iStart + iNoOfChars;
for (int iSecondCount = iContinue; iSecondCount < iLength; iSecondCount++, iFirstCount++)
{l_Substring[iFirstCount] = strText[iSecondCount];}

return (string) l_Substring;
}

However, the string returned is terminated by a series of unreadable characters. For example, substring ("joe123joe",3,3) should return "joejoe", but it returns:
joejoe&#9568;&#9568;&#9568;&#9568;&#9568;&#9568;&#9568;&#9568;... // up to the value of MAX_SENTENCE_LENGTH (1000)

I have tried using dynamic arrays of chars but I had trouble converting them to std::string type.



Jon
AnswerRe: reduce the size of an array of chars.... Pin
Waldermort4-Sep-06 6:25
Waldermort4-Sep-06 6:25 
GeneralRe: reduce the size of an array of chars.... Pin
jon-804-Sep-06 6:32
professionaljon-804-Sep-06 6:32 
GeneralRe: reduce the size of an array of chars.... Pin
Waldermort4-Sep-06 6:43
Waldermort4-Sep-06 6:43 
GeneralRe: reduce the size of an array of chars.... Pin
jon-804-Sep-06 8:11
professionaljon-804-Sep-06 8:11 
QuestionControl handles Pin
Oliver1234-Sep-06 6:17
Oliver1234-Sep-06 6:17 
AnswerRe: Control handles Pin
Waldermort4-Sep-06 6:26
Waldermort4-Sep-06 6:26 
AnswerRe: Control handles Pin
gregdolley4-Sep-06 22:21
gregdolley4-Sep-06 22:21 
AnswerRe: Control handles Pin
Hamid_RT11-Sep-06 9:52
Hamid_RT11-Sep-06 9:52 
Questionscanning until the EOF Pin
Desmo164-Sep-06 6:15
Desmo164-Sep-06 6:15 
AnswerRe: scanning until the EOF Pin
Waldermort4-Sep-06 6:30
Waldermort4-Sep-06 6:30 
GeneralRe: scanning until the EOF Pin
Desmo164-Sep-06 6:40
Desmo164-Sep-06 6:40 
GeneralRe: scanning until the EOF Pin
Waldermort4-Sep-06 6:49
Waldermort4-Sep-06 6:49 
Questionneed help Pin
amzeus4-Sep-06 6:04
amzeus4-Sep-06 6:04 
AnswerRe: need help Pin
Cedric Moonen4-Sep-06 6:12
Cedric Moonen4-Sep-06 6:12 
AnswerRe: need help Pin
Hamid_RT4-Sep-06 22:32
Hamid_RT4-Sep-06 22:32 
QuestionSir,How Can Find or See WinMain Function in Simple MFC Application ? Pin
CodeVarma4-Sep-06 5:54
CodeVarma4-Sep-06 5:54 
AnswerRe: Sir,How Can Find or See WinMain Function in Simple MFC Application ? Pin
Hamid_RT11-Sep-06 9:46
Hamid_RT11-Sep-06 9:46 

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.