static void GetGUIDs(IXMLDOMElement* e, std::vector<GUID>& v) { HRESULT hr; IXMLDOMNodeListPtr children; long listlength; hr = e->get_childNodes(&children); if(hr!=S_OK) throw _com_error(hr); hr = children->get_length(&listlength); if(hr!=S_OK) throw _com_error(hr); for(size_t n=0;n<listlength;n++) { IXMLDOMElementPtr item; IXMLDOMNodePtr itemnode; _variant_t var; GUID guid; hr = children->get_item(n,&itemnode); if(hr!=S_OK) throw _com_error(hr); item = itemnode; hr = item->getAttribute(_bstr_t(L"name"),&var); if(hr!=S_OK) throw _com_error(hr); string_to_guid((LPCWSTR)(_bstr_t)var,&guid); v.push_back(guid); } }
static void GetStrings(IXMLDOMElement* e, std::vector<std::wstring>& v) { HRESULT hr; IXMLDOMNodeListPtr children; long listlength; hr = e->get_childNodes(&children); if(hr!=S_OK) throw _com_error(hr); hr = children->get_length(&listlength); if(hr!=S_OK) throw _com_error(hr); for(size_t n=0;n<listlength;n++) { IXMLDOMElementPtr item; IXMLDOMNodePtr itemnode; _variant_t var; std::wstring str; hr = children->get_item(n,&itemnode); if(hr!=S_OK) throw _com_error(hr); item = itemnode; hr = item->getAttribute(_bstr_t(L"value"),&var); if(hr!=S_OK) throw _com_error(hr); str = (LPCWSTR)(_bstr_t)var; v.push_back(str); } }
static void GetULongs(IXMLDOMElement* e,std::vector<unsigned long>& v) { HRESULT hr; IXMLDOMNodeListPtr children; long listlength; hr = e->get_childNodes(&children); if(hr!=S_OK) throw _com_error(hr); hr = children->get_length(&listlength); if(hr!=S_OK) throw _com_error(hr); for(size_t n=0;n<listlength;n++) { IXMLDOMElementPtr item; IXMLDOMNodePtr itemnode; _variant_t var; unsigned long val; hr = children->get_item(n,&itemnode); if(hr!=S_OK) throw _com_error(hr); item = itemnode; hr = item->getAttribute(_bstr_t(L"val"),&var); if(hr!=S_OK) throw _com_error(hr); val = (unsigned long)var; v.push_back(val); } }
static void GetGUIDLists(IXMLDOMElement* e,std::map<unsigned long,std::vector<GUID> >& v) { HRESULT hr; IXMLDOMNodeListPtr children; long listlength; hr = e->get_childNodes(&children); if(hr!=S_OK) throw _com_error(hr); hr = children->get_length(&listlength); if(hr!=S_OK) throw _com_error(hr); for(size_t n=0;n<listlength;n++) { IXMLDOMElementPtr item; IXMLDOMNodePtr itemnode; _variant_t var; hr = children->get_item(n,&itemnode); if(hr!=S_OK) throw _com_error(hr); item = itemnode; hr = item->getAttribute(_bstr_t(L"id"),&var); if(hr!=S_OK) throw _com_error(hr); GetGUIDs(item,v[(unsigned long)var]); } }
HRESULT CPageEvents::PopulateTreeAndList() { // Get the XML text of the logger's current status CComBSTR bstrEventList; RETURN_FAILED(m_spEventLogger->get_EventList(&bstrEventList)); // Load the XML text into the XMLDOM object VARIANT_BOOL bSucceeded; RETURN_FAILED(m_spXMLDoc->loadXML(bstrEventList, &bSucceeded)); if (!bSucceeded) return E_FAIL; // Get the root element IXMLDOMElementPtr spRoot; RETURN_FAILED(m_spXMLDoc->get_documentElement(&spRoot)); #ifdef _DEBUG { // Ensure that the root element tag is <AGCEvents> CComBSTR bstrRoot; ASSERT(SUCCEEDED(spRoot->get_tagName(&bstrRoot))); ASSERT(0 == wcscmp(bstrRoot, L"AGCEvents")); } #endif // _DEBUG // Recursively process the children of each group RETURN_FAILED(AddXMLNodeToTree(spRoot, TVI_ROOT)); // Caculate the column widths m_cxMaxType += 16 + 2; // Adjust for icon and padding int cxScroll = GetSystemMetrics(SM_CXVSCROLL); // Get the width of the list control's client area CRect rect; m_listEvents.GetClientRect(rect); // Compute the Name column to fit the maximum width int cxTotal = m_cxMaxType + m_cxMaxID + cxScroll; int cxName = rect.Width() - cxTotal; // Set the column widths LVCOLUMN lvcol = {LVCF_WIDTH}; lvcol.cx = m_cxMaxType; m_listEvents.SetColumn(0, &lvcol); lvcol.cx = m_cxMaxID; m_listEvents.SetColumn(1, &lvcol); lvcol.cx = cxName; m_listEvents.SetColumn(2, &lvcol); // Indicate success return S_OK; }
bool ZXmlParser::RemoveAttribute( LPCTSTR AttribName ) { if ( m_CurrentNode == NULL ) { if ( m_pDocRoot ) m_CurrentNode = m_pDocRoot; else { m_LastError = "ZXmlParser::Remove_Attribute( LPCTSTR ) : Can't remove attribute on a NULL Node"; return( false ); } } IXMLDOMElementPtr CurrentElementNode = m_CurrentNode; CurrentElementNode->removeAttribute( AttribName ); m_CurrentNode = CurrentElementNode; return( true ); }
static void GetBDATemplateConnections(IXMLDOMElement* e,std::vector<BDA_TEMPLATE_CONNECTION>& v) { HRESULT hr; IXMLDOMNodeListPtr children; long listlength; hr = e->get_childNodes(&children); if(hr!=S_OK) throw _com_error(hr); hr = children->get_length(&listlength); if(hr!=S_OK) throw _com_error(hr); for(size_t n=0;n<listlength;n++) { IXMLDOMElementPtr item; IXMLDOMNodePtr itemnode; _variant_t var; BDA_TEMPLATE_CONNECTION con; hr = children->get_item(n,&itemnode); if(hr!=S_OK) throw _com_error(hr); item = itemnode; hr = item->getAttribute(_bstr_t(L"FromNodeType"),&var); if(hr!=S_OK) throw _com_error(hr); con.FromNodeType = (unsigned long)var; var.Clear(); hr = item->getAttribute(_bstr_t(L"FromNodePinType"),&var); if(hr!=S_OK) throw _com_error(hr); con.FromNodePinType = (unsigned long)var; var.Clear(); hr = item->getAttribute(_bstr_t(L"ToNodeType"),&var); if(hr!=S_OK) throw _com_error(hr); con.ToNodeType = (unsigned long)var; var.Clear(); hr = item->getAttribute(_bstr_t(L"ToNodePinType"),&var); if(hr!=S_OK) throw _com_error(hr); con.ToNodePinType = (unsigned long)var; var.Clear(); v.push_back(con); } }
bool LoadXMLDoc(LPCWSTR file, BDADEVICES& d) { IXMLDOMDocumentPtr Document; HRESULT hr; d.reset(); hr = Document.CreateInstance(CLSID_DOMDocument30); if(hr==S_OK) { VARIANT_BOOL success; hr = Document->load(_variant_t(file),&success); if(hr==S_OK&&success==VARIANT_TRUE) { IXMLDOMElementPtr root; IXMLDOMElementPtr bda_source; IXMLDOMElementPtr bda_reciever; IXMLDOMNodePtr bda_source_node; IXMLDOMNodePtr bda_reciever_node; hr = Document->get_documentElement(&root); hr = root->selectSingleNode(_bstr_t(L"kscategory_bda_network_tuner"),&bda_source_node); hr = root->selectSingleNode(_bstr_t(L"kscategory_bda_receiver_component"),&bda_reciever_node); bda_source = bda_source_node; bda_reciever = bda_reciever_node; GetDeviceList(bda_source,d.bda_source); GetDeviceList(bda_reciever,d.bda_reciever); } else { return false; } } else { return false; } return false; }
static void GetBDANodeDescriptors(IXMLDOMElement* e,std::vector<BDANODE_DESCRIPTOR>& v) { HRESULT hr; IXMLDOMNodeListPtr children; long listlength; hr = e->get_childNodes(&children); if(hr!=S_OK) throw _com_error(hr); hr = children->get_length(&listlength); if(hr!=S_OK) throw _com_error(hr); for(size_t n=0;n<listlength;n++) { IXMLDOMElementPtr item; IXMLDOMNodePtr itemnode; _variant_t var; BDANODE_DESCRIPTOR con; hr = children->get_item(n,&itemnode); if(hr!=S_OK) throw _com_error(hr); item = itemnode; hr = item->getAttribute(_bstr_t(L"ulBdaNodeType"),&var); if(hr!=S_OK) throw _com_error(hr); con.ulBdaNodeType = (unsigned long)var; var.Clear(); hr = item->getAttribute(_bstr_t(L"guidFunction"),&var); if(hr!=S_OK) throw _com_error(hr); string_to_guid((LPCWSTR)(_bstr_t)var,&con.guidFunction); var.Clear(); hr = item->getAttribute(_bstr_t(L"guidName"),&var); if(hr!=S_OK) throw _com_error(hr); string_to_guid((LPCWSTR)(_bstr_t)var,&con.guidName); var.Clear(); } }
bool ZXmlParser::SetAttribute( LPCTSTR AttribName, LPCTSTR AttribValue ) { // Nodes members IXMLDOMElementPtr CurrentElementNode = m_CurrentNode; // Create Attribute variable CComVariant sAttribute( AttribValue ); // Set the new attribute if ( m_CurrentNode ) { CurrentElementNode->setAttribute( AttribName, sAttribute ); m_CurrentNode = CurrentElementNode; GrabNodeInformation( m_CurrentNode ); } else { m_pDocRoot->setAttribute( AttribName, sAttribute ); GrabNodeInformation( m_pDocRoot ); } return( true ); }
void CCell::Save(IXMLDOMElementPtr pRoot) { IXMLDOMDocumentPtr pDoc=pRoot->ownerDocument; //add a graphy cell IXMLDOMElementPtr pCell=pDoc->createElement(L"go");; _variant_t val; val.vt=VT_BSTR; val.bstrVal=::SysAllocString(L"cell"); pCell->setAttribute(L"type",val); pRoot->appendChild(pCell); //save all elements POSITION pos; CElement *pElement; for(pos=m_Elements.GetHeadPosition();pos!=NULL;){ pElement=((CElement*)(m_Elements.GetNext(pos))); pElement->Save(pCell); } }
bool GetXmlValue( const IXMLDOMDocumentPtr& pXMLDOMDocument, const CComBSTR& bstrTagName, const CComBSTR& bstrAttributeName, std::vector<CComBSTR>& rvbstrValue ) { // アウトプットの初期化 rvbstrValue.clear(); // インプットのチェック if( 0 == bstrTagName.Length() ) { return false; } HRESULT hResult; // タグ名のノードリストの取得 IXMLDOMNodeListPtr pXMLDOMNodeList = NULL; hResult = pXMLDOMDocument->getElementsByTagName( bstrTagName, &pXMLDOMNodeList ); if( FAILED(hResult) || NULL == pXMLDOMNodeList ) { assert( !"タグ名のノードリストの取得に失敗" ); return false; } // ノードリストのノードの数の取得 long lCountNode = 0; hResult = pXMLDOMNodeList->get_length( &lCountNode ); if( FAILED(hResult) ) { assert( !"ノードリストのノードの数の取得に失敗" ); return false; } // ノードリストのノード一つずつ処理 for( int i = 0; i < lCountNode; ++i ) { // ノードリストのうちの一つのノードの取得 IXMLDOMNodePtr pXMLDOMNode = NULL; hResult = pXMLDOMNodeList->get_item( i, &pXMLDOMNode ); if( FAILED(hResult) ) { assert( !"ノードリストのうちの一つのノードの取得に失敗" ); return false; } // ノードタイプの取得 DOMNodeType eNodeType; hResult = pXMLDOMNode->get_nodeType( &eNodeType ); if( FAILED(hResult) ) { assert( !"ノードタイプの取得に失敗" ); return false; } if( NODE_ELEMENT != eNodeType ) { assert( !"ノードタイプがエレメントでないのはおかしい" ); return false; } // エレメント型への変換 IXMLDOMElementPtr pXMLDOMElement = NULL; hResult = pXMLDOMNode->QueryInterface( IID_IXMLDOMElement, (void**)&pXMLDOMElement ); // スマートポインタ型を利用しているので、pXMLDOMElement = pXMLDOMNode; でも良い。 if( FAILED(hResult) || NULL == pXMLDOMElement ) { assert( !"エレメント型への変換に失敗" ); return false; } // 属性値の取得か、データ値の取得か if( bstrAttributeName.Length() ) { // 属性値の取得 IXMLDOMAttribute* pAttributeNode = NULL; CComVariant varValue; hResult = pXMLDOMElement->getAttribute( bstrAttributeName, &varValue ); if( SUCCEEDED(hResult) && VT_BSTR == varValue.vt ) { rvbstrValue.push_back( varValue.bstrVal ); } } else { // データ値の取得 CComBSTR bstrText; hResult = pXMLDOMElement->get_text( &bstrText ); if( SUCCEEDED(hResult) ) { rvbstrValue.push_back( bstrText ); } } } return true; }
void CCell::Load(IXMLDOMElementPtr pGO) { //зАдизгдЊЫи _bstr_t strGO=L"go"; _variant_t strArc=L"arc"; _variant_t strCell=L"cell"; _variant_t strEllipse=L"ellipse"; _variant_t strLine=L"line"; _variant_t strMCButton=L"mcbutton"; _variant_t strMeta=L"meta"; _variant_t strPolygon=L"polygon"; _variant_t strPolyLine="polyline"; _variant_t strRectangle=L"rectangle"; _variant_t strRoundRect=L"roundrect"; _variant_t strText=L"text"; _variant_t val; IXMLDOMElementPtr pItem; CElement * pElement; for(pItem=pGO->firstChild;pItem!=NULL;pItem=pItem->nextSibling){ if(pItem->baseName==strGO){ val=pItem->getAttribute(L"type"); if(val==strRectangle){ pElement=new CRectangle(); ((CRectangle*)pElement)->Load(pItem); m_Elements.AddTail(pElement); pElement->m_pFather = this; }else if(val==strArc){ pElement=new CArc(); ((CArc*)pElement)->Load(pItem); m_Elements.AddTail(pElement); pElement->m_pFather = this; }else if(val==strEllipse){ pElement=new CEllipse(); ((CEllipse*)pElement)->Load(pItem); m_Elements.AddTail(pElement); pElement->m_pFather = this; }else if(val==strLine){ pElement=new CLine(); ((CLine*)pElement)->Load(pItem); m_Elements.AddTail(pElement); pElement->m_pFather = this; }else if(val==strMCButton){ pElement=new CMCButton(); ((CMCButton*)pElement)->Load(pItem); m_Elements.AddTail(pElement); pElement->m_pFather = this; }else if(val==strMeta){ pElement=new CMeta(); ((CMeta*)pElement)->Load(pItem); m_Elements.AddTail(pElement); pElement->m_pFather = this; }else if(val==strRoundRect){ pElement=new CRoundRect(); ((CRoundRect*)pElement)->Load(pItem); m_Elements.AddTail(pElement); pElement->m_pFather = this; }else if(val==strText){ pElement=new CText(); ((CText*)pElement)->Load(pItem); m_Elements.AddTail(pElement); pElement->m_pFather = this; }else if(val==strPolygon){ pElement=new CPolygon(); ((CPolygon*)pElement)->Load(pItem); m_Elements.AddTail(pElement); pElement->m_pFather = this; }else if(val==strPolyLine){ pElement=new CPolyLine(); ((CPolyLine*)pElement)->Load(pItem); m_Elements.AddTail(pElement); pElement->m_pFather = this; }else if(val==strCell){ pElement=new CCell(); ((CCell*)pElement)->Load(pItem); m_Elements.AddTail(pElement); pElement->m_pFather = this; } } } }
void CLine::Save(IXMLDOMElementPtr pRoot) { IXMLDOMElementPtr pGO; IXMLDOMElementPtr pStatic; IXMLDOMElementPtr pDynamic; IXMLDOMElementPtr pAttr; _variant_t val; IXMLDOMDocumentPtr pDoc=pRoot->ownerDocument; //add a graphy object pGO=pDoc->createElement(L"go"); val.vt=VT_BSTR; val.bstrVal=::SysAllocString(L"line"); pGO->setAttribute(L"type",val); pRoot->appendChild(pGO); //add a group static attribution pStatic=pDoc->createElement(L"static"); pGO->appendChild(pStatic); //position pAttr=pDoc->createElement(L"position"); pStatic->appendChild(pAttr); //x1 val.vt=VT_I4; val.lVal=m_lx1; pAttr->setAttribute(L"x1",val); //y1 val.vt=VT_I4; val.lVal=m_ly1; pAttr->setAttribute(L"y1",val); //x2 val.vt=VT_I4; val.lVal=m_lx2; pAttr->setAttribute(L"x2",val); //y2 val.vt=VT_I4; val.lVal=m_ly2; pAttr->setAttribute(L"y2",val); //pen pAttr=pDoc->createElement("pen"); pStatic->appendChild(pAttr); //style val.vt=VT_UI4; val.ulVal=m_pen.lopnStyle; pAttr->setAttribute(L"s",val); //width val.vt=VT_I4; val.lVal=m_pen.lopnWidth.x; pAttr->setAttribute(L"w",val); //color val.vt=VT_UI4; val.ulVal=m_pen.lopnColor; pAttr->setAttribute(L"c",val); //if linked then save dynamic attribution pDynamic=pDoc->createElement("dynamic"); pGO->appendChild(pDynamic); if(m_DnyAttr.m_Linked) { //linked val.vt=VT_BOOL; val.boolVal=-1; pDynamic->setAttribute(L"linked",val); //save dynamic attribution m_DnyAttr.Save(pDoc,pDynamic); } else { //unlinked val.vt=VT_BOOL; val.boolVal=FALSE; pDynamic->setAttribute(L"linked",val); } }
void CLine::Load(IXMLDOMElementPtr pGO) { IXMLDOMElementPtr pStatic; IXMLDOMElementPtr pDynamic; IXMLDOMElementPtr pAttr; _variant_t val; pStatic=pGO->selectSingleNode(L"./static"); //position pAttr=pStatic->selectSingleNode(L"./position"); //x1 val=pAttr->getAttribute(L"x1"); val.ChangeType(VT_I4); m_lx1=val.lVal; //y1 val=pAttr->getAttribute(L"y1"); val.ChangeType(VT_I4); m_ly1=val.lVal; //x2 val=pAttr->getAttribute(L"x2"); val.ChangeType(VT_I4); m_lx2=val.lVal; //y2 val=pAttr->getAttribute(L"y2"); val.ChangeType(VT_I4); m_ly2=val.lVal; m_loy1=m_ly1; m_loy2=m_ly2; m_lox1=m_lx1; m_lox2=m_lx2; /* if(m_lx1<m_lx2){ m_lox1=m_lx1; m_lox2=m_lx2; }else{ m_lox1=m_lx2; m_lox2=m_lx1; m_lx1=m_lox1; m_lx2=m_lox2; } if(m_ly1<m_ly2){ m_loy1=m_ly1; m_loy2=m_ly2; }else{ m_loy1=m_ly2; m_loy2=m_ly1; m_ly1=m_loy1; m_ly2=m_loy2; } */ //pen pAttr=pStatic->selectSingleNode(L"./pen"); //style val=pAttr->getAttribute(L"s"); val.ChangeType(VT_UI4); m_pen.lopnStyle=val.ulVal; //width val=pAttr->getAttribute(L"w"); val.ChangeType(VT_I4); m_pen.lopnWidth.x=val.lVal; //color val=pAttr->getAttribute(L"c"); val.ChangeType(VT_UI4); m_pen.lopnColor=val.ulVal; m_open=m_pen; //load dynamic attribution if have pDynamic=pGO->selectSingleNode(L"./dynamic"); val=pDynamic->getAttribute(L"linked"); val.ChangeType(VT_BOOL); if(val.boolVal) { m_DnyAttr.Load(pDynamic); m_DnyAttr.m_Linked=true; } else { m_DnyAttr.m_Linked=false; } }
void CText::Load(IXMLDOMElementPtr pGO) { IXMLDOMElementPtr pStatic; IXMLDOMElementPtr pDynamic; IXMLDOMElementPtr pAttr; _variant_t val; pStatic=pGO->selectSingleNode(L"./static"); //position pAttr=pStatic->selectSingleNode(L"./position"); //x1 val=pAttr->getAttribute(L"x1"); val.ChangeType(VT_I4); m_lx1=val.lVal; //y1 val=pAttr->getAttribute(L"y1"); val.ChangeType(VT_I4); m_ly1=val.lVal; //x2 val=pAttr->getAttribute(L"x2"); val.ChangeType(VT_I4); m_lx2=val.lVal; //y2 val=pAttr->getAttribute(L"y2"); val.ChangeType(VT_I4); m_ly2=val.lVal; //face color pAttr=pStatic->selectSingleNode(L"./color"); //color val=pAttr->getAttribute(L"c"); val.ChangeType(VT_UI4); m_FaceColor=val.ulVal; //font pAttr=pStatic->selectSingleNode(L"./font"); //lfHeight val=pAttr->getAttribute(L"h"); val.ChangeType(VT_I4); m_font.lfHeight=val.ulVal; //lfWidth val=pAttr->getAttribute(L"wd"); val.ChangeType(VT_I4); m_font.lfWidth=val.ulVal; //lfEscapement val=pAttr->getAttribute(L"e"); val.ChangeType(VT_I4); m_font.lfEscapement=val.ulVal; //lfOrientation val=pAttr->getAttribute(L"o"); val.ChangeType(VT_I4); m_font.lfOrientation=val.ulVal; //lfWeight val=pAttr->getAttribute(L"wg"); val.ChangeType(VT_I4); m_font.lfWeight=val.ulVal; //lfItalic val=pAttr->getAttribute(L"i"); val.ChangeType(VT_UI1); m_font.lfItalic=val.ulVal; //lfUnderline val=pAttr->getAttribute(L"u"); val.ChangeType(VT_UI1); m_font.lfUnderline=val.ulVal; //lfStrikeOut val=pAttr->getAttribute(L"so"); val.ChangeType(VT_UI1); m_font.lfStrikeOut=val.ulVal; //lfCharSet val=pAttr->getAttribute(L"cs"); val.ChangeType(VT_UI1); m_font.lfCharSet=val.ulVal; //lfOutPrecision val=pAttr->getAttribute(L"op"); val.ChangeType(VT_UI1); m_font.lfOutPrecision=val.ulVal; //lfClipPrecision val=pAttr->getAttribute(L"cp"); val.ChangeType(VT_UI1); m_font.lfClipPrecision=val.ulVal; //lfQuality val=pAttr->getAttribute(L"q"); val.ChangeType(VT_UI1); m_font.lfQuality=val.ulVal; //lfPitchAndFamily val=pAttr->getAttribute(L"paf"); val.ChangeType(VT_UI1); m_font.lfPitchAndFamily=val.ulVal; //lfFaceName val=pAttr->getAttribute(L"fn"); CString strFaceName=val.bstrVal; sprintf(m_font.lfFaceName,"%s",(LPCTSTR)strFaceName); //text pAttr=pStatic->selectSingleNode(L"./text"); val=pAttr->getAttribute(L"t"); m_text=val.bstrVal; //load dynamic attribution if have pDynamic=pGO->selectSingleNode(L"./dynamic"); val=pDynamic->getAttribute(L"linked"); val.ChangeType(VT_BOOL); if(val.boolVal){ m_DnyAttr.Load(pDynamic); m_DnyAttr.m_Linked=true; }else{ m_DnyAttr.m_Linked=false; } }
void CText::Save(IXMLDOMElementPtr pRoot) { IXMLDOMElementPtr pGO; IXMLDOMElementPtr pStatic; IXMLDOMElementPtr pDynamic; IXMLDOMElementPtr pAttr; _variant_t val; IXMLDOMDocumentPtr pDoc=pRoot->ownerDocument; //add a graphy object pGO=pDoc->createElement(L"go"); val.vt=VT_BSTR; val.bstrVal=::SysAllocString(L"text"); pGO->setAttribute(L"type",val); pRoot->appendChild(pGO); //add a group static attribution pStatic=pDoc->createElement(L"static"); pGO->appendChild(pStatic); //position pAttr=pDoc->createElement(L"position"); pStatic->appendChild(pAttr); //x1 val.vt=VT_I4; val.lVal=m_lx1; pAttr->setAttribute(L"x1",val); //y1 val.vt=VT_I4; val.lVal=m_ly1; pAttr->setAttribute(L"y1",val); //x2 val.vt=VT_I4; val.lVal=m_lx2; pAttr->setAttribute(L"x2",val); //y2 val.vt=VT_I4; val.lVal=m_ly2; pAttr->setAttribute(L"y2",val); //face color pAttr=pDoc->createElement("color"); pStatic->appendChild(pAttr); //color val.vt=VT_UI4; val.ulVal=m_FaceColor; pAttr->setAttribute(L"c",val); //font pAttr=pDoc->createElement("font"); pStatic->appendChild(pAttr); //lfHeight val.vt=VT_I4; val.lVal=m_font.lfHeight; pAttr->setAttribute(L"h",val); //lfWidth val.vt=VT_I4; val.lVal=m_font.lfWidth; pAttr->setAttribute(L"wd",val); //lfEscapement val.vt=VT_I4; val.lVal=m_font.lfEscapement; pAttr->setAttribute(L"e",val); //lfOrientation val.vt=VT_I4; val.lVal=m_font.lfOrientation; pAttr->setAttribute(L"o",val); //lfWeight val.vt=VT_I4; val.lVal=m_font.lfWeight; pAttr->setAttribute(L"wg",val); //lfItalic val.vt=VT_UI1; val.bVal=m_font.lfItalic; pAttr->setAttribute(L"i",val); //lfUnderline val.vt=VT_UI1; val.bVal=m_font.lfUnderline; pAttr->setAttribute(L"u",val); //lfStrikeOut val.vt=VT_UI1; val.bVal=m_font.lfStrikeOut; pAttr->setAttribute(L"so",val); //lfCharSet val.vt=VT_UI1; val.bVal=m_font.lfCharSet; pAttr->setAttribute(L"cs",val); //lfOutPrecision val.vt=VT_UI1; val.bVal=m_font.lfOutPrecision; pAttr->setAttribute(L"op",val); //lfClipPrecision val.vt=VT_UI1; val.bVal=m_font.lfClipPrecision; pAttr->setAttribute(L"cp",val); //lfQuality val.vt=VT_UI1; val.bVal=m_font.lfQuality; pAttr->setAttribute(L"q",val); //lfPitchAndFamily val.vt=VT_UI1; val.bVal=m_font.lfPitchAndFamily; pAttr->setAttribute(L"paf",val); //lfFaceName CString strFaceName=m_font.lfFaceName; //strFaceName.Format("%s",m_font.lfFaceName); val.vt=VT_BSTR; val.bstrVal=strFaceName.AllocSysString(); pAttr->setAttribute(L"fn",val); //text pAttr=pDoc->createElement("text"); pStatic->appendChild(pAttr); val.vt=VT_BSTR; val.bstrVal=m_text.AllocSysString(); pAttr->setAttribute(L"t",val); //if linked then save dynamic attribution pDynamic=pDoc->createElement("dynamic"); pGO->appendChild(pDynamic); if(m_DnyAttr.m_Linked){ //linked val.vt=VT_BOOL; val.boolVal=-1; pDynamic->setAttribute(L"linked",val); //save dynamic attribution m_DnyAttr.Save(pDoc,pDynamic); }else{ //unlinked val.vt=VT_BOOL; val.boolVal=FALSE; pDynamic->setAttribute(L"linked",val); } }