Re: document class
here`s one example for the network class - at the moment I`ve
installed one public member in the document class.... public because
the view also needs this variable... but maybe there`s a better
solution to transfer this variable to the view class
class CMIAppDoc : public CDocument
{
protected: // Nur aus Serialisierung erstellen
CMIAppDoc();
DECLARE_DYNCREATE(CMIAppDoc)
public:
CNetwork m_network;
CXmlFile XmlFile;
};
void CMIAppView::OnInitialUpdate()
{
CFormView::OnInitialUpdate();
//init network thread for http webserver (a valid view
must be available -> first place here to init this thread
((CMIAppDoc *)GetDocument())-
m_network.InitThreads((CMIAppDoc *)GetDocument());
}
//UpdateData is called from the visible window which received the
information / date from the http post message - e.g. the new network
settings which have to be validated in the network class and if valid -
update xml file
int CMIAppDoc::UpdateData(CStringList *slist)
{
//the CstringList includes all rxd information from the post
http port80 msg (e.g. network settings, display settings, comport
settings)
//validate display settings.... and so on
//validate network settings from the rxd http post message
DWORD rtn = m_network.ValidateData(slist);
if(!rtn)
return FALSE;
//update xml file with these new information
XmlFile.UpdateXmlData(slist);
//update view
this->UpdateAllViews(NULL);
}