<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="https://syndication.webwiz.net/rss_namespace/">
 <channel>
  <title>Codejock Developer Community : MFC. Extract text from markup</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Samples and Demo Applications : MFC. Extract text from markup]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Sun, 26 Apr 2026 11:58:22 +0000</pubDate>
  <lastBuildDate>Tue, 03 Jun 2008 16:08:50 +0000</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 12.04</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>forum.codejock.com/RSS_post_feed.asp?TID=10694</WebWizForums:feedURL>
  <image>
   <title><![CDATA[Codejock Developer Community]]></title>
   <url>http://forum.codejock.com/forum_images/codejock-logo.gif</url>
   <link>http://forum.codejock.com/</link>
  </image>
  <item>
   <title><![CDATA[MFC. Extract text from markup : thank you, this code works and...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=10694&amp;PID=36221&amp;title=mfc-extract-text-from-markup#36221</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=66">zaksoft</a><br /><strong>Subject:</strong> 10694<br /><strong>Posted:</strong> 03 June 2008 at 4:08pm<br /><br />thank you, this code works and with some small enhancements I've added the auto-recognition of TaskPanel end to add a CR+LF to break block of text (and also spaces betwwen block).<DIV>&nbsp;</DIV><DIV>What I'm not able to do is insert line feed after a row of a grid, infact using border as marker a line feed is added after each column.</DIV><DIV>&nbsp;</DIV><DIV>two questions:</DIV><DIV>&nbsp;</DIV><DIV>1) Any suggestion to detect end of row ?</DIV><DIV>2) Do you plan o add a more generic and well done function to extract text in future release ?</DIV><DIV>&nbsp;</DIV><DIV>Thank you agin for your support.</DIV>]]>
   </description>
   <pubDate>Tue, 03 Jun 2008 16:08:50 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=10694&amp;PID=36221&amp;title=mfc-extract-text-from-markup#36221</guid>
  </item> 
  <item>
   <title><![CDATA[MFC. Extract text from markup : Hi,  Here working version. Sorry...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=10694&amp;PID=36212&amp;title=mfc-extract-text-from-markup#36212</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=6851">Oleg</a><br /><strong>Subject:</strong> 10694<br /><strong>Posted:</strong> 03 June 2008 at 2:16pm<br /><br />Hi,<DIV>&nbsp;</DIV><DIV>Here working version. Sorry need Logical Childs:</DIV><DIV>&nbsp;</DIV><DIV><FONT color=#0000ff size=1><FONT color=#0000ff size=1><P>void</FONT></FONT><FONT size=1> </FONT><FONT color=#030003 size=1><FONT color=#030003 size=1>CMarkupStatic</FONT></FONT><FONT size=1>::</FONT><FONT color=#030003 size=1><FONT color=#030003 size=1>GetInnerText</FONT></FONT><FONT size=1>( </FONT><FONT color=#030003 size=1><FONT color=#030003 size=1>CString</FONT></FONT><FONT size=1>&amp; </FONT><FONT color=#030003 size=1><FONT color=#030003 size=1>sContent</FONT></FONT><FONT size=1>, </FONT><FONT color=#030003 size=1><FONT color=#030003 size=1>CXTPMarkupObject</FONT></FONT><FONT size=1>* </FONT><FONT color=#030003 size=1><FONT color=#030003 size=1>pParent</FONT></FONT><FONT size=1>)</P><P>{</P><P></FONT><FONT color=#030003 size=1><FONT color=#030003 size=1>ASSERT</FONT></FONT><FONT size=1>( </FONT><FONT color=#030003 size=1><FONT color=#030003 size=1>pParent</FONT></FONT><FONT size=1>);</P><P></FONT><FONT color=#0000ff size=1><FONT color=#0000ff size=1>for</FONT></FONT><FONT size=1> (</FONT><FONT color=#0000ff size=1><FONT color=#0000ff size=1>int</FONT></FONT><FONT size=1> </FONT><FONT color=#030003 size=1><FONT color=#030003 size=1>i</FONT></FONT><FONT size=1> = 0; </FONT><FONT color=#030003 size=1><FONT color=#030003 size=1>i</FONT></FONT><FONT size=1> &lt; </FONT><FONT color=#030003 size=1><FONT color=#030003 size=1>pParent</FONT></FONT><FONT size=1>-&gt;</FONT><FONT color=#030003 size=1><FONT color=#030003 size=1>GetLogicalChildrenCount</FONT></FONT><FONT size=1>(); </FONT><FONT color=#030003 size=1><FONT color=#030003 size=1>i</FONT></FONT><FONT size=1>++)</P><P>{</P><P></FONT><FONT color=#030003 size=1><FONT color=#030003 size=1>CXTPMarkupObject</FONT></FONT><FONT size=1>* </FONT><FONT color=#030003 size=1><FONT color=#030003 size=1>pVisual</FONT></FONT><FONT size=1> = </FONT><FONT color=#030003 size=1><FONT color=#030003 size=1>pParent</FONT></FONT><FONT size=1>-&gt;</FONT><FONT color=#030003 size=1><FONT color=#030003 size=1>GetLogicalChild</FONT></FONT><FONT size=1>(</FONT><FONT color=#030003 size=1><FONT color=#030003 size=1>i</FONT></FONT><FONT size=1>);</P><P></FONT><FONT color=#030003 size=1><FONT color=#030003 size=1>ASSERT</FONT></FONT><FONT size=1>( </FONT><FONT color=#030003 size=1><FONT color=#030003 size=1>pVisual</FONT></FONT><FONT size=1>);</P><P></FONT><FONT color=#0000ff size=1><FONT color=#0000ff size=1>if</FONT></FONT><FONT size=1> ( </FONT><FONT color=#030003 size=1><FONT color=#030003 size=1>pVisual</FONT></FONT><FONT size=1>-&gt;</FONT><FONT color=#030003 size=1><FONT color=#030003 size=1>IsKindOf</FONT></FONT><FONT size=1>(</FONT><FONT color=#030003 size=1><FONT color=#030003 size=1>MARKUP_TYPE</FONT></FONT><FONT size=1>(</FONT><FONT color=#030003 size=1><FONT color=#030003 size=1>CXTPMarkupRun</FONT></FONT><FONT size=1>)))</P><P>{</P><P></FONT><FONT color=#030003 size=1><FONT color=#030003 size=1>CXTPMarkupRun</FONT></FONT><FONT size=1>* </FONT><FONT color=#030003 size=1><FONT color=#030003 size=1>p</FONT></FONT><FONT size=1> = (</FONT><FONT color=#030003 size=1><FONT color=#030003 size=1>CXTPMarkupRun</FONT></FONT><FONT size=1>*)</FONT><FONT color=#030003 size=1><FONT color=#030003 size=1>pVisual</FONT></FONT><FONT size=1>;</P><P></FONT><FONT color=#030003 size=1><FONT color=#030003 size=1>sContent</FONT></FONT><FONT size=1> += </FONT><FONT color=#030003 size=1><FONT color=#030003 size=1>p</FONT></FONT><FONT size=1>-&gt;</FONT><FONT color=#030003 size=1><FONT color=#030003 size=1>GetText</FONT></FONT><FONT size=1>();</P><P>}</P><P>&nbsp;</P><P></FONT><FONT color=#030003 size=1><FONT color=#030003 size=1>GetInnerText</FONT></FONT><FONT size=1>( </FONT><FONT color=#030003 size=1><FONT color=#030003 size=1>sContent</FONT></FONT><FONT size=1>, </FONT><FONT color=#030003 size=1><FONT color=#030003 size=1>pVisual</FONT></FONT><FONT size=1>);</P><P>}</P><P>}</P></FONT></DIV>]]>
   </description>
   <pubDate>Tue, 03 Jun 2008 14:16:05 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=10694&amp;PID=36212&amp;title=mfc-extract-text-from-markup#36212</guid>
  </item> 
  <item>
   <title><![CDATA[MFC. Extract text from markup : Anyone can help me in make the...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=10694&amp;PID=36211&amp;title=mfc-extract-text-from-markup#36211</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=66">zaksoft</a><br /><strong>Subject:</strong> 10694<br /><strong>Posted:</strong> 03 June 2008 at 1:45pm<br /><br />Anyone can help me in make the previous code working ?<DIV></DIV><DIV></DIV><DIV>&nbsp;</DIV><DIV>TIA</DIV>]]>
   </description>
   <pubDate>Tue, 03 Jun 2008 13:45:28 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=10694&amp;PID=36211&amp;title=mfc-extract-text-from-markup#36211</guid>
  </item> 
  <item>
   <title><![CDATA[MFC. Extract text from markup : to your markupstatic.cpp code...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=10694&amp;PID=35901&amp;title=mfc-extract-text-from-markup#35901</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=66">zaksoft</a><br /><strong>Subject:</strong> 10694<br /><strong>Posted:</strong> 28 May 2008 at 3:00am<br /><br />to your markupstatic.cpp code in markup sample I've added this function:<DIV><FONT color=#0000ff size=3><FONT color=#0000ff size=3><FONT size=1></FONT></FONT></FONT>&nbsp;</DIV><DIV><FONT color=#0000ff size=3><FONT color=#0000ff size=3><FONT size=1>void</FONT></FONT></FONT><FONT size=1> <FONT color=#010001><FONT color=#010001>CMarkupStatic</FONT></FONT>::<FONT color=#010001><FONT color=#010001>GetInnerText</FONT></FONT>( <FONT color=#010001><FONT color=#010001>CString</FONT></FONT>&amp; <FONT color=#010001><FONT color=#010001>sContent</FONT></FONT>, <FONT color=#010001><FONT color=#010001>CXTPMarkupVisual</FONT></FONT>* <FONT color=#010001><FONT color=#010001>pParent</FONT></FONT>)</FONT><FONT size=1>{</FONT></DIV><P><FONT size=1><FONT color=#010001><FONT color=#010001>ASSERT</FONT></FONT>( <FONT color=#010001><FONT color=#010001>pParent</FONT></FONT>);</FONT></P><P><FONT size=1><FONT color=#0000ff><FONT color=#0000ff>for</FONT></FONT> (<FONT color=#0000ff><FONT color=#0000ff>int</FONT></FONT> <FONT color=#010001><FONT color=#010001>i</FONT></FONT> = 0; <FONT color=#010001><FONT color=#010001>i</FONT></FONT> &lt; <FONT color=#010001><FONT color=#010001>pParent</FONT></FONT>-&gt;<FONT color=#010001><FONT color=#010001>GetVisualChildrenCount</FONT></FONT>(); <FONT color=#010001><FONT color=#010001>i</FONT></FONT>++)</FONT></P><P><FONT size=1>{</FONT></P><P><FONT size=1><FONT color=#010001><FONT color=#010001>CXTPMarkupVisual</FONT></FONT>* <FONT color=#010001><FONT color=#010001>pVisual</FONT></FONT> = <FONT color=#010001><FONT color=#010001>pParent</FONT></FONT>-&gt;<FONT color=#010001><FONT color=#010001>GetVisualChild</FONT></FONT>( <FONT color=#010001><FONT color=#010001>i</FONT></FONT>);</FONT></P><P><FONT size=1><FONT color=#010001><FONT color=#010001>ASSERT</FONT></FONT>( <FONT color=#010001><FONT color=#010001>pVisual</FONT></FONT>);</FONT></P><P><FONT size=1><FONT color=#0000ff><FONT color=#0000ff>if</FONT></FONT> ( <FONT color=#010001><FONT color=#010001>pVisual</FONT></FONT>-&gt;<FONT color=#010001><FONT color=#010001>IsKindOf</FONT></FONT>(<FONT color=#010001><FONT color=#010001>MARKUP_TYPE</FONT></FONT>(<FONT color=#010001><FONT color=#010001>CXTPMarkupRun</FONT></FONT>)))</FONT></P><P><FONT size=1>{</FONT></P><P><FONT size=1><FONT color=#010001><FONT color=#010001>CXTPMarkupRun</FONT></FONT>* <FONT color=#010001><FONT color=#010001>p</FONT></FONT> = (<FONT color=#010001><FONT color=#010001>CXTPMarkupRun</FONT></FONT>*)<FONT color=#010001><FONT color=#010001>pVisual</FONT></FONT>;</FONT></P><P><FONT size=1><FONT color=#010001><FONT color=#010001>sContent</FONT></FONT> += <FONT color=#010001><FONT color=#010001>p</FONT></FONT>-&gt;<FONT color=#010001><FONT color=#010001>GetText</FONT></FONT>();</FONT></P><P><FONT size=1>}</FONT></P><P><FONT size=1></FONT></P><P><FONT size=1><FONT color=#010001><FONT color=#010001>GetInnerText</FONT></FONT>( <FONT color=#010001><FONT color=#010001>sContent</FONT></FONT>, <FONT color=#010001><FONT color=#010001>pVisual</FONT></FONT>);</FONT></P><P><FONT size=1>}</FONT></P><P><FONT size=1>}</P><DIV></DIV><DIV></DIV><P></FONT><FONT size=2>Called as </FONT></P><DIV><FONT size=2></FONT></DIV><FONT color=#010001><FONT color=#010001><P><FONT size=2>GetInnerText</FONT></FONT></FONT><FONT size=2>( <FONT color=#010001><FONT color=#010001>sContent</FONT></FONT>, <FONT color=#010001><FONT color=#010001>m_pUIElement</FONT></FONT>);</FONT></P><DIV><FONT size=2></FONT></DIV><DIV><FONT size=2></FONT></DIV><DIV><FONT size=2>but the resulting string is empty... what's wrong ? can you please help me ?</FONT></DIV><DIV><FONT size=2></FONT>&nbsp;</DIV><DIV><FONT size=2>TIA</FONT></DIV>]]>
   </description>
   <pubDate>Wed, 28 May 2008 03:00:27 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=10694&amp;PID=35901&amp;title=mfc-extract-text-from-markup#35901</guid>
  </item> 
  <item>
   <title><![CDATA[MFC. Extract text from markup : Hi,  Here some start:  if...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=10694&amp;PID=35483&amp;title=mfc-extract-text-from-markup#35483</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=6851">Oleg</a><br /><strong>Subject:</strong> 10694<br /><strong>Posted:</strong> 20 May 2008 at 1:45pm<br /><br />Hi,<DIV>&nbsp;</DIV><DIV>Here some start:</DIV><DIV>&nbsp;</DIV><DIV>if (pUIElement)<BR>&nbsp;{<BR>&nbsp;&nbsp;for (int i = 0; i &lt; pUIElement-&gt;GetVisualChildrenCount(); i++)<BR>&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;CXTPMarkupVisual* pVisual = pUIElement-&gt;GetVisualChild(i);</DIV><DIV>&nbsp;&nbsp;&nbsp;if (pVisual-&gt;IsKindOf(MARKUP_TYPE(CXTPMarkupRun)))<BR>&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;CXTPMarkupRun* p = (CXTPMarkupRun*)pVisual;<BR>&nbsp;&nbsp;&nbsp;&nbsp;CString str = p-&gt;GetText();<BR>...&nbsp;&nbsp;&nbsp;</DIV><DIV>}</DIV><DIV>&nbsp; &#091; CallRec(pVisual);&#093; </DIV><DIV><BR>&nbsp;&nbsp;}</DIV><DIV>&nbsp;}</DIV><DIV>&nbsp;</DIV><DIV>so you need call it recursively and find&nbsp;all Runs.</DIV>]]>
   </description>
   <pubDate>Tue, 20 May 2008 13:45:08 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=10694&amp;PID=35483&amp;title=mfc-extract-text-from-markup#35483</guid>
  </item> 
  <item>
   <title><![CDATA[MFC. Extract text from markup : I have the need to get text from...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=10694&amp;PID=35451&amp;title=mfc-extract-text-from-markup#35451</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=66">zaksoft</a><br /><strong>Subject:</strong> 10694<br /><strong>Posted:</strong> 20 May 2008 at 4:09am<br /><br />I have the need to get text from a makup control. This control is a preview of some information and it's very fancy to present to user information in a rich way, but I also need to store these information on request... At this point I can of course rebuild all information without markup.. but the better way (for me of course) is to have a command that remove &lt;bold&gt;, &lt;grid&gt; and so on from the full string.<DIV>&nbsp;</DIV><DIV>Any&nbsp;hint ?</DIV><DIV>&nbsp;</DIV><DIV>TIA</DIV>]]>
   </description>
   <pubDate>Tue, 20 May 2008 04:09:22 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=10694&amp;PID=35451&amp;title=mfc-extract-text-from-markup#35451</guid>
  </item> 
 </channel>
</rss>