![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Nov 2004
Posts: 5
Rep Power: 0
![]() |
I have a graphics plotting program that doesn't have much of an 'on-the-fly' input output interface. the user either has to write a script file or has to use the limited options in the dialog boxes.
softwares like AutoCAD and the FEA software like ABAQUS, NASTRAN etc.. have a text box at the bottom of their screen thru which users can enter commands and the program outputs stuff onto an output textbox. can someone tell me or point me to some place that tells me how to best implement this sort of thing ? the I/O routines in my program use the iostream classes- basically reads commands from some script file and prints out stuff to some output file or cout. e.g. a typical routine would be: void readMesh(istream*, ostream*, other arguments) {} now, the GUI uses MFC and part of my confustion is how do i redirect all this program ouput that goes to the (ostream*) to go to a textbox in the GUI instead, without making major or atleast tedious mods to the existing code. and similarly, how do i redirect input from a textbox to go to an istream ? is this even possible?? if not, i guess i will have to change the whole program structure, but even then i would like to know how it is implemented in the big commercial softwares like autocad so i get it right atleast this time. thanks |
|
|
|
|
|
#2 |
|
Expert Programmer
|
You can redirect input to an istream using the istringstream class, simply put it converts the input string generated in MFC into an inputstream.
__________________
Clifford Matthew Roche <geek@cliffordroche.com> Web Hosting: http://www.crd-hosting.com Consulting: http://www.crdev-consulting.com |
|
|
|
|
|
#3 |
|
Newbie
Join Date: Nov 2004
Posts: 5
Rep Power: 0
![]() |
thanks, this is what i was looking for.
so, now i need to implement the whole textboxes and see how it all works out. btw, do u know if there is a limit on the size of the string that an istringstream object can hold ? cos i wud expect my output textbox to have enuf text to keep scrolling on for many pages. |
|
|
|
|
|
#4 |
|
Professional Programmer
Join Date: Nov 2004
Posts: 250
Rep Power: 4
![]() |
>do u know if there is a limit on the size of the string that an istringstream object can hold ?
numeric_limits<streamsize>::max() |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|