CString
-
Hello. Is there a way to read the (stdout) output from another application directly into a CString? ie) when I specify my application in a series of piped command-line apps, what is the best way to read from stdin, so that I can read data directly into a CString rather than have to worry about the length of the lines of input data? Thanks in advance. James.
-
Hello. Is there a way to read the (stdout) output from another application directly into a CString? ie) when I specify my application in a series of piped command-line apps, what is the best way to read from stdin, so that I can read data directly into a CString rather than have to worry about the length of the lines of input data? Thanks in advance. James.
I do not know if you can do that using
stdin
without using a intermediate buffer of some kind. You can always continue to readstdin
in chunks, like reading it into a 1KB buffer and appending the buffer to theCString
, until you hit the end of the output data (EOF). There may be a way to do it using the C++ stream classes andstd::string
, but I am not certain if you will not still have to use some intermediate transfer mechanism. Peace!-=- James
Please rate this message - let me know if I helped or not! * * *
If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong!
Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road!
See DeleteFXPFiles -
I do not know if you can do that using
stdin
without using a intermediate buffer of some kind. You can always continue to readstdin
in chunks, like reading it into a 1KB buffer and appending the buffer to theCString
, until you hit the end of the output data (EOF). There may be a way to do it using the C++ stream classes andstd::string
, but I am not certain if you will not still have to use some intermediate transfer mechanism. Peace!-=- James
Please rate this message - let me know if I helped or not! * * *
If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong!
Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road!
See DeleteFXPFilesThanks for the reply. I have ended up using a 'string' class object to read into from cin and getting a const char pointer to it, so that I can get the data into a CString. What a mess, but it works. Thanks. James.