Click here to Skip to main content
15,905,686 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Mario Bros Pin
Snyp16-Aug-03 6:02
Snyp16-Aug-03 6:02 
GeneralRe: Mario Bros Pin
John R. Shaw16-Aug-03 9:33
John R. Shaw16-Aug-03 9:33 
GeneralRe: Mario Bros Pin
parths17-Aug-03 17:25
parths17-Aug-03 17:25 
GeneralCSocket OnReceive Pin
prabagarm16-Aug-03 2:41
prabagarm16-Aug-03 2:41 
GeneralRe: CSocket OnReceive Pin
pxw16-Aug-03 11:37
pxw16-Aug-03 11:37 
QuestionHow to convert from .DOC to .PDF, please help me .......... Pin
Atif Bashir16-Aug-03 1:43
Atif Bashir16-Aug-03 1:43 
AnswerRe: How to convert from .DOC to .PDF, please help me .......... Pin
pxw16-Aug-03 10:48
pxw16-Aug-03 10:48 
GeneralDocument/View question Pin
7stud16-Aug-03 0:21
7stud16-Aug-03 0:21 
Hi,

I'm just starting Visual C++, and in my book--Ivor Horton's Beginning Visual C++ 6--there is an initial section talking about how "data" is stored in a document, and the view displays all or part of the data in a document.

Then it goes into how to draw in a window with functions like LineTo() and Arc(), but what confuses me is those functions are in the OnDraw() function in the view class.

The first line of the OnDraw() function is this:
<br />
void CSketcherView::OnDraw(CDC* pDC)<br />
{ <br />
    CSketcher* pDoc = GetDocument();<br />


which seems to make sense--my thought was we would be using pDoc to store the data in the document object and then display it with the view object, but the next lines are:

<br />
void CSketcherView::OnDraw(CDC* pDC)<br />
{ <br />
    CSketcher* pDoc = GetDocument();<br />
<br />
    pDC->MoveTo(50,50);<br />
    pDC->LineTo(50,200);<br />
}

And, when I compile that, it draws a line in the application window. Well, as you can see pDoc was never used to access the document object, and yet the view class displayed data in the application window--I thought the view displays all or part of the data in a document. It seems to me the document got left out of the equation. What's the explanation for that?
GeneralRe: Document/View question Pin
ColinDavies16-Aug-03 3:44
ColinDavies16-Aug-03 3:44 
GeneralRe: Document/View question Pin
Ravi Bhavnani16-Aug-03 7:09
professionalRavi Bhavnani16-Aug-03 7:09 
GeneralRe: Document/View question Pin
7stud16-Aug-03 8:51
7stud16-Aug-03 8:51 
GeneralRe: Document/View question Pin
John R. Shaw16-Aug-03 10:05
John R. Shaw16-Aug-03 10:05 
GeneralRe: Document/View question Pin
7stud16-Aug-03 20:19
7stud16-Aug-03 20:19 
GeneralRe: Document/View question Pin
Bob Stanneveld17-Aug-03 5:15
Bob Stanneveld17-Aug-03 5:15 
Generalhooking Pin
kafchan200316-Aug-03 0:19
kafchan200316-Aug-03 0:19 
GeneralRe: hooking Pin
Alexander M.,16-Aug-03 14:47
Alexander M.,16-Aug-03 14:47 
GeneralRe: hooking Pin
kafchan200318-Aug-03 0:27
kafchan200318-Aug-03 0:27 
Generalvectors. Pin
WREY15-Aug-03 23:30
WREY15-Aug-03 23:30 
GeneralRe: vectors. Pin
Neville Franks15-Aug-03 23:42
Neville Franks15-Aug-03 23:42 
GeneralRe: vectors. Pin
Anonymous16-Aug-03 4:30
Anonymous16-Aug-03 4:30 
GeneralRe: vectors. Pin
markkuk16-Aug-03 6:29
markkuk16-Aug-03 6:29 
GeneralRe: vectors. Pin
ZoogieZork16-Aug-03 6:32
ZoogieZork16-Aug-03 6:32 
GeneralWorked like a charm! Pin
WREY16-Aug-03 7:37
WREY16-Aug-03 7:37 
Generalproblem in creating Modeless window Pin
Ph@ntom15-Aug-03 19:30
Ph@ntom15-Aug-03 19:30 
GeneralRe: problem in creating Modeless window Pin
Steve Mayfield15-Aug-03 20:16
Steve Mayfield15-Aug-03 20:16 

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.