void CDocumentViewView::OnInitialUpdate() { CView::OnInitialUpdate(); // TODO: Add your specialized code here and/or call the base class CreateDeviceList(); }
bool SaveXMLDoc(LPCWSTR file, BDADEVICES& d) { IXMLDOMDocumentPtr Document; IXMLDOMElementPtr root; IXMLDOMElementPtr bda_source; IXMLDOMElementPtr bda_reciever; HRESULT hr; hr = Document.CreateInstance(CLSID_DOMDocument30); if(hr==S_OK) { // these methods should not fail so don't inspect result Document->put_async(VARIANT_FALSE); Document->put_validateOnParse(VARIANT_FALSE); Document->put_resolveExternals(VARIANT_FALSE); CreatePI(Document); CreateElement(Document,L"bdainf",&root); CreateElement(Document,L"kscategory_bda_network_tuner",&bda_source); CreateElement(Document,L"kscategory_bda_receiver_component",&bda_reciever); CreateDeviceList(Document,bda_source,d.bda_source); CreateDeviceList(Document,bda_reciever,d.bda_reciever); AppendChild(bda_source,root); AppendChild(bda_reciever,root); AppendChild(root,Document); hr = Document->save(_variant_t(file)); if(hr==S_OK) { return true; } else { //notify error return false; } } else { //notify error return false; } }