Click here to Skip to main content
15,919,774 members
Home / Discussions / Managed C++/CLI
   

Managed C++/CLI

 
AnswerRe: StreamReader, StreamWriter and File Position? Pin
BuckBrown15-Oct-07 10:17
BuckBrown15-Oct-07 10:17 
GeneralRe: StreamReader, StreamWriter and File Position? [modified] Pin
Mark Salsbery15-Oct-07 11:02
Mark Salsbery15-Oct-07 11:02 
GeneralRe: StreamReader, StreamWriter and File Position? Pin
BuckBrown16-Oct-07 9:05
BuckBrown16-Oct-07 9:05 
GeneralRe: StreamReader, StreamWriter and File Position? Pin
Mark Salsbery16-Oct-07 9:26
Mark Salsbery16-Oct-07 9:26 
GeneralRe: StreamReader, StreamWriter and File Position? Pin
BuckBrown16-Oct-07 10:11
BuckBrown16-Oct-07 10:11 
GeneralRe: StreamReader, StreamWriter and File Position? Pin
Mark Salsbery16-Oct-07 10:29
Mark Salsbery16-Oct-07 10:29 
GeneralRe: StreamReader, StreamWriter and File Position? Pin
BuckBrown16-Oct-07 11:12
BuckBrown16-Oct-07 11:12 
GeneralRe: StreamReader, StreamWriter and File Position? Pin
Mark Salsbery16-Oct-07 11:27
Mark Salsbery16-Oct-07 11:27 
To insert bytes in a file, typically something like:

   open source file
   create/open temp file
   read from source file, writing to temp file, until insertion point reached.
   write insert data to temp file
   read from source file, writing to temp file, until end of source file reached.
   close files
   delete source file
   rename temp file to src file name

That's good for files of unlimited size.  For "small" files you may be able to simplify
by doing something like:

   read entire stream from just after insertion point to end (into a buffer)
   use Stream::SetLength to expand the stream the number of bytes being inserted
   write the inserted bytes at the insertion point
   write the buffered bytes after the inserted bytes

Maybe there's new stream/file classes that have insertion built in....I've never seen
any though.

Mark



Mark Salsbery
Microsoft MVP - Visual C++

Java | [Coffee]

GeneralRe: StreamReader, StreamWriter and File Position? Pin
BuckBrown16-Oct-07 11:30
BuckBrown16-Oct-07 11:30 
GeneralRe: StreamReader, StreamWriter and File Position? Pin
Mark Salsbery16-Oct-07 11:51
Mark Salsbery16-Oct-07 11:51 
QuestionHow to get HWND from System::Windows::Forms::Panel^ panel [modified] Pin
Newbie0014-Oct-07 0:35
Newbie0014-Oct-07 0:35 
AnswerRe: How to get HWND from System::Windows::Forms::Panel^ panel Pin
Mark Salsbery14-Oct-07 5:53
Mark Salsbery14-Oct-07 5:53 
GeneralRe: How to get HWND from System::Windows::Forms::Panel^ panel Pin
Newbie0014-Oct-07 7:02
Newbie0014-Oct-07 7:02 
GeneralRe: How to get HWND from System::Windows::Forms::Panel^ panel Pin
Mark Salsbery14-Oct-07 7:19
Mark Salsbery14-Oct-07 7:19 
GeneralRe: How to get HWND from System::Windows::Forms::Panel^ panel Pin
Newbie0014-Oct-07 7:29
Newbie0014-Oct-07 7:29 
GeneralRe: How to get HWND from System::Windows::Forms::Panel^ panel Pin
Mark Salsbery14-Oct-07 8:00
Mark Salsbery14-Oct-07 8:00 
GeneralRe: How to get HWND from System::Windows::Forms::Panel^ panel Pin
Newbie0014-Oct-07 8:02
Newbie0014-Oct-07 8:02 
GeneralRe: How to get HWND from System::Windows::Forms::Panel^ panel Pin
Mark Salsbery14-Oct-07 8:22
Mark Salsbery14-Oct-07 8:22 
GeneralRe: How to get HWND from System::Windows::Forms::Panel^ panel Pin
Newbie0014-Oct-07 10:04
Newbie0014-Oct-07 10:04 
GeneralRe: How to get HWND from System::Windows::Forms::Panel^ panel Pin
Mark Salsbery14-Oct-07 10:24
Mark Salsbery14-Oct-07 10:24 
GeneralRe: How to get HWND from System::Windows::Forms::Panel^ panel Pin
Newbie0014-Oct-07 10:32
Newbie0014-Oct-07 10:32 
GeneralRe: How to get HWND from System::Windows::Forms::Panel^ panel Pin
Mark Salsbery14-Oct-07 11:02
Mark Salsbery14-Oct-07 11:02 
GeneralRe: How to get HWND from System::Windows::Forms::Panel^ panel Pin
led mike15-Oct-07 4:36
led mike15-Oct-07 4:36 
GeneralRe: How to get HWND from System::Windows::Forms::Panel^ panel Pin
Mark Salsbery15-Oct-07 5:54
Mark Salsbery15-Oct-07 5:54 
GeneralRe: How to get HWND from System::Windows::Forms::Panel^ panel [modified] Pin
Newbie0015-Oct-07 7:00
Newbie0015-Oct-07 7:00 

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.