Thanks for the help
2 messages in this thread
Jan,
Thanks for your help. I was able to open and save files according to
their document type. I am however, still having problems with accessing data
in my second view. In my second view class CEx2View OnDraw function I am trying
to access data from the associated document class. I assume that the
AddDocTemplate makes the association between the view and the document so in
the OnDraw function the line CDocument* pDoc=GetDocument(); returns a pointer
to the associated document. From this point on I would think I could access
any public data in the 2nd document class by using statements such as
pDoc->icounter=5; where icounter is defined in the 2nd document class. I've
also included the documents header file in CEx2View.cpp. For some reason the
compiler can't associate the pDoc call to the correct document. I still get the
'icounter' is not a member of CDocument error message. I would appreciate any
additional insight into this problem. Thanks
Carol,
> I still get the 'icounter' is not a member
> of CDocument error message.
i think your problem will be solved if you cast the document pointer to pointer
to you document class. Like:
CMySecondDocument *pDoc = (CMySecondDocument *)GetDocument( );
Let me know if this is what was missing,
Jan