How to create and maintain HTML file? Many applications use HTML as their log file. Many application output data to HTML too. I also hope to use HTML file as my application's log file. I hope to use it to provide more information to uses by HTML file. So I have to create HTML file for log file. I have to read old HTML file and update information in the HTML file too. Is there one HTML library that can make it easy to write and read HTML file? Can it make it easy to parse the information in HTML file?
fujoey
Posts
-
How to create and maintain HTML file? -
How to change .net framework used by Visual Studio 2008?I use Visual studio 2008 Professional version. microsoft provides inforamtion to choose .net framework version for Visual Studio Team System Architecture Edition at link: http://msdn.microsoft.com/en-us/library/bb675522.aspx . I can not find the 'Settings and Constraints' in the right click menu. Which version do you use?
-
How to change .net framework used by Visual Studio 2008?Visual Studio 2008 uses .net framework 3.5 for my application. I hope it uses .net framework. How can I change its version? This 'targeted platform' option is grey in the project properties.
-
How to get message when tab is changed in one MDI multiple tab applicationHow to get message when tab is changed in one MDI multiple tab application? I have created one multipe tab application with VS2008 feature pack. I hope to add some process when user change the tab by clicking.I derived MainFrame from CMDIFrameWndEx. I use CHTMLView as view base class. But I failed to find the message for tab swithcing. Is there someone who can help me? Thanks in advance.
-
How can I browse filesystem in windows mobile device with SHBrowseForFolderHow can I browse filesystem in windows mobile device with SHBrowseForFolder Hello, everyone. I plan to develop one application that have to copy file to windows mobile device. Users will specify the directory of windows mobile device. So I have to pop up one dialog to let user to select.I try to use SHBrowseForFolder to select directory in windows mobile device. But it does not work. There is no 'Mobile device' direcoty under desktop.I can browser this device by window's exporer. I even can access Nokia device with SHBrowseForFolder.The device is Jingpeng S6186. It used windows mobile 5.1.478. ActiveSync's version is 4.5.0.
-
Help: how to get link addres in the RSS XML file in MFC/C++?I have to parse RSS channel definition XML file. I have appended one sample at the end of this topic. I have installed MSXML parser 6 and uses it successfully. Please refer to function XmlRSSRead. There are a lot of information about the channel and item of this channel. For example, one channel has title, link, description information. One channel may have a lot of item too. Each item also hase title, link, description information. I have to extract title, link, description information in my application. I can not find one quick start guide from microsoft doucments. Could anyone be kind to tell me what I should do next? The following is the function I have now and the xml file I want to parse. void XmlRSSRead( void ) { //¡ä¡ä?¡§DOMDocument???¨® MSXML2::IXMLDOMDocumentPtr pDoc; HRESULT hr = pDoc.CreateInstance(__uuidof(MSXML2::DOMDocument30)); if(!SUCCEEDED(hr)) { AfxMessageBox( _T("?T¡¤¡§¡ä¡ä?¡§DOMDocument???¨®¡ê????¨¬2¨¦¨º?¡¤?¡ã2¡Á¡ã¨¢?MS XML Parser ??DD?a!") ); } //?¨®?????t pDoc->load( _T("D:\\temp\\mPhone\\Docs\\RSS\\nature.xml") ); //?¨²¨º¡Â?D2¨¦?¨°???achannel¦Ì??¨²¦Ì?, // "//"¡À¨ª¨º??¨²¨¨?¨°a¨°?2?2¨¦?¨° MSXML2::IXMLDOMElementPtr childNode ; childNode = (MSXML2::IXMLDOMElementPtr)(pDoc->selectSingleNode("//channel")); //¦Ì?¦Ì??¨²¦Ì?¨¤¨¤D¨ª MSXML2::DOMNodeType nodeType; childNode->get_nodeType(&nodeType); //?¨²¦Ì???3? BSTR var; CString name; childNode->get_nodeName(&var); name = (char*)(_bstr_t)var; //?¨²¦Ì??¦Ì VARIANT varVal; childNode->get_nodeTypedValue(&varVal); CString strValue = (char*)(_bstr_t)varVal; //?¨²¦Ì?¨º?D?,¡¤??¨²¨¢¡ä¡À¨ª?D MSXML2::IXMLDOMNamedNodeMapPtr pAttrs = NULL; MSXML2::IXMLDOMNodePtr pAttrItem; childNode->get_attributes(&pAttrs); long nCount ; pAttrs->get_length(&nCount); for(int i = 0 ; i < nCount ; i++) { pAttrs->get_item(i,&pAttrItem); //?¨°???¨¦¨°?¨ª¡§1yo¡¥¨ºyget_nodeName,get_nodeTypedValue¦Ì?¦Ì?¨º?D???o¨ª¨º?D??¦Ì //¨°2?¨¦¨°??¡À?¨®¦Ì?¦Ì? CString strAttrName = (char*)(_bstr_t)pAttrItem->nodeName; CString strAttrValue = (char*)(_bstr_t)pAttrItem->nodeTypedValue; } } void mfXmlReadTest( void ) { ::CoInitialize(NULL); MSXML2::IXMLDOMDocumentPtr spPtr; HRESULT hr = spPtr.CreateInstance(__uuidof(MSXML2::DOMDocument30)); ASSERT(SUCCEEDED(hr)); spPtr->loadXML("\ntop\nbottom\n"); spPtr->save("C:\\nature.xml"); spPtr.Release(); ::CoUninitialize(); } XMLÎļþÈçÏ£º
-
Help: how to get link addres in the RSS XML file in MFC/C++?I have to parse RSS channel definition XML file. I have appended one sample at the end of this topic. I have installed MSXML parser 6 and uses it successfully. Please refer to function XmlRSSRead. There are a lot of information about the channel and item of this channel. For example, one channel has title, link, description information. One channel may have a lot of item too. Each item also hase title, link, description information. I have to extract title, link, description information in my application. I can not find one quick start guide from microsoft doucments. Could anyone be kind to tell me what I should do next? The following is the function I have now and the xml file I want to parse. void XmlRSSRead( void ) { //¡ä¡ä?¡§DOMDocument???¨® MSXML2::IXMLDOMDocumentPtr pDoc; HRESULT hr = pDoc.CreateInstance(__uuidof(MSXML2::DOMDocument30)); if(!SUCCEEDED(hr)) { AfxMessageBox( _T("?T¡¤¡§¡ä¡ä?¡§DOMDocument???¨®¡ê????¨¬2¨¦¨º?¡¤?¡ã2¡Á¡ã¨¢?MS XML Parser ??DD?a!") ); } //?¨®?????t pDoc->load( _T("D:\\temp\\mPhone\\Docs\\RSS\\nature.xml") ); //?¨²¨º¡Â?D2¨¦?¨°???achannel¦Ì??¨²¦Ì?, // "//"¡À¨ª¨º??¨²¨¨?¨°a¨°?2?2¨¦?¨° MSXML2::IXMLDOMElementPtr childNode ; childNode = (MSXML2::IXMLDOMElementPtr)(pDoc->selectSingleNode("//channel")); //¦Ì?¦Ì??¨²¦Ì?¨¤¨¤D¨ª MSXML2::DOMNodeType nodeType; childNode->get_nodeType(&nodeType); //?¨²¦Ì???3? BSTR var; CString name; childNode->get_nodeName(&var); name = (char*)(_bstr_t)var; //?¨²¦Ì??¦Ì VARIANT varVal; childNode->get_nodeTypedValue(&varVal); CString strValue = (char*)(_bstr_t)varVal; //?¨²¦Ì?¨º?D?,¡¤??¨²¨¢¡ä¡À¨ª?D MSXML2::IXMLDOMNamedNodeMapPtr pAttrs = NULL; MSXML2::IXMLDOMNodePtr pAttrItem; childNode->get_attributes(&pAttrs); long nCount ; pAttrs->get_length(&nCount); for(int i = 0 ; i < nCount ; i++) { pAttrs->get_item(i,&pAttrItem); //?¨°???¨¦¨°?¨ª¡§1yo¡¥¨ºyget_nodeName,get_nodeTypedValue¦Ì?¦Ì?¨º?D???o¨ª¨º?D??¦Ì //¨°2?¨¦¨°??¡À?¨®¦Ì?¦Ì? CString strAttrName = (char*)(_bstr_t)pAttrItem->nodeName; CString strAttrValue = (char*)(_bstr_t)pAttrItem->nodeTypedValue; } } void mfXmlReadTest( void ) { ::CoInitialize(NULL); MSXML2::IXMLDOMDocumentPtr spPtr; HRESULT hr = spPtr.CreateInstance(__uuidof(MSXML2::DOMDocument30)); ASSERT(SUCCEEDED(hr)); spPtr->loadXML("\ntop\nbottom\n"); spPtr->save("C:\\nature.xml"); spPtr.Release(); ::CoUninitialize(); } XMLÎļþÈçÏ£º
-
How can I create file in NOKIA mobile phone memory disk?How can I create file in NOKIA mobile phone memory disk? How can I create dirrectory in NOKIA mobile phone memory disk? My mobile phone is Nokia N72. I can access its memory disk after I connect it wity my computer. Its directory is 'My Computer\\Nokia N72\\memorydisk\\' I failed to access it with the following code: CString csNokiaDir("My Computer"); bFindFile=finder.FindFile(csNokiaDir); csNokiaDir = "My Computer\\Nokia N72"; bFindFile=finder.FindFile(csNokiaDir); csNokiaDir = "My Computer\\Nokia N72\\memorydisk"; I get another directory by the following MFC code: BROWSEINFO bi; TCHAR Buffer[512]=""; TCHAR FullPath[512]=""; bi.hwndOwner = m_hWnd; bi.pidlRoot = NULL; bi.pszDisplayName = Buffer; bi.lpszTitle = "Select directory"; bi.ulFlags = BIF_RETURNONLYFSDIRS|BIF_EDITBOX|BIF_BROWSEFORCOMPUTER ; bi.lpfn = NULL; //回调函数,有时很有用 bi.lParam = 0; bi.iImage = 0; ITEMIDLIST* pidl = ::SHBrowseForFolder (&bi); if(::SHGetPathFromIDList (pidl,FullPath)) { m_sFonePath2 = FullPath; } The path I got is'::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\::{416651E4-9C3C-11D9-8BDE-F66BAD1E3F3A}\354533010872671\E:\' I used FindFile to check it and failed again. Does any one know how to handle this kind of directory?
-
How can I create file in NOKIA mobile phone memory disk?How can I create file in NOKIA mobile phone memory disk? How can I create dirrectory in NOKIA mobile phone memory disk? My mobile phone is Nokia N72. I can access its memory disk after I connect it wity my computer. Its directory is 'My Computer\\Nokia N72\\memorydisk\\' I failed to access it with the following code: CString csNokiaDir("My Computer"); bFindFile=finder.FindFile(csNokiaDir); csNokiaDir = "My Computer\\Nokia N72"; bFindFile=finder.FindFile(csNokiaDir); csNokiaDir = "My Computer\\Nokia N72\\memorydisk"; I get another directory by the following MFC code: BROWSEINFO bi; TCHAR Buffer[512]=""; TCHAR FullPath[512]=""; bi.hwndOwner = m_hWnd; bi.pidlRoot = NULL; bi.pszDisplayName = Buffer; bi.lpszTitle = "Select directory"; bi.ulFlags = BIF_RETURNONLYFSDIRS|BIF_EDITBOX|BIF_BROWSEFORCOMPUTER ; bi.lpfn = NULL; //回调函数,有时很有用 bi.lParam = 0; bi.iImage = 0; ITEMIDLIST* pidl = ::SHBrowseForFolder (&bi); if(::SHGetPathFromIDList (pidl,FullPath)) { m_sFonePath2 = FullPath; } The path I got is'::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\::{416651E4-9C3C-11D9-8BDE-F66BAD1E3F3A}\354533010872671\E:\' I used FindFile to check it and failed again. Does any one know how to handle this kind of directory?