Hello Tek-Tips Forum,
Before describing my problem I should give a short background. I
am a forest research scientist and my applications have been stictly
command window programs. I am now trying to learn some C++ and
MFC so I can build some simple front-end user interfaces for future
applications.
My first application has a simple design. I want to:
1) read in some data,
2) store that data,
3) print some initial info to the screen,
4) process the data,
5) and print final results to screen and disc.
I have been successful with #1 and #2 above. I can get a Open File dialog
box to open and then store the raw data into a CArray that
is associated with the main document. My difficulty is that I
cannot figure out how to print up the raw data onto the screen (or view
as it is).
Here are some relevant pieces:
a)
My program is a SDI and thus has only a single view. The idea is that
I would print up initial raw data to the screen (after I read it in
from disc) and that data would remain on the screen while it is
being processed (I don't care if the screen version is editable, but
for the time I will assume it can be). So what I have for my view class
is:
class CVerstraView : public CEditView
{
protected: // create from serialization only
CVerstraView();
DECLARE_DYNCREATE(CVerstraView)
// Attributes
public:
CVerstraDoc* GetDocument();
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CVerstraView)
public:
virtual void OnDraw(CDC* pDC); // overridden to draw this view
//more MFC generated stuff that I am leaving out
}
Now, from what I can understand, my C++ and MFC books indicate that the
function OnDraw is called up every time the view needs updating. But
in my debugger, once I open my input data file, I never seem to enter
the OnDraw() function. So I'm a little confused. For this application
I simply wish to use my CVerstraView as I would an old command style
window. I just want to spit formatted data and strings out to it as
I would with printf() statements in c.
Could someone lead me in the right direction of how I can do this. I
apologize for the simplicity of the problem. I do have 3 decent books
on C++ and some on MFC but they are very poor in examples of how to
just get data in and out to the screen.
I thank you in advance for any help/advice and I am very appreciative
of this forum and the opportunity to seek out such help.
David H. Graetz
Before describing my problem I should give a short background. I
am a forest research scientist and my applications have been stictly
command window programs. I am now trying to learn some C++ and
MFC so I can build some simple front-end user interfaces for future
applications.
My first application has a simple design. I want to:
1) read in some data,
2) store that data,
3) print some initial info to the screen,
4) process the data,
5) and print final results to screen and disc.
I have been successful with #1 and #2 above. I can get a Open File dialog
box to open and then store the raw data into a CArray that
is associated with the main document. My difficulty is that I
cannot figure out how to print up the raw data onto the screen (or view
as it is).
Here are some relevant pieces:
a)
My program is a SDI and thus has only a single view. The idea is that
I would print up initial raw data to the screen (after I read it in
from disc) and that data would remain on the screen while it is
being processed (I don't care if the screen version is editable, but
for the time I will assume it can be). So what I have for my view class
is:
class CVerstraView : public CEditView
{
protected: // create from serialization only
CVerstraView();
DECLARE_DYNCREATE(CVerstraView)
// Attributes
public:
CVerstraDoc* GetDocument();
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CVerstraView)
public:
virtual void OnDraw(CDC* pDC); // overridden to draw this view
//more MFC generated stuff that I am leaving out
}
Now, from what I can understand, my C++ and MFC books indicate that the
function OnDraw is called up every time the view needs updating. But
in my debugger, once I open my input data file, I never seem to enter
the OnDraw() function. So I'm a little confused. For this application
I simply wish to use my CVerstraView as I would an old command style
window. I just want to spit formatted data and strings out to it as
I would with printf() statements in c.
Could someone lead me in the right direction of how I can do this. I
apologize for the simplicity of the problem. I do have 3 decent books
on C++ and some on MFC but they are very poor in examples of how to
just get data in and out to the screen.
I thank you in advance for any help/advice and I am very appreciative
of this forum and the opportunity to seek out such help.
David H. Graetz