Click here to Skip to main content
15,887,485 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralPrinting problem.. Pin
panthal21-Dec-07 21:07
panthal21-Dec-07 21:07 
QuestionRe: Printing problem.. Pin
David Crow22-Dec-07 4:34
David Crow22-Dec-07 4:34 
GeneralRe: Printing problem.. Pin
panthal22-Dec-07 17:04
panthal22-Dec-07 17:04 
QuestionRe: Printing problem.. Pin
David Crow23-Dec-07 2:57
David Crow23-Dec-07 2:57 
Generaliostream file content modification questions Pin
Maxwell Chen21-Dec-07 20:15
Maxwell Chen21-Dec-07 20:15 
QuestionRe: iostream file content modification questions Pin
CPallini22-Dec-07 0:37
mveCPallini22-Dec-07 0:37 
GeneralRe: iostream file content modification questions Pin
Maxwell Chen22-Dec-07 2:58
Maxwell Chen22-Dec-07 2:58 
GeneralRe: iostream file content modification questions Pin
CPallini22-Dec-07 3:24
mveCPallini22-Dec-07 3:24 
Maxwell Chen wrote:
My target is oem*.inf in C:\Windows\inf. GetPrivateProfileString is for .ini files. It looks like also working for .inf files.

Indeed it works whatever file extension is (only the file format is important, it must be *.ini compliant)


Maxwell Chen wrote:
Thanks!

You're welcome.



Maxwell Chen wrote:
By the way if the target is gereral article content, what would be a better way (efficient) to modify and to delete substrings in the file?

For example (below paragraph), to delete "will", and locate the next word "make" and append an "s" to form "makes".

Why do you want to use iostream when GetPrivateProfileString will make your task so much easier?


You have to:
(1) load the file in a buffer.
(2) make all you search/replace/add operations into the buffer.
(3) write the buffer to the initial file.

Point (2) maybe accomplished with hand-crafted search operations, using a string class (for instance std::string or CString) or a powerful tool like a Regular Expression parser (see for instance http://www.ultrapico.com/Expresso.htm[^]).

Smile | :)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.

[my articles]


Generaltray icon -right click option Pin
guru moorthy.k21-Dec-07 19:01
guru moorthy.k21-Dec-07 19:01 
GeneralRe: tray icon -right click option Pin
Mark Salsbery22-Dec-07 7:23
Mark Salsbery22-Dec-07 7:23 
Generalcannot create unicode file using wofstream Pin
xanagan66621-Dec-07 18:02
xanagan66621-Dec-07 18:02 
Generalproblem about alloc memory in another library and free in the main project Pin
kcynic21-Dec-07 15:01
kcynic21-Dec-07 15:01 
GeneralRe: problem about alloc memory in another library and free in the main project Pin
Mark Salsbery21-Dec-07 15:10
Mark Salsbery21-Dec-07 15:10 
GeneralRe: problem about alloc memory in another library and free in the main project Pin
kcynic21-Dec-07 15:26
kcynic21-Dec-07 15:26 
GeneralRe: problem about alloc memory in another library and free in the main project Pin
Mark Salsbery21-Dec-07 15:33
Mark Salsbery21-Dec-07 15:33 
GeneralRe: problem about alloc memory in another library and free in the main project Pin
kcynic21-Dec-07 18:16
kcynic21-Dec-07 18:16 
GeneralRe: problem about alloc memory in another library and free in the main project Pin
Stephen Hewitt21-Dec-07 19:30
Stephen Hewitt21-Dec-07 19:30 
GeneralRe: problem about alloc memory in another library and free in the main project Pin
kcynic21-Dec-07 19:41
kcynic21-Dec-07 19:41 
GeneralRe: problem about alloc memory in another library and free in the main project Pin
kcynic21-Dec-07 21:05
kcynic21-Dec-07 21:05 
GeneralNumber Lock activation Pin
Larry Mills Sr21-Dec-07 13:52
Larry Mills Sr21-Dec-07 13:52 
GeneralRe: Number Lock activation Pin
Mark Salsbery21-Dec-07 14:59
Mark Salsbery21-Dec-07 14:59 
GeneralRe: Number Lock activation Pin
Larry Mills Sr22-Dec-07 9:50
Larry Mills Sr22-Dec-07 9:50 
Question.RC file formating differences Pin
KayakCoder21-Dec-07 10:40
KayakCoder21-Dec-07 10:40 
GeneralI hate programming today (project conflict/calling convention conflict, ... ) Pin
Maximilien21-Dec-07 7:24
Maximilien21-Dec-07 7:24 
GeneralGetting the bitmap in and out of a CGIPLUS Image class Pin
Anthony Appleyard21-Dec-07 6:39
Anthony Appleyard21-Dec-07 6:39 

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.