Click here to Skip to main content
15,898,222 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Passing a function as a argument to a function? Pin
Michael Dunn27-Nov-04 8:38
sitebuilderMichael Dunn27-Nov-04 8:38 
GeneralHelp with formatting a CString Pin
Chris Meech26-Nov-04 9:05
Chris Meech26-Nov-04 9:05 
GeneralRe: Help with formatting a CString Pin
PJ Arends26-Nov-04 10:29
professionalPJ Arends26-Nov-04 10:29 
GeneralRe: Help with formatting a CString Pin
Jack Puppy26-Nov-04 13:14
Jack Puppy26-Nov-04 13:14 
GeneralRe: Help with formatting a CString Pin
Chris Meech29-Nov-04 3:32
Chris Meech29-Nov-04 3:32 
GeneralRe: Help with formatting a CString Pin
Gary R. Wheeler27-Nov-04 2:30
Gary R. Wheeler27-Nov-04 2:30 
GeneralRe: Help with formatting a CString Pin
Chris Meech29-Nov-04 3:38
Chris Meech29-Nov-04 3:38 
GeneralRe: Help with formatting a CString Pin
Gary R. Wheeler29-Nov-04 15:12
Gary R. Wheeler29-Nov-04 15:12 
Looking back over the code I supplied, it has one slight bug: if the strings being substituted into the format include "%s", the substitution will take place there, rather than in the original format. To fix it, use the following instead:
CString str,fmt;
CStringArray arr;
fmt = _T("%s blah %s blah ... %s blah");
str = fmt;
int offset = str.Find(_T("%s"));
int index = 0;
while ((offset >= 0) && (index < arr.GetSize())) {
    str = str.Left(offset) + arr[index] + str.Mid(offset+2);
    offset = str.Find(_T("%s"),(offset+arr[index].GetLength()));
    index++;
}
Sorry about that Blush | :O .


Software Zen: delete this;
GeneralRe: Help with formatting a CString Pin
Chris Meech30-Nov-04 3:18
Chris Meech30-Nov-04 3:18 
Generaladd line number indicator in MFC document project Pin
zhngmm26-Nov-04 8:45
zhngmm26-Nov-04 8:45 
GeneralRe: add line number indicator in MFC document project Pin
PJ Arends26-Nov-04 10:31
professionalPJ Arends26-Nov-04 10:31 
GeneralRe: add line number indicator in MFC document project Pin
zhngmm26-Nov-04 12:26
zhngmm26-Nov-04 12:26 
GeneralArray - Strings of Characters. Pin
raf-sp26-Nov-04 7:13
raf-sp26-Nov-04 7:13 
GeneralRe: Array - Strings of Characters. Pin
suiram4026-Nov-04 7:18
suiram4026-Nov-04 7:18 
GeneralRe: Array - Strings of Characters. Pin
John R. Shaw26-Nov-04 7:22
John R. Shaw26-Nov-04 7:22 
GeneralRe: Array - Strings of Characters. Pin
raf-sp26-Nov-04 7:34
raf-sp26-Nov-04 7:34 
GeneralXP CFileDialog & RichEdit multithreaded app Pin
suiram4026-Nov-04 6:58
suiram4026-Nov-04 6:58 
GeneralRe: XP CFileDialog &amp; RichEdit multithreaded app Pin
suiram4026-Nov-04 10:24
suiram4026-Nov-04 10:24 
GeneralThousands Separator Pin
BRIMID26-Nov-04 6:44
BRIMID26-Nov-04 6:44 
GeneralRe: Thousands Separator Pin
Maximilien26-Nov-04 7:01
Maximilien26-Nov-04 7:01 
Generaldo while loop. Pin
Anonymous26-Nov-04 6:00
Anonymous26-Nov-04 6:00 
GeneralReading Outlook PST files Pin
Kri526-Nov-04 5:21
Kri526-Nov-04 5:21 
GeneralRe: Reading Outlook PST files Pin
David Cader26-Nov-04 6:05
David Cader26-Nov-04 6:05 
QuestionHIMETRIC_INCH undeclared??! wth? Pin
Kuniva26-Nov-04 5:06
Kuniva26-Nov-04 5:06 
AnswerRe: HIMETRIC_INCH undeclared??! wth? Pin
Alexander M.,26-Nov-04 5:13
Alexander M.,26-Nov-04 5:13 

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.