<?xml version="1.0" encoding="GBK"?>
<rss version="2.0" >
<channel> <title><![CDATA[51CTO技术博客-领先的IT技术博客]]></title>
 <link><![CDATA[http://blog.51cto.com]]></link>
 <description><![CDATA[Latest 20 blogs of juwen]]></description>
 <copyright><![CDATA[Copyright(C) 51CTO技术博客-领先的IT技术博客]]></copyright>
 <generator><![CDATA[51CTO BLOG by 51CTO Studio]]></generator>
 <lastBuildDate><![CDATA[Wed, 10 Feb 2010 02:17:58 +0000]]></lastBuildDate>
  <image>
 <url><![CDATA[http://img1.51cto.com/image/skin/1/rss.gif]]></url>
 <title><![CDATA[51CTO BLOG]]></title>
 <link><![CDATA[http://blog.51cto.com]]></link>
 <description><![CDATA[51CTO技术博客-领先的IT技术博客]]></description>
  </image>
<item>
 <title><![CDATA[AS3中的位操作]]></title>
 <description><![CDATA[<span class="Apple-style-span" style="font-size: 12px; font-family: Arial; line-height: 18px; "><table style="table-layout: fixed; width: 960px; "><tbody><tr><td style="font-family: Arial; word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; font-size: 12px; line-height: 18px; "><div id="blog_text" class="cnt" style="font-family: Arial; word-wrap: break-word; word-break: normal; visibility: visible !important; zoom: 1 !important; filter: none; font-size: 14px; line-height: 20px; color: rgb(51, 51, 51); overflow-x: hidden; overflow-y: hidden; position: static; ">介绍AS3中常见的位运算技巧。<br />在AS3中位操作是非常快的，这里列出一些可以加快某些计算速度的代码片段集合。我不会解释什么是位运算符，也不会解释怎么使用他们，只能告诉大家如果想清楚其中的原理先认真学一下2进制.<br /><br /><br /><strong style="line-height: normal; ">左位移几就相当于乘以2的几次方</strong>（ Left bit shifting to multiply by any power of two ）<br /><br />大约快了300%<br /><div class="code" style="font-family: Arial; word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; font-size: 14px; line-height: normal; ">x = x * 2;<br />x = x * 64;<br />//相当于：<br />x = x &lt;&lt; 1;<br />x = x &lt;&lt; 6;</div><br /><strong style="line-height: normal; ">右位移几就相当于除以2的几次方</strong>（Right bit shifting to divide by any power of two）<br /><br />大约快了350%<br /><div class="code" style="font-family: Arial; word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; font-size: 14px; line-height: normal; ">x = x / 2;<br />x = x / 64;<br />//相当于：<br />x = x &gt;&gt; 1;<br />x = x &gt;&gt; 6;</div><br /><strong style="line-height: normal; ">Number 到 integer(整数)转换</strong><br /><br />在AS3中使用int(x)快了10% 。尽管如此位操作版本在AS2中工作的更好<br /><div class="code" style="font-family: Arial; word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; font-size: 14px; line-height: normal; ">x = int(1.232)<br />//相当于：<br />x = 1.232 &gt;&gt; 0;</div><br /><strong style="line-height: normal; ">提取颜色组成成分</strong><br /><br />不完全是个技巧，是正常的方法 (Not really a trick, but the regular way of extracting values using bit masking and shifting.)<br /><div class="code" style="font-family: Arial; word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; font-size: 14px; line-height: normal; ">//24bit<br />var color:uint = 0x336699;<br />var r:uint = color &gt;&gt; 16;<br />var g:uint = color &gt;&gt; 8 &amp; 0xFF;<br />var b:uint = color &amp; 0xFF;<br />//32bit<br />var color:uint = 0xff336699;<br />var a:uint = color &gt;&gt;&gt; 24;<br />var r:uint = color &gt;&gt;&gt; 16 &amp; 0xFF;<br />var g:uint = color &gt;&gt;&gt; 8 &amp; 0xFF;<br />var b:uint = color &amp; 0xFF;</div><br /><strong style="line-height: normal; ">合并颜色组成成分</strong><br /><br />替换值到正确位置并组合他们 (‘Shift up’ the values into the correct position and combine them.)<br /><div class="code" style="font-family: Arial; word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; font-size: 14px; line-height: normal; ">//24bit<br />var r:uint = 0x33;<br />var g:uint = 0x66;<br />var b:uint = 0x99;<br />var color:uint = r &lt;&lt; 16 | g &lt;&lt; 8 | b;<br />//32bit<br />var a:uint = 0xff;<br />var r:uint = 0x33;<br />var g:uint = 0x66;<br />var b:uint = 0x99;<br />var color:uint = a &lt;&lt; 24 | r &lt;&lt; 16 | g &lt;&lt; 8 | b;</div><br /><strong style="line-height: normal; ">使用异或运算交换整数而不需要用临时变量</strong><br /><br />这里快了 20%<br /><div class="code" style="font-family: Arial; word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; font-size: 14px; line-height: normal; ">var t:int = a;<br />a = b;<br />b = t;<br />//相当于:<br />a ^= b;<br />b ^= a;<br />a ^= b;</div><br /><strong style="line-height: normal; ">自增/自减</strong>(Increment/decrement)<br /><br />这个比以前的慢不少，但却是个模糊你代码的好方法；-）<br /><div class="code" style="font-family: Arial; word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; font-size: 14px; line-height: normal; ">i = -~i; // i++<br />i = ~-i; // i--</div><br /><strong style="line-height: normal; ">取反</strong>（Sign flipping using NOT or XOR）<br /><br />快了300%！<br /><div class="code" style="font-family: Arial; word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; font-size: 14px; line-height: normal; ">i = -i;<br />//相当于：<br />i = ~i + 1;<br />//或者<br />i = (i ^ -1) + 1;</div><br /><strong style="line-height: normal; ">使用bitwise AND快速取模</strong>&nbsp;（Fast modulo operation using bitwise AND）<br /><br />如果除数是2的次方，取模操作可以这样做：<br /><br />模数= 分子 &amp; (除数 - 1);<br /><br />这里大约快了600%<br /><div class="code" style="font-family: Arial; word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; font-size: 14px; line-height: normal; ">x = 131 % 4;<br />//相当于：<br />x = 131 &amp; (4 - 1);</div><br /><strong style="line-height: normal; ">检查是否为偶数</strong>（Check if an integer is even/uneven using bitwise AND）<br /><br />这里快了 600%<br /><div class="code" style="font-family: Arial; word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; font-size: 14px; line-height: normal; ">isEven = (i % 2) == 0;<br />//相当于：<br />isEven = (i &amp; 1) == 0;</div><br /><strong style="line-height: normal; ">绝对值</strong><br /><br />忘记 Math.abs()吧 (Forget Math.abs() for time critical code.)<br />version 1 比 Math.abs() 快了2500% ，version 2 居然比 version 1 又快了20% ！<br /><div class="code" style="font-family: Arial; word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; font-size: 14px; line-height: normal; ">//version 1<br />i = x &lt; 0 ? -x : x;<br />//version 2<br />i = (x ^ (x &gt;&gt; 31)) - (x &gt;&gt; 31);</div><br /><br />Comparing two integers for equal sign<br />This is 35% faster.<br /><div class="code" style="font-family: Arial; word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; font-size: 14px; line-height: normal; ">eqSign = a * b &gt; 0;<br />//equals:<br />eqSign = a ^ b &gt;= 0;</div><br />快速颜色转换从R5G5B5&nbsp;<wbr style="line-height: normal; ">到 R8G8B8 象素格式用移位<br /><div class="code" style="font-family: Arial; word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; font-size: 14px; line-height: normal; ">R8 = (R5 &lt;&lt; 3) | (R5 &gt;&gt; 2)<br />G8 = (R5 &lt;&lt; 3) | (R5 &gt;&gt; 2)<br />B8 = (R5 &lt;&lt; 3) | (R5 &gt;&gt; 2)</div></div></td></tr></tbody></table></span>]]></description>
 <link><![CDATA[http://juwen.blog.51cto.com/135311/234996]]></link>
 <author><![CDATA[juwen]]></author>
 <category><![CDATA[Web开发]]></category>
 <pubdate><![CDATA[Thu, 26 Nov 2009 10:35:18 +0000]]></pubdate>
</item>
<item>
 <title><![CDATA[as3.0位操作学习技巧]]></title>
 <description><![CDATA[<span class="Apple-style-span" style="font-size: 14px; font-family: 瀹嬩綋; line-height: 24px; ">百度百科中，取一个二进制末K位的操作是：<br />取末k位 | (1101101-&gt;1101,k=5) | x and (1 shl k-1)<br />其中and = &amp;&nbsp;&nbsp;&nbsp;&nbsp;shl = &lt;&lt;<br /><br /><br />在ActionScript3中，取末k位的操作这样是不行的，需要重新写。<br />那么仔细考虑一下，取末N位的操作应该如何取呢？<br /><br />先来看看，位操作中&amp;（and）操作符的应用：<br />1&amp;0=0<br />0&amp;0=0<br />所以呢：<br />001&amp;000=000<br />100&amp;111=100<br />101&amp;011=001<br /><br />如果位数不同呢？<br />101&amp;0=0<br />101&amp;1=1<br />101&amp;10=00<br />101&amp;11=01<br />101011&amp;111=011=11<br /><br />于是我们取x最后n位的办法就出来了：<br />x&amp;1111111(n个1)<br /><br />在AS3中具体的实现代码为：<br />x&amp;(~(~0&lt;&lt;n));<br /><br />再简化一下：<br />x&amp;(~(-1&lt;&lt;n));<br /><br />在很多AS3<a href="http://www.21shipin.com/program.aspx" target="_blank" title="程序视频教程" style="font-family: 瀹嬩綋; font-size: 14px; color: rgb(0, 0, 102); text-decoration: underline; "><strong>程序</strong></a>的优化中，这个操作可是很有用的：－）</span>]]></description>
 <link><![CDATA[http://juwen.blog.51cto.com/135311/234995]]></link>
 <author><![CDATA[juwen]]></author>
 <category><![CDATA[Web开发]]></category>
 <pubdate><![CDATA[Thu, 26 Nov 2009 10:32:59 +0000]]></pubdate>
</item>
<item>
 <title><![CDATA[使用php simple html dom parser解析html标签]]></title>
 <description><![CDATA[<h3 class=type_reprint title="转载"><a href="http://cai555.javaeye.com/blog/352355"><font color="#108ac6">使用php simple html dom parser解析html标签</font></a></h3>
<div class=blog_content>
<div>用了一下</div>
<h1><span style="font-size: x-small; font-family: 宋体"><a href="http://simplehtmldom.sourceforge.net/"><font color="#108ac6" size="1">PHP Simple HTML DOM Parser</font></a><font size="1"> </font></span></h1>
<div>解析HTML页面，感觉还不错，它能创建一个DOM tree方便你解析html里面的内容。用来抓东西挺好的。</div>
<div>&nbsp;</div>
<div>附带一个例子，你也到sourceforge下载压缩包看里面的例子：</div>
<div id="stylefour"></div><!----><!----><!---->
<h1 class=post><span style="font-size: small"><font size="2">Scraping data with PHP Simple HTML DOM Parser</font></span> </h1><!---->
<div>&nbsp;</div><!---->
<div><a href="http://simplehtmldom.sourceforge.net/"><font color="#108ac6">PHP Simple HTML DOM Parser</font></a> , written in PHP5+, allows you to manipulate HTML in a very easy way. Supporting invalid HTML, this parser is better then other PHP scripts using complicated regexes to extract information from web pages.</div>
<div>Before getting the necessary info, a DOM should be created from either URL or file. The following script extracts links &amp; images from a website:</div>
<div class=bar>
<div class=tools><a href="http://www.bitrepository.com/web-programming/php/simple-html-dom-parser.html#"><font color="#108ac6">view plain</font></a> <a href="http://www.bitrepository.com/web-programming/php/simple-html-dom-parser.html#"><font color="#108ac6">copy to clipboard</font></a> <a href="http://www.bitrepository.com/web-programming/php/simple-html-dom-parser.html#"><font color="#108ac6">print</font></a> <a href="http://www.bitrepository.com/web-programming/php/simple-html-dom-parser.html#"><font color="#108ac6">?</font></a> </div></div>
<div class=alt><span></span>&nbsp;</div>
<div class=dp-highlighter>
<div class=bar>
<div class=tools>Php代码 <a title="复制代码" onclick="dp.sh.Toolbar.CopyToClipboard(this);return false;" href="http://cai555.javaeye.com/blog/352355#"><img onclick='window.open(this.src)' alt="复制代码" src="http://cai555.javaeye.com/images/icon_copy.gif" /></a></div></div>
<ol class=dp-c>
<li><span><span class=comment><font color="#008200">//&nbsp;Create&nbsp;DOM&nbsp;from&nbsp;URL&nbsp;or&nbsp;file </font></span><span>&nbsp;&nbsp;</span></span> 
<li><span></span><span class=vars>$html</span><span>&nbsp;=&nbsp;file_get_html(</span><span class=string><font color="#0000ff">'http://www.microsoft.com/'</font></span><span>); &nbsp;&nbsp;</span></span> 
<li><span>&nbsp;&nbsp;</span> 
<li><span></span><span class=comment><font color="#008200">//&nbsp;Extract&nbsp;links </font></span><span>&nbsp;&nbsp;</span></span> 
<li><span></span><span class=keyword><strong><font color="#7f0055">foreach</font></strong></span><span>(</span><span class=vars>$html</span><span>-&gt;find(</span><span class=string><font color="#0000ff">'a'</font></span><span>)&nbsp;</span><span class=keyword><strong><font color="#7f0055">as</font></strong></span><span>&nbsp;</span><span class=vars>$element</span><span>) &nbsp;&nbsp;</span></span> 
<li><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class=func>echo</span><span>&nbsp;</span><span class=vars>$element</span><span>-&gt;href&nbsp;.&nbsp;</span><span class=string><font color="#0000ff">'&lt;br&gt;'</font></span><span>;&nbsp; &nbsp;&nbsp;</span></span> 
<li><span>&nbsp;&nbsp;</span> 
<li><span></span><span class=comment><font color="#008200">//&nbsp;Extract&nbsp;images </font></span><span>&nbsp;&nbsp;</span></span> 
<li><span></span><span class=keyword><strong><font color="#7f0055">foreach</font></strong></span><span>(</span><span class=vars>$html</span><span>-&gt;find(</span><span class=string><font color="#0000ff">'img'</font></span><span>)&nbsp;</span><span class=keyword><strong><font color="#7f0055">as</font></strong></span><span>&nbsp;</span><span class=vars>$element</span><span>) &nbsp;&nbsp;</span></span> 
<li><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class=func>echo</span><span>&nbsp;</span><span class=vars>$element</span><span>-&gt;src&nbsp;.&nbsp;</span><span class=string><font color="#0000ff">'&lt;br&gt;'</font></span><span>;&nbsp;&nbsp;</span></span></li></ol></div><pre class=php style="display: none" name="code">// Create DOM from URL or file
$html = file_get_html('http://www.microsoft.com/');
// Extract links
foreach($html-&gt;find('a') as $element)
       echo $element-&gt;href . '&lt;br&gt;'; 
// Extract images
foreach($html-&gt;find('img') as $element)
       echo $element-&gt;src . '&lt;br&gt;';
</pre>
<div>The parser can also be used to modify HTML elements:</div>
<div class=bar>
<div class=tools><a href="http://www.bitrepository.com/web-programming/php/simple-html-dom-parser.html#"><font color="#108ac6">view plain</font></a> <a href="http://www.bitrepository.com/web-programming/php/simple-html-dom-parser.html#"><font color="#108ac6">copy to clipboard</font></a> <a href="http://www.bitrepository.com/web-programming/php/simple-html-dom-parser.html#"><font color="#108ac6">print</font></a> <a href="http://www.bitrepository.com/web-programming/php/simple-html-dom-parser.html#"><font color="#108ac6">?</font></a> </div></div>
<div class=alt><span></span>&nbsp;</div>
<div class=dp-highlighter>
<div class=bar>
<div class=tools>Php代码 <a title="复制代码" onclick="dp.sh.Toolbar.CopyToClipboard(this);return false;" href="http://cai555.javaeye.com/blog/352355#"><img onclick='window.open(this.src)' alt="复制代码" src="http://cai555.javaeye.com/images/icon_copy.gif" /></a></div></div>
<ol class=dp-c>
<li><span><span class=comment><font color="#008200">//&nbsp;Create&nbsp;DOM&nbsp;from&nbsp;string </font></span><span>&nbsp;&nbsp;</span></span> 
<li><span></span><span class=vars>$html</span><span>&nbsp;=&nbsp;str_get_html(</span><span class=string><font color="#0000ff">'&lt;div&nbsp;id="simple"&gt;Simple&lt;/div&gt;&lt;div&nbsp;id="parser"&gt;Parser&lt;/div&gt;'</font></span><span>); &nbsp;&nbsp;</span></span> 
<li><span>&nbsp;&nbsp;</span> 
<li><span></span><span class=vars>$html</span><span>-&gt;find(</span><span class=string><font color="#0000ff">'div'</font></span><span>,&nbsp;1)-&gt;</span><span class=keyword><strong><font color="#7f0055">class</font></strong></span><span>&nbsp;=&nbsp;</span><span class=string><font color="#0000ff">'bar'</font></span><span>; &nbsp;&nbsp;</span></span> 
<li><span>&nbsp;&nbsp;</span> 
<li><span></span><span class=vars>$html</span><span>-&gt;find(</span><span class=string><font color="#0000ff">'div[id=simple]'</font></span><span>,&nbsp;0)-&gt;innertext&nbsp;=&nbsp;</span><span class=string><font color="#0000ff">'Foo'</font></span><span>; &nbsp;&nbsp;</span></span> 
<li><span>&nbsp;&nbsp;</span> 
<li><span></span><span class=comment><font color="#008200">//&nbsp;Output:&nbsp;&lt;div&nbsp;id="simple"&gt;Foo&lt;/div&gt;&lt;div&nbsp;id="parser"&nbsp;class="bar"&gt;Parser&lt;/div&gt; </font></span><span>&nbsp;&nbsp;</span></span> 
<li><span></span><span class=func>echo</span><span>&nbsp;</span><span class=vars>$html</span><span>;&nbsp;&nbsp;</span></span></li></ol></div><pre class=php style="display: none" name="code">// Create DOM from string
$html = str_get_html('&lt;div id="simple"&gt;Simple&lt;/div&gt;&lt;div id="parser"&gt;Parser&lt;/div&gt;');
$html-&gt;find('div', 1)-&gt;class = 'bar';
$html-&gt;find('div[id=simple]', 0)-&gt;innertext = 'Foo';
// Output: &lt;div id="simple"&gt;Foo&lt;/div&gt;&lt;div id="parser" class="bar"&gt;Parser&lt;/div&gt;
echo $html;
</pre>
<div>Do you wish to retrieve content without any tags?</div>
<div class=bar>
<div class=tools><a href="http://www.bitrepository.com/web-programming/php/simple-html-dom-parser.html#"><font color="#108ac6">view plain</font></a> <a href="http://www.bitrepository.com/web-programming/php/simple-html-dom-parser.html#"><font color="#108ac6">copy to clipboard</font></a> <a href="http://www.bitrepository.com/web-programming/php/simple-html-dom-parser.html#"><font color="#108ac6">print</font></a> <a href="http://www.bitrepository.com/web-programming/php/simple-html-dom-parser.html#"><font color="#108ac6">?</font></a> </div></div>
<div class=alt><span></span>&nbsp;</div>
<div class=dp-highlighter>
<div class=bar>
<div class=tools>Php代码 <a title="复制代码" onclick="dp.sh.Toolbar.CopyToClipboard(this);return false;" href="http://cai555.javaeye.com/blog/352355#"><img onclick='window.open(this.src)' alt="复制代码" src="http://cai555.javaeye.com/images/icon_copy.gif" /></a></div></div>
<ol class=dp-c>
<li><span><span class=func>echo</span><span>&nbsp;file_get_html(</span><span class=string><font color="#0000ff">'http://www.yahoo.com/'</font></span><span>)-&gt;plaintext;&nbsp;&nbsp;</span></span></li></ol></div><pre class=php style="display: none" name="code">echo file_get_html('http://www.yahoo.com/')-&gt;plaintext;</pre>
<div>In the package files of this parser ([url]http://simplehtmldom.sourceforge.net/[/url]) you can find some scraping examples from digg, imdb, slashdot. Let’s create one that extracts the first 10 results (titles only) for the keyword “php” from Google:</div>
<div class=bar>
<div class=tools><a href="http://www.bitrepository.com/web-programming/php/simple-html-dom-parser.html#"><font color="#108ac6">view plain</font></a> <a href="http://www.bitrepository.com/web-programming/php/simple-html-dom-parser.html#"><font color="#108ac6">copy to clipboard</font></a> <a href="http://www.bitrepository.com/web-programming/php/simple-html-dom-parser.html#"><font color="#108ac6">print</font></a> <a href="http://www.bitrepository.com/web-programming/php/simple-html-dom-parser.html#"><font color="#108ac6">?</font></a> </div></div>
<div class=alt>&nbsp;</div>
<div class=dp-highlighter>
<div class=bar>
<div class=tools>Php代码 <a title="复制代码" onclick="dp.sh.Toolbar.CopyToClipboard(this);return false;" href="http://cai555.javaeye.com/blog/352355#"><img onclick='window.open(this.src)' alt="复制代码" src="http://cai555.javaeye.com/images/icon_copy.gif" /></a></div></div>
<ol class=dp-c>
<li><span><span class=vars>$url</span><span>&nbsp;=&nbsp;</span><span class=string><font color="#0000ff">'http://www.google.com/search?hl=en&amp;q=php&amp;btnG=Search'</font></span><span>; &nbsp;&nbsp;</span></span> 
<li><span>&nbsp;&nbsp;</span> 
<li><span></span><span class=comment><font color="#008200">//&nbsp;Create&nbsp;DOM&nbsp;from&nbsp;URL </font></span><span>&nbsp;&nbsp;</span></span> 
<li><span></span><span class=vars>$html</span><span>&nbsp;=&nbsp;file_get_html(</span><span class=vars>$url</span><span>); &nbsp;&nbsp;</span></span> 
<li><span>&nbsp;&nbsp;</span> 
<li><span></span><span class=comment><font color="#008200">//&nbsp;Match&nbsp;all&nbsp;'A'&nbsp;tags&nbsp;that&nbsp;have&nbsp;the&nbsp;class&nbsp;attribute&nbsp;equal&nbsp;with&nbsp;'l' </font></span><span>&nbsp;&nbsp;</span></span> 
<li><span></span><span class=keyword><strong><font color="#7f0055">foreach</font></strong></span><span>(</span><span class=vars>$html</span><span>-&gt;find(</span><span class=string><font color="#0000ff">'a[class=l]'</font></span><span>)&nbsp;</span><span class=keyword><strong><font color="#7f0055">as</font></strong></span><span>&nbsp;</span><span class=vars>$key</span><span>&nbsp;=&gt;&nbsp;</span><span class=vars>$info</span><span>) &nbsp;&nbsp;</span></span> 
<li><span>{ &nbsp;&nbsp;</span> 
<li><span></span><span class=func>echo</span><span>&nbsp;(</span><span class=vars>$key</span><span>&nbsp;+&nbsp;1).</span><span class=string><font color="#0000ff">'.&nbsp;'</font></span><span>.</span><span class=vars>$info</span><span>-&gt;plaintext.</span><span class=string><font color="#0000ff">"&lt;br&nbsp;/&gt;\n"</font></span><span>; &nbsp;&nbsp;</span></span> 
<li><span>}&nbsp;&nbsp;</span></li></ol></div><pre class=php style="display: none" name="code">$url = 'http://www.google.com/search?hl=en&amp;q=php&amp;btnG=Search';
// Create DOM from URL
$html = file_get_html($url);
// Match all 'A' tags that have the class attribute equal with 'l'
foreach($html-&gt;find('a[class=l]') as $key =&gt; $info)
{
echo ($key + 1).'. '.$info-&gt;plaintext."&lt;br /&gt;\n";
}</pre>
<div><strong>NOTE</strong> Make sure to include the parser before using any functions of it:</div>
<div class=bar>
<div class=tools><a href="http://www.bitrepository.com/web-programming/php/simple-html-dom-parser.html#"><font color="#108ac6">view plain</font></a> <a href="http://www.bitrepository.com/web-programming/php/simple-html-dom-parser.html#"><font color="#108ac6">copy to clipboard</font></a> <a href="http://www.bitrepository.com/web-programming/php/simple-html-dom-parser.html#"><font color="#108ac6">print</font></a> <a href="http://www.bitrepository.com/web-programming/php/simple-html-dom-parser.html#"><font color="#108ac6">?</font></a> </div></div>
<div class=alt>Php代码 <a title="复制代码" onclick="dp.sh.Toolbar.CopyToClipboard(this);return false;" href="http://cai555.javaeye.com/blog/352355#"><img onclick='window.open(this.src)' alt="复制代码" src="http://cai555.javaeye.com/images/icon_copy.gif" /></a></div>
<div class=dp-highlighter>
<ol class=dp-c>
<li><span><span class=keyword><strong><font color="#7f0055">include</font></strong></span><span>&nbsp;</span><span class=string><font color="#0000ff">'simple_html_dom.php'</font></span><span>;&nbsp;&nbsp;</span></span></li></ol></div><pre class=php style="display: none" name="code">include 'simple_html_dom.php';</pre>
<div>For more information regarding the usage of this function consider checking the ‘PHP Simple HTML Dom Parser’ Manual. To download the package files use the following URL: <a href="http://sourceforge.net/project/showfiles.php?group_id=218559"><font color="#108ac6">[url]http://sourceforge.net/project/showfiles.php?group_id=218559[/url]</font></a> .</div></div>]]></description>
 <link><![CDATA[http://juwen.blog.51cto.com/135311/152801]]></link>
 <author><![CDATA[juwen]]></author>
 <category><![CDATA[Web开发]]></category>
 <pubdate><![CDATA[Fri, 24 Apr 2009 08:24:54 +0000]]></pubdate>
</item>
<item>
 <title><![CDATA[openfire spark用户名问题续]]></title>
 <description><![CDATA[<div>关于openfire和spark无法使用中文用户名的问题。</div>
<div>前一篇文章通过更改数据库虽然可以使用中文用户名，但通过spark无法使用中文用户名进行登陆。</div>
<div>&nbsp;</div>
<div>这里需要重新编译spark。</div>
<div>通过svn下载最新的代码重新编译后就可以了。</div>
<div>&nbsp;</div>
<div>通过修改资源文件可以将没有汉化的部分汉化，资源文件使用utf-8编码。</div>
<div>&nbsp;</div>
<div>通过改写部分代码可以去除一些没有用的菜单。再修改一下界面就OK了。</div>]]></description>
 <link><![CDATA[http://juwen.blog.51cto.com/135311/139869]]></link>
 <author><![CDATA[juwen]]></author>
 <category><![CDATA[Java]]></category>
 <pubdate><![CDATA[Wed, 18 Mar 2009 10:12:46 +0000]]></pubdate>
</item>
<item>
 <title><![CDATA[openfire的一些问题]]></title>
 <description><![CDATA[<div><a href="http://www.igniterealtime.org/">[url]http://www.igniterealtime.org/[/url]</a></div>
<div>&nbsp;</div>
<div>解压到/opt下，然后运行openfire，接着进入进行安装配置。</div>
<div>结果配置好后发现所有中文帐户都无法登陆。数据库用的是utf8，openfire对utf8不支持，可以通过改JDBC 驱动链接来实现支持utf8.</div>
<div>
<div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas,"Courier New',courier,monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"><pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas,"Courier New',courier,monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"><span style="color: #606060">   1:</span> jdbc:mysql:<span style="color: #008000">//localhost:3306/openfire?useUnicode=true&amp;characterEncoding=UTF-8&amp;characterSetResults=UTF-8 </span></pre><pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas,"Courier New',courier,monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"><span style="color: #606060">   2:</span> 其实填的是</pre><pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas,"Courier New',courier,monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"><span style="color: #606060">   3:</span> jdbc:mysql:<span style="color: #008000">//localhost:3306/openfire?useUnicode=true&amp;amp;characterEncoding=UTF-8&amp;amp;characterSetResults=UTF-8 </span></pre></div></div>
<div>&nbsp;</div>
<div>OpenFire的JVM默认情况下使用64M内存<br />这在将OpenFire作为服务运行的情况下肯定不够用<br />我们需要修改参数.使其能够占用服务器的更多内存资源</div>
<div>Windows:<br />在openfire的bin目录下建立openfired.vmoptions(作为应用程序运行)或者openfire-service.vmoptions(作为服务运行)<br />内容添加<br />-Xms512m<br />-Xmx512m</div>
<div>Linux:<br />修改/etc/sysconfig/opfire文件<br />去掉注释<br />OPENFIRE_OPTS=”-Xmx512m”</div>
<div>&nbsp;</div>
<div>OpenFire在安装第一次设置了服务器名后<br />虽然可以通过管理界面修改<br />但是修改后的Openfire却无法正常工作<br />而服务器名前也会有个惊叹号<br />其实查看openfire的警告记录我们可以发现<br />在修改了服务器名后重启<br />会有两条关于证书的警告消息<br />由于openfire在设置好之后<br />会用服务器名来作为证书的一部分<br />所以只是单纯的修改服务器名<br />会导致证书和服务器不一致<br />导致无法正常使用</div>
<div>解决方法:<br />服务器设置 -&gt; 服务器证书<br />将原来的两个密钥删除<br />然后会提示重启http服务<br />点击重启并重新登陆管理界面<br />回到删除密钥的地方<br />会提示现在没有密钥,需要添加密钥<br />点添加.OK了.按照新的服务器名的密钥已经生成并且添加了<br />这时候再回去看服务器状态,服务器名前面的惊叹号已经没有了<br />我们也可以正常使用jabber服务了</div>]]></description>
 <link><![CDATA[http://juwen.blog.51cto.com/135311/139627]]></link>
 <author><![CDATA[juwen]]></author>
 <category><![CDATA[Java]]></category>
 <pubdate><![CDATA[Tue, 17 Mar 2009 13:49:22 +0000]]></pubdate>
</item>
<item>
 <title><![CDATA[霍夫变换(Hough Transform) ]]></title>
 <description><![CDATA[<font color="#5754d1">霍夫变换是图像处理中从图像中识别几何形状的基本方法之一，应用很广泛，也有很多改<br />进算法。最基本的霍夫变换是从黑白图像中检测直线(线段)。<br /><br />我们先看这样一个问题：设已知一黑白图像上画了一条直线，要求出这条直线所在的位置<br />。我们知道，直线的方程可以用y=k*x+b 来表示，其中k和b是参数，分别是斜率和截距。过某一点<br />(x0,y0)的所有直线的参数都会满足方程y0=kx0+b。即点(x0,y0)确定了一族直线。方程y0=kx0+b在<br />参数k--b平面上是一条直线，(你也可以是方程b=-x0*k+y0对应的直线)。这样，图像x--y平面上的<br />一个前景像素点就对应到参数平面上的一条直线。我们举个例子说明解决前面那个问题的原理。设<br />图像上的直线是y=x, 我们先取上面的三个点：A(0,0), B(1,1), C(22)。可以求出，过A点的直线<br />的参数要满足方程b=0, 过B点的直线的参数要满足方程1=k+b, 过C点的直线的参数要满足方程<br />2=2k+b, 这三个方程就对应着参数平面上的三条直线，而这三条直线会相交于一点(k=1,b=0)。　同<br />理，原图像上直线y=x上的其它点(如(3,3),(4,4)等)　对应参数平面上的直线也会通过点(k=1,b=0)<br />。这个性质就为我们解决问题提供了方法：<br /><br />首先，我们初始化一块缓冲区，对应于参数平面，将其所有数据置为0.<br /><br />对于图像上每一前景点，求出参数平面对应的直线，把这直线上的所有点的值都加１。<br /><br />最后，找到参数平面上最大点的位置，这个位置就是原图像上直线的参数。<br /><br />上面就是霍夫变换的基本思想。就是把图像平面上的点对应到参数平面上的线，最后通过<br />统计特性来解决问题。假如图像平面上有两条直线，那么最终在参数平面上就会看到两个峰值点，<br />依此类推。<br /><br />在实际应用中，y=k*x+b形式的直线方程没有办法表示x=c形式的直线(这时候，直线的斜<br />率为无穷大)。所以实际应用中，是采用参数方程p=x*cos(theta)+y*sin(theta)。这样，图像平面<br />上的一个点就对应到参数p---theta平面上的一条曲线上。其它的还是一样。<br /><br />在看下面一个问题：我们要从一副图像中检测出半径以知的圆形来。这个问题比前一个还<br />要直观。我们可以取和图像平面一样的参数平面，以图像上每一个前景点为圆心，以已知的半径在<br />参数平面上画圆，并把结果进行累加。最后找出参数平面上的峰值点，这个位置就对应了图像上的<br />圆心。在这个问题里，图像平面上的每一点对应到参数平面上的一个圆。<br /><br />把上面的问题改一下，假如我们不知道半径的值，而要找出图像上的圆来。这样，一个办<br />法是把参数平面扩大称为三维空间。就是说，参数空间变为x--y--R三维，对应圆的圆心和半径。<br />图像平面上的每一点就对应于参数空间中每个半径下的一个圆，这实际上是一个圆锥。最后当然还<br />是找参数空间中的峰值点。不过，这个方法显然需要大量的内存，运行速度也会是很大问题。<br /><br />有什么更好的方法么?我们前面假定的图像都是黑白图像(2值图像)，实际上这些2值图像<br />多是彩色或灰度图像通过边缘提取来的。我们前面提到过，图像边缘除了位置信息，还有方向信息<br />也很重要，这里就用上了。根据圆的性质，圆的半径一定在垂直于圆的切线的直线上，也就是说，<br />在圆上任意一点的法线上。这样，解决上面的问题，我们仍采用2维的参数空间，对于图像上的每<br />一前景点，加上它的方向信息，都可以确定出一条直线，圆的圆心就在这条直线上。这样一来，问<br />题就会简单了许多。<br /><br />接下来还有许多类似的问题，如检测出椭圆，正方形，长方形，圆弧等等。这些方法大都<br />类似，关键就是需要熟悉这些几何形状的数学性质。霍夫变换的应用是很广泛的，比如我们要做一<br />个支票识别的任务，假设支票上肯定有一个红颜色的方形印章，我们可以通过霍夫变换来对这个印<br />章进行快速定位，在配合其它手段进行其它处理。霍夫变换由于不受图像旋转的影响，所以很容易<br />的可以用来进行定位。<br /><br />霍夫变换有许多改进方法，一个比较重要的概念是广义霍夫变换，它是针对所有曲线的，<br />用处也很大。就是针对直线的霍夫变换也有很多改进算法，比如前面的方法我们没有考虑图像上的<br />这一直线上的点是否连续的问题，这些都要随着应用的不同而有优化的方法。<br /><br />顺便说一句，搞图像处理这一行，在理论方面，有几本杂志是要看的，自然是英文杂志，<br />中文期刊好象没有专门的图像处理期刊，当然也有不少涉及这方面的期刊，但事实求是来说，的确<br />比英文杂志水平差很多。<br /><br />‘IEEE Transactions on Pattern And Machine Intelligence’<br />‘IEEE Transactions on Image Processing’<br /><br />是最重要的两本，其它的如ICIP等的会议文章也非常好。不过，要不想很偏理论，<br />这些玩艺儿也没什么要看的。</font>]]></description>
 <link><![CDATA[http://juwen.blog.51cto.com/135311/133452]]></link>
 <author><![CDATA[juwen]]></author>
 <category><![CDATA[开发技术]]></category>
 <pubdate><![CDATA[Fri, 27 Feb 2009 10:32:36 +0000]]></pubdate>
</item>
<item>
 <title><![CDATA[halcon边缘检测Filter Edges]]></title>
 <description><![CDATA[<div>以前用opencv时用canny算法用得挺多。</div>
<div>所以用halcon时，我也直接用canny算法。</div>
<div>介绍一下Canny算子： <br />使用累计直方图计算两个阀值。凡是大于高阀值的一定是边缘； 凡是小于低阀值的一定不是边缘；如果检测结果大于低阀值但又小于高阀值，那就要看这个像素的邻接像素中有没有超过高阀值的边缘像素：如果有的话那么它就是边缘了，否则他就不是边缘；</div>
<div>&nbsp;</div>
<div>halcon里面</div>
<div><u><font color="#ff0000"><span style="font-weight: 600; font-size: large; font-family: courier new,courier"><font size="2">edges_sub_pix</font></span><span style="font-size: large; font-family: courier new,courier"><font size="3"><font size="2">(Image:Edges:Filter,Alpha,Low,High:)</font></font></span></font></u></div>
<div><u><font color="#ff0000" size="2"><span style="font-size: large; font-family: courier new,courier"></span></font></u>&nbsp;</div>
<div><span style="font-size: large; font-family: courier new,courier"><font size="3">提供了这个方法。</font></span></div>
<div><span style="font-size: large; font-family: courier new,courier"><font size="3"></font></span>&nbsp;</div>
<div><span style="font-size: large; font-family: courier new,courier"><font size="3">alpha：参数指定值越小，平滑越强大，会减少边缘细节。(canny刚好相反，值越大，边缘细节越少)。</font></span></div>
<div><span style="font-size: large; font-family: courier new,courier"><font size="3"></font></span>&nbsp;</div>
<div><span style="font-size: large; font-family: courier new,courier"><font size="3">Low：低阀值</font></span></div>
<div><span style="font-size: large; font-family: courier new,courier"><font size="3">High：高阀值</font></span></div>
<div><span style="font-size: large; font-family: courier new,courier"><font size="3"></font></span>&nbsp;</div>
<div><span style="font-size: large; font-family: courier new,courier"><font size="3">例如：</font></span></div>
<div><span style="font-size: large; font-family: courier new,courier"><font size="3"><span style="font-family: courier new,courier"><font color="#ff0000">read_image(Image,'test.bmp') </font></span></div><pre style="margin: 0px 0px 12px; text-indent: 0px; font-family: courier new,courier; qt-block-indent: 0"><font color="#ff0000">edges_sub_pix(Image,Edges,'canny',0.5,20,40)</font></pre><pre style="margin: 0px 0px 12px; text-indent: 0px; font-family: courier new,courier; qt-block-indent: 0">&nbsp;</pre><pre style="margin: 0px 0px 12px; text-indent: 0px; font-family: courier new,courier; qt-block-indent: 0">&nbsp;</pre></font></span>]]></description>
 <link><![CDATA[http://juwen.blog.51cto.com/135311/133003]]></link>
 <author><![CDATA[juwen]]></author>
 <category><![CDATA[开发技术]]></category>
 <pubdate><![CDATA[Wed, 25 Feb 2009 15:43:06 +0000]]></pubdate>
</item>
<item>
 <title><![CDATA[对设计模式的一些总结收藏]]></title>
 <description><![CDATA[<div>OOP思想：抽象、继承、多态、统一接口、功能最小化、对象只对自己负责<br />设计模式原则：“开-闭原则“，“优先使用组合”</div>
<div><br />对设计模式的一些总结：</div>
<div>外观模式：”将复杂的接口简单化“<br />最底层（最接近实现）的模式，其上层可以是桥接模式，可以是抽象工厂模式，甚至是最简单<br />的模板方法模式，甚至什么模式都没有，仅仅是简单的类封装或函数封装，但是它却是我们生活中实实在<br />在最常用的模式之一，它封装复杂的功能，向上展现简单的接口或方法。TerryLee常说外观模式是亡羊补牢，<br />我觉得还应该发挥我们的“拿来主义”，对我们有用的东西我们就毫不客气地拿来，使用外观模式加以利用。</div>
<div>适配式模式：“转换接口“<br />适配器模式和外观模式有很多相似的地方，两者都是用在最接近实现的层次，而且都是封装转换。<br />但适配器模式更注重于转换接口。</div>
<div>在实际使用中，我们不必拘泥于这两者的区别，这是很重要的。</div>
<div>抽象工厂模式：“系例化工厂生产系列化对象“<br />这是大家所认为最没有明显优点的模式了，从短期来看，它甚至把简单的问题复杂化了。<br />它屏蔽我们通常的new，将类的实例化封装起来，并延迟到工厂对象中，通过工厂的CreateInstance()<br />方法来管理。通常一个工厂只负责生产一种产品，所以的工厂和所以的产品都拥有统一的接口，<br />都通过抽象工厂或抽象产品来派生。</div>
<div>工厂方法有很好变种，但它们统一的特点就是，屏蔽了用户直接new对象，给库接口设计者提供了<br />切换对象的空间，当然，也可以由用户来选择工厂。</div>
<div>桥接模式：“将对象的变化部分分离开来，实现形态与变化的分离“<br />如果一个抽象的类存在多个变化部分，如形状和行为，采用传统派生的方法必须造成类爆炸现象。<br />桥接模式，将这两个变化部分分离，实现松耦合。</div>
<div>装饰模式：“对现有的接口进行包装，增加新的功能“<br />装饰模式和桥接模式、外观模式有相似的地方，它们都面向已有的接口，后两者的注重转换，而<br />装饰模式注重增加新功能。</div>
<div>模板方法模式：“提供抽象的基类接口“<br />最简单也是最常见的模式这一。如插件设计。</div>
<div>命令模式<br />命令模式有三个用法：<br />1 “OOP时代回调的替代，扩展性好“<br />回调实现了调用者也被调用者的分离，调用者不用关心被调用者（是否存在，在哪里）。但调用者<br />与被调用者需要函数形式的协商。<br />OOP时代，命令模式用来代替回调，调用者与被调用者需要类名及接口的协商。客户可以将派生的<br />类对象传递给调用者，由调用者在必要的时候调用对象的协商方法（Execute()）。<br />特点：由于类可以派生，因而只要一个协商，就可以实现多个命令的回调，而更容易管理。传统回调<br />必须每一个都要协商。<br />2. “集中管理命令代码”<br />如菜单命令管理，client只需要将要执行的代码封装在Command对象，并以name-Command的方式，向<br />命令管理者注册，就可以在需要的时候以name的方式执行这段代码。<br />3. “以任务的方式下达命令“<br />命令执行者不需要知道命令的名字、类型，client下达命令对象，执行者无条件执行。</div>
<div>迭代器模式：“隐藏数据及Iteator的细节“<br />提供GetItemCount(), Move(n), MoveFirst(), MoveNext(), MovePrevs(), MoveLast()等方法来<br />访问迭代器数据。</div>
<div>观察者模式：“处理1:n的依赖变化关系”<br />将管理观察者的责任由client转移到了观察者本身。将被依赖者的变化，调用观察者的通知方法，<br />使观察者主动更新数据。这实现了用户与（依赖者和观察者）的解耦，增大了依赖者和观察者耦合<br />关系。</div>
<div>生成器/建造者模式：“Driver-Builder-对象”<br />举个例子来说明：<br />顾客去KFC买套餐，他把要求告诉收银员（Driver），收银员然后通告工作人员（Builder），<br />工作人员把食品（对象）按照需求收集过来（算法），交给收银员，然后由收银员交给顾客。<br />这和工厂模式有些相似，但是不同之处是一个工厂只生产一种产品，而且生产过程比较简单(new)。<br />建器者模式的侧重点是，由Driver选择不同的Builder，生产出较为复杂的产品。生产的过程对<br />Driver也是透明的。</div>
<div><br />单件模式：“保证只有一个实例“<br />getInstance()</div>
<div><a href="http://blog.csdn.net/JsuFcz/archive/2008/11/15/3305101.aspx"></a>&nbsp;</div>]]></description>
 <link><![CDATA[http://juwen.blog.51cto.com/135311/132160]]></link>
 <author><![CDATA[juwen]]></author>
 <category><![CDATA[软件工程&测试]]></category>
 <pubdate><![CDATA[Sat, 21 Feb 2009 09:17:05 +0000]]></pubdate>
</item>
<item>
 <title><![CDATA[CRectTracker(橡皮筋)类的使用]]></title>
 <description><![CDATA[<div class=MsoNormal style="margin: 0cm 0cm 0pt"><span>CRectTracker</span><span>（俗称<span>“</span>橡皮筋<span>”</span>类）是一个非常有意思的类。你在<span>Windows</span>中，在桌面上用鼠标拖拽，便可以看到一个虚线的矩形框，它便是橡皮筋<span>.</span>它可以用做显示边界，你也可以扽它的八个角用来放大缩小，做框选使用。如何通过编程来实现这种功能呢？这就是<span>CRectTracker</span>类的作用；</span></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt"><span>介绍橡皮筋类前，先介绍其他两个类：</span></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt"><span>Cpoint </span><span>类</span><span> </span><span>或</span><span>Point</span><span>类，</span><span>cpoint.x<span style="mso-spacerun: yes">&nbsp;&nbsp; </span>cpoint.y</span><span>，作为屏幕上的坐标上的</span><span>x</span><span>和</span><span>y </span><span>轴的坐标。</span></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt"></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt"><span>CRect</span><span>类</span><span>,</span><span>既矩形类。</span></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt"><span>crect.left<span style="mso-spacerun: yes">&nbsp;&nbsp; </span>crect.bottom<span style="mso-spacerun: yes">&nbsp;&nbsp; </span>crect.top<span style="mso-spacerun: yes">&nbsp;&nbsp; </span>crect.right</span><span>，</span></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt"><span>Crect::setrect(crect.left, crect.top, crect.right,crect.bottom);</span></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt"></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt"></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt"><span>CrectTracker </span><span>类成员：</span></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt"><strong style="mso-bidi-font-weight: normal"><span>一</span></strong><strong style="mso-bidi-font-weight: normal"><span> </span></strong><strong style="mso-bidi-font-weight: normal"><span>数据成员：</span></strong><strong style="mso-bidi-font-weight: normal"><span>(</span></strong><strong style="mso-bidi-font-weight: normal"><span>摘自</span></strong><strong style="mso-bidi-font-weight: normal"><span>msdn 2000,</span></strong><strong style="mso-bidi-font-weight: normal"><span>省略了一些</span></strong><strong style="mso-bidi-font-weight: normal"><span>)</span></strong></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt"><strong style="mso-bidi-font-weight: normal"><span><font face="Times New Roman">1. </font><a href="mk:@MSITStore:D:%20Program%20Files%20Microsoft%20Visual%20Studio%20MSDN%202001OCT%201033%20vcmfc.chm::/html/_mfc_crecttracker.3a3a.m_rect.htm"><span style="color: windowtext; text-decoration: none"><font face="Times New Roman">m_rect</font></span></a></span></strong></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt"><span>当前橡皮筋矩形的矩形框的位置</span></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt"><strong style="mso-bidi-font-weight: normal"><span style="font-size: 10pt">2. </span><span><a href="mk:@MSITStore:D:%20Program%20Files%20Microsoft%20Visual%20Studio%20MSDN%202001OCT%201033%20vcmfc.chm::/html/_mfc_crecttracker.3a3a.m_sizemin.htm"><span style="color: windowtext; text-decoration: none"><font face="Times New Roman">m_sizeMin</font></span></a></span></strong></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt"><span>决定橡皮筋矩形的最新的长和宽</span></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt"><strong style="mso-bidi-font-weight: normal"><span><font face="Times New Roman">3.</font><a href="mk:@MSITStore:D:%20Program%20Files%20Microsoft%20Visual%20Studio%20MSDN%202001OCT%201033%20vcmfc.chm::/html/_mfc_crecttracker.3a3a.m_nstyle.htm"><span style="color: windowtext; text-decoration: none"><font face="Times New Roman">m_nStyle</font></span></a></span></strong></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt"><span>橡皮筋矩形的形式</span><span><span style="mso-spacerun: yes"><font face="Times New Roman"> </font></span></span><strong style="mso-bidi-font-weight: normal"><span>如：</span></strong></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt 68.85pt; text-indent: -68.85pt; mso-char-indent-count: -6.86"><strong><span style="font-size: 10pt">CRectTracker::solidLine</span></strong><span style="font-size: 10pt">&nbsp;&nbsp;&nbsp;<strong> </strong></span><span style="font-size: 10pt; mso-bidi-font-weight: bold">用实线标记矩形框</span><span style="font-size: 10pt; mso-bidi-font-weight: bold"><span style="mso-spacerun: yes"> </span></span></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt 68.85pt; text-indent: -68.85pt; mso-char-indent-count: -6.86"><strong><span style="font-size: 10pt">CRectTracker::dottedLine</span></strong><span style="font-size: 10pt"> </span><span style="font-size: 10pt; mso-bidi-font-weight: bold">虚线</span></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt 68.85pt; text-indent: -68.85pt; mso-char-indent-count: -6.86"><strong><span style="font-size: 10pt">CRectTracker::hatchedBorder </span></strong><span style="font-size: 10pt; mso-bidi-font-weight: bold">影阴线</span></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt 68.85pt; text-indent: -68.85pt; mso-char-indent-count: -6.86"><strong><span style="font-size: 10pt">CRectTracker::resizeInside<span style="mso-spacerun: yes">&nbsp;&nbsp; </span></span></strong><span style="font-size: 10pt; mso-bidi-font-weight: bold">改变大小的句柄在橡皮筋矩形框内部（点在橡皮筋矩形框</span></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt 68.6pt; text-indent: -68.6pt; mso-char-indent-count: -6.86"><span style="font-size: 10pt; mso-bidi-font-weight: bold">里面来改变大小）</span></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt"><strong><span style="font-size: 10pt">CRectTracker::resizeOutside<span style="mso-spacerun: yes"> </span></span></strong><span style="font-size: 10pt; mso-bidi-font-weight: bold">改变大小的句柄在橡皮筋矩形框外部</span></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt"><strong><span style="font-size: 10pt">CRectTracker::hatchInside<span style="mso-spacerun: yes"> </span></span></strong><span style="font-size: 10pt; mso-bidi-font-weight: bold">影阴线布满总个矩形框</span></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt"><strong style="mso-bidi-font-weight: normal"><span>二 成员函数：</span></strong></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt"><strong style="mso-bidi-font-weight: normal"><span>1.void Draw( CDC* pDC ) const;</span></strong></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt"><span>这个函数用来划矩形框的边框和内部区域。</span></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt"><strong style="mso-bidi-font-weight: normal"><span>2.void GetTrueRect( LPRECT lpTrueRect ) const;</span></strong></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt"><span>这个函数用来换回矩形框的 矩形坐标，参数为<span>CRECT</span>类型，返回矩形</span></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt"><strong style="mso-bidi-font-weight: normal"><span>3.int HitTest( CPoint point ) const;</span></strong></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt"><span>当你鼠标被按下的时候，你可以调用这个函数，它将返回鼠标点在了矩形框的什么位置：</span><span>可以看出，返回值如果大于等于零则在四边形区域之内。如果小于则说明不在区域范围之内。</span></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt"></div>
<table class=MsoNormalTable style="background: #333333; width: 317.1pt; mso-cellspacing: .7pt; mso-padding-alt: 0cm 0cm 0cm 0cm" cellspacing="1" cellpadding="0" width="423" border="0">
<tbody>
<tr style="height: 13pt; mso-yfti-irow: 0; mso-yfti-firstrow: yes">
<td style="padding-right: 0cm; padding-left: 0cm; border-left-color: #f2f2f2; background: white; border-bottom-color: #f2f2f2; padding-bottom: 0cm; width: 13.84%; border-top-color: #f2f2f2; padding-top: 0cm; height: 13pt; border-right-color: #f2f2f2" vAlign=top width="13%">
<div class=MsoNormal style="margin: 0cm 0cm 0pt; line-height: 150%; text-align: center; mso-pagination: widow-orphan; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto" align="center"><span style="font-size: 9pt; line-height: 150%; letter-spacing: 0.65pt; mso-font-kerning: 0pt">返回值</span><span style="font-size: 9pt; line-height: 150%; letter-spacing: 0.65pt; mso-font-kerning: 0pt"> </span></div></td>
<td style="padding-right: 0cm; padding-left: 0cm; border-left-color: #f2f2f2; background: white; border-bottom-color: #f2f2f2; padding-bottom: 0cm; width: 85.5%; border-top-color: #f2f2f2; padding-top: 0cm; height: 13pt; border-right-color: #f2f2f2" vAlign=top width="85%">
<div class=MsoNormal style="margin: 0cm 0cm 0pt; line-height: 150%; text-align: center; mso-pagination: widow-orphan; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto" align="center"><span style="font-size: 9pt; line-height: 150%; letter-spacing: 0.65pt; mso-font-kerning: 0pt">代表的含义</span><span style="font-size: 9pt; line-height: 150%; letter-spacing: 0.65pt; mso-font-kerning: 0pt"> </span></div></td></tr>
<tr style="height: 13pt; mso-yfti-irow: 1">
<td style="padding-right: 0cm; padding-left: 0cm; border-left-color: #f2f2f2; background: white; border-bottom-color: #f2f2f2; padding-bottom: 0cm; width: 13.84%; border-top-color: #f2f2f2; padding-top: 0cm; height: 13pt; border-right-color: #f2f2f2" vAlign=top width="13%">
<div class=MsoNormal style="margin: 0cm 0cm 0pt; line-height: 150%; text-align: center; mso-pagination: widow-orphan; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto" align="center"><span style="font-size: 9pt; line-height: 150%; letter-spacing: 0.65pt; mso-font-kerning: 0pt">-1 </span></div></td>
<td style="padding-right: 0cm; padding-left: 0cm; border-left-color: #f2f2f2; background: white; border-bottom-color: #f2f2f2; padding-bottom: 0cm; width: 85.5%; border-top-color: #f2f2f2; padding-top: 0cm; height: 13pt; border-right-color: #f2f2f2" vAlign=top width="85%">
<div class=MsoNormal style="margin: 0cm 0cm 0pt; line-height: 150%; text-align: center; mso-pagination: widow-orphan; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto" align="center"><span style="font-size: 9pt; line-height: 150%; letter-spacing: 0.65pt; mso-font-kerning: 0pt">点在了四边形的外部</span><span style="font-size: 9pt; line-height: 150%; letter-spacing: 0.65pt; mso-font-kerning: 0pt"> </span></div></td></tr>
<tr style="height: 12.65pt; mso-yfti-irow: 2">
<td style="padding-right: 0cm; padding-left: 0cm; border-left-color: #f2f2f2; background: white; border-bottom-color: #f2f2f2; padding-bottom: 0cm; width: 13.84%; border-top-color: #f2f2f2; padding-top: 0cm; height: 12.65pt; border-right-color: #f2f2f2" vAlign=top width="13%">
<div class=MsoNormal style="margin: 0cm 0cm 0pt; line-height: 150%; text-align: center; mso-pagination: widow-orphan; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto" align="center"><span style="font-size: 9pt; line-height: 150%; letter-spacing: 0.65pt; mso-font-kerning: 0pt">0 </span></div></td>
<td style="padding-right: 0cm; padding-left: 0cm; border-left-color: #f2f2f2; background: white; border-bottom-color: #f2f2f2; padding-bottom: 0cm; width: 85.5%; border-top-color: #f2f2f2; padding-top: 0cm; height: 12.65pt; border-right-color: #f2f2f2" vAlign=top width="85%">
<div class=MsoNormal style="margin: 0cm 0cm 0pt; line-height: 150%; text-align: center; mso-pagination: widow-orphan; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto" align="center"><span style="font-size: 9pt; line-height: 150%; letter-spacing: 0.65pt; mso-font-kerning: 0pt">左上角</span><span style="font-size: 9pt; line-height: 150%; letter-spacing: 0.65pt; mso-font-kerning: 0pt"> </span></div></td></tr>
<tr style="height: 13pt; mso-yfti-irow: 3">
<td style="padding-right: 0cm; padding-left: 0cm; border-left-color: #f2f2f2; background: white; border-bottom-color: #f2f2f2; padding-bottom: 0cm; width: 13.84%; border-top-color: #f2f2f2; padding-top: 0cm; height: 13pt; border-right-color: #f2f2f2" vAlign=top width="13%">
<div class=MsoNormal style="margin: 0cm 0cm 0pt; line-height: 150%; text-align: center; mso-pagination: widow-orphan; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto" align="center"><span style="font-size: 9pt; line-height: 150%; letter-spacing: 0.65pt; mso-font-kerning: 0pt">1 </span></div></td>
<td style="padding-right: 0cm; padding-left: 0cm; border-left-color: #f2f2f2; background: white; border-bottom-color: #f2f2f2; padding-bottom: 0cm; width: 85.5%; border-top-color: #f2f2f2; padding-top: 0cm; height: 13pt; border-right-color: #f2f2f2" vAlign=top width="85%">
<div class=MsoNormal style="margin: 0cm 0cm 0pt; line-height: 150%; text-align: center; mso-pagination: widow-orphan; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto" align="center"><span style="font-size: 9pt; line-height: 150%; letter-spacing: 0.65pt; mso-font-kerning: 0pt">右上角</span><span style="font-size: 9pt; line-height: 150%; letter-spacing: 0.65pt; mso-font-kerning: 0pt"> </span></div></td></tr>
<tr style="height: 12.65pt; mso-yfti-irow: 4">
<td style="padding-right: 0cm; padding-left: 0cm; border-left-color: #f2f2f2; background: white; border-bottom-color: #f2f2f2; padding-bottom: 0cm; width: 13.84%; border-top-color: #f2f2f2; padding-top: 0cm; height: 12.65pt; border-right-color: #f2f2f2" vAlign=top width="13%">
<div class=MsoNormal style="margin: 0cm 0cm 0pt; line-height: 150%; text-align: center; mso-pagination: widow-orphan; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto" align="center"><span style="font-size: 9pt; line-height: 150%; letter-spacing: 0.65pt; mso-font-kerning: 0pt">2 </span></div></td>
<td style="padding-right: 0cm; padding-left: 0cm; border-left-color: #f2f2f2; background: white; border-bottom-color: #f2f2f2; padding-bottom: 0cm; width: 85.5%; border-top-color: #f2f2f2; padding-top: 0cm; height: 12.65pt; border-right-color: #f2f2f2" vAlign=top width="85%">
<div class=MsoNormal style="margin: 0cm 0cm 0pt; line-height: 150%; text-align: center; mso-pagination: widow-orphan; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto" align="center"><span style="font-size: 9pt; line-height: 150%; letter-spacing: 0.65pt; mso-font-kerning: 0pt">右下角</span><span style="font-size: 9pt; line-height: 150%; letter-spacing: 0.65pt; mso-font-kerning: 0pt"> </span></div></td></tr>
<tr style="height: 13pt; mso-yfti-irow: 5">
<td style="padding-right: 0cm; padding-left: 0cm; border-left-color: #f2f2f2; background: white; border-bottom-color: #f2f2f2; padding-bottom: 0cm; width: 13.84%; border-top-color: #f2f2f2; padding-top: 0cm; height: 13pt; border-right-color: #f2f2f2" vAlign=top width="13%">
<div class=MsoNormal style="margin: 0cm 0cm 0pt; line-height: 150%; text-align: center; mso-pagination: widow-orphan; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto" align="center"><span style="font-size: 9pt; line-height: 150%; letter-spacing: 0.65pt; mso-font-kerning: 0pt">3 </span></div></td>
<td style="padding-right: 0cm; padding-left: 0cm; border-left-color: #f2f2f2; background: white; border-bottom-color: #f2f2f2; padding-bottom: 0cm; width: 85.5%; border-top-color: #f2f2f2; padding-top: 0cm; height: 13pt; border-right-color: #f2f2f2" vAlign=top width="85%">
<div class=MsoNormal style="margin: 0cm 0cm 0pt; line-height: 150%; text-align: center; mso-pagination: widow-orphan; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto" align="center"><span style="font-size: 9pt; line-height: 150%; letter-spacing: 0.65pt; mso-font-kerning: 0pt">左下角（</span><span style="font-size: 9pt; line-height: 150%; letter-spacing: 0.65pt; mso-font-kerning: 0pt">0</span><span style="font-size: 9pt; line-height: 150%; letter-spacing: 0.65pt; mso-font-kerning: 0pt">，</span><span style="font-size: 9pt; line-height: 150%; letter-spacing: 0.65pt; mso-font-kerning: 0pt">1</span><span style="font-size: 9pt; line-height: 150%; letter-spacing: 0.65pt; mso-font-kerning: 0pt">，</span><span style="font-size: 9pt; line-height: 150%; letter-spacing: 0.65pt; mso-font-kerning: 0pt">2</span><span style="font-size: 9pt; line-height: 150%; letter-spacing: 0.65pt; mso-font-kerning: 0pt">，</span><span style="font-size: 9pt; line-height: 150%; letter-spacing: 0.65pt; mso-font-kerning: 0pt">3</span><span style="font-size: 9pt; line-height: 150%; letter-spacing: 0.65pt; mso-font-kerning: 0pt">顺时针转了一圈）</span><span style="font-size: 9pt; line-height: 150%; letter-spacing: 0.65pt; mso-font-kerning: 0pt"> </span></div></td></tr>
<tr style="height: 12.65pt; mso-yfti-irow: 6">
<td style="padding-right: 0cm; padding-left: 0cm; border-left-color: #f2f2f2; background: white; border-bottom-color: #f2f2f2; padding-bottom: 0cm; width: 13.84%; border-top-color: #f2f2f2; padding-top: 0cm; height: 12.65pt; border-right-color: #f2f2f2" vAlign=top width="13%">
<div class=MsoNormal style="margin: 0cm 0cm 0pt; line-height: 150%; text-align: center; mso-pagination: widow-orphan; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto" align="center"><span style="font-size: 9pt; line-height: 150%; letter-spacing: 0.65pt; mso-font-kerning: 0pt">4 </span></div></td>
<td style="padding-right: 0cm; padding-left: 0cm; border-left-color: #f2f2f2; background: white; border-bottom-color: #f2f2f2; padding-bottom: 0cm; width: 85.5%; border-top-color: #f2f2f2; padding-top: 0cm; height: 12.65pt; border-right-color: #f2f2f2" vAlign=top width="85%">
<div class=MsoNormal style="margin: 0cm 0cm 0pt; line-height: 150%; text-align: center; mso-pagination: widow-orphan; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto" align="center"><span style="font-size: 9pt; line-height: 150%; letter-spacing: 0.65pt; mso-font-kerning: 0pt">顶部</span><span style="font-size: 9pt; line-height: 150%; letter-spacing: 0.65pt; mso-font-kerning: 0pt"> </span></div></td></tr>
<tr style="height: 13pt; mso-yfti-irow: 7">
<td style="padding-right: 0cm; padding-left: 0cm; border-left-color: #f2f2f2; background: white; border-bottom-color: #f2f2f2; padding-bottom: 0cm; width: 13.84%; border-top-color: #f2f2f2; padding-top: 0cm; height: 13pt; border-right-color: #f2f2f2" vAlign=top width="13%">
<div class=MsoNormal style="margin: 0cm 0cm 0pt; line-height: 150%; text-align: center; mso-pagination: widow-orphan; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto" align="center"><span style="font-size: 9pt; line-height: 150%; letter-spacing: 0.65pt; mso-font-kerning: 0pt">5 </span></div></td>
<td style="padding-right: 0cm; padding-left: 0cm; border-left-color: #f2f2f2; background: white; border-bottom-color: #f2f2f2; padding-bottom: 0cm; width: 85.5%; border-top-color: #f2f2f2; padding-top: 0cm; height: 13pt; border-right-color: #f2f2f2" vAlign=top width="85%">
<div class=MsoNormal style="margin: 0cm 0cm 0pt; line-height: 150%; text-align: center; mso-pagination: widow-orphan; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto" align="center"><span style="font-size: 9pt; line-height: 150%; letter-spacing: 0.65pt; mso-font-kerning: 0pt">右部</span><span style="font-size: 9pt; line-height: 150%; letter-spacing: 0.65pt; mso-font-kerning: 0pt"> </span></div></td></tr>
<tr style="height: 5.5pt; mso-yfti-irow: 8">
<td style="padding-right: 0cm; padding-left: 0cm; border-left-color: #f2f2f2; background: white; border-bottom-color: #f2f2f2; padding-bottom: 0cm; width: 13.84%; border-top-color: #f2f2f2; padding-top: 0cm; height: 5.5pt; border-right-color: #f2f2f2" vAlign=top width="13%">
<div class=MsoNormal style="margin: 0cm 0cm 0pt; line-height: 150%; text-align: center; mso-pagination: widow-orphan; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto" align="center"><span style="font-size: 9pt; line-height: 150%; letter-spacing: 0.65pt; mso-font-kerning: 0pt">6 </span></div></td>
<td style="padding-right: 0cm; padding-left: 0cm; border-left-color: #f2f2f2; background: white; border-bottom-color: #f2f2f2; padding-bottom: 0cm; width: 85.5%; border-top-color: #f2f2f2; padding-top: 0cm; height: 5.5pt; border-right-color: #f2f2f2" vAlign=top width="85%">
<div class=MsoNormal style="margin: 0cm 0cm 0pt; line-height: 150%; text-align: center; mso-pagination: widow-orphan; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto" align="center"><span style="font-size: 9pt; line-height: 150%; letter-spacing: 0.65pt; mso-font-kerning: 0pt">底部</span><span style="font-size: 9pt; line-height: 150%; letter-spacing: 0.65pt; mso-font-kerning: 0pt"> </span></div></td></tr>
<tr style="height: 3.95pt; mso-yfti-irow: 9">
<td style="padding-right: 0cm; padding-left: 0cm; border-left-color: #f2f2f2; background: white; border-bottom-color: #f2f2f2; padding-bottom: 0cm; width: 13.84%; border-top-color: #f2f2f2; padding-top: 0cm; height: 3.95pt; border-right-color: #f2f2f2" vAlign=top width="13%">
<div class=MsoNormal style="margin: 0cm 0cm 0pt; line-height: 150%; text-align: center; mso-pagination: widow-orphan; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto" align="center"><span style="font-size: 9pt; line-height: 150%; letter-spacing: 0.65pt; mso-font-kerning: 0pt">7 </span></div></td>
<td style="padding-right: 0cm; padding-left: 0cm; border-left-color: #f2f2f2; background: white; border-bottom-color: #f2f2f2; padding-bottom: 0cm; width: 85.5%; border-top-color: #f2f2f2; padding-top: 0cm; height: 3.95pt; border-right-color: #f2f2f2" vAlign=top width="85%">
<div class=MsoNormal style="margin: 0cm 0cm 0pt; line-height: 150%; text-align: center; mso-pagination: widow-orphan; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto" align="center"><span style="font-size: 9pt; line-height: 150%; letter-spacing: 0.65pt; mso-font-kerning: 0pt">左部（还是顺时针转了一圈）</span><span style="font-size: 9pt; line-height: 150%; letter-spacing: 0.65pt; mso-font-kerning: 0pt"> </span></div></td></tr>
<tr style="height: 3.95pt; mso-yfti-irow: 10; mso-yfti-lastrow: yes">
<td style="padding-right: 0cm; padding-left: 0cm; border-left-color: #f2f2f2; background: white; border-bottom-color: #f2f2f2; padding-bottom: 0cm; width: 13.84%; border-top-color: #f2f2f2; padding-top: 0cm; height: 3.95pt; border-right-color: #f2f2f2" vAlign=top width="13%">
<div class=MsoNormal style="margin: 0cm 0cm 0pt; line-height: 150%; text-align: center; mso-pagination: widow-orphan; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto" align="center"><span style="font-size: 9pt; line-height: 150%; letter-spacing: 0.65pt; mso-font-kerning: 0pt">8 </span></div></td>
<td style="padding-right: 0cm; padding-left: 0cm; border-left-color: #f2f2f2; background: white; border-bottom-color: #f2f2f2; padding-bottom: 0cm; width: 85.5%; border-top-color: #f2f2f2; padding-top: 0cm; height: 3.95pt; border-right-color: #f2f2f2" vAlign=top width="85%">
<div class=MsoNormal style="margin: 0cm 0cm 0pt; line-height: 150%; text-align: center; mso-pagination: widow-orphan; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto" align="center"><span style="font-size: 9pt; line-height: 150%; letter-spacing: 0.65pt; mso-font-kerning: 0pt">点在了四边形的内部，但没有击中前面的那八个点</span><span style="font-size: 9pt; line-height: 150%; letter-spacing: 0.65pt; mso-font-kerning: 0pt"> </span></div></td></tr></tbody></table>
<div class=MsoNormal style="margin: 0cm 0cm 0pt"></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt"><strong style="mso-bidi-font-weight: normal"><span><font face="Times New Roman">4.BOOL SetCursor( CWnd* pWnd, UINT nHitTest ) const;</font></span></strong></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt"><span>调用这个函数用来</span><font face="Times New Roman"> </font><span>当鼠标放在矩形框时，显示各种鼠标形象</span></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt"></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt"><strong style="mso-bidi-font-weight: normal"><span><font face="Times New Roman">5.BOOL Track( CWnd* pWnd, CPoint point, BOOL bAllowInvert = FALSE, CWnd* pWndClipTo = NULL );</font></span></strong></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt"><span style="mso-bidi-font-size: 10.5pt">这个函数用来显示当人们用鼠标改变矩形框大小 或 拖拽矩形框时显示矩形框动作</span></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt"><span style="mso-bidi-font-size: 10.5pt">一般由<span>WM_LBUTTONDOWN </span>消息来触发这个函数<span>,</span></span><span style="letter-spacing: 0.65pt; mso-bidi-font-size: 10.5pt"> </span><span style="letter-spacing: 0.65pt; mso-bidi-font-size: 10.5pt">不需要编写<span>MouseMove</span>函数，</span><span style="mso-bidi-font-size: 10.5pt">矩形框</span><span style="letter-spacing: 0.65pt; mso-bidi-font-size: 10.5pt">它就自动的变大小了呢？这就是<span>Track</span>（）函数的功劳，从调用它到抬起鼠标键为止，它时刻的改变四边形的大小。</span></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt"></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt"><strong style="mso-bidi-font-weight: normal"><span><font face="Times New Roman">6.BOOL TrackRubberBand( CWnd* pWnd, CPoint point, BOOL bAllowInvert = TRUE );</font></span></strong></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt"><span>当鼠标在空区域拖拽时显示橡皮筋矩形框，让鼠标画一个</span><span><font face="Times New Roman">“</font></span><span>橡皮筋</span><span><font face="Times New Roman">”</font></span><span>区域，</span><span>第一个参数，画<span>“</span>橡皮筋<span>”</span>的窗体的指针，当然是<span>this </span>，第二个参数，画<span>“</span>橡皮筋<span>”</span>的起始点。 让我们注意第三个参数，它非常有意思。当你使用　<span>FALSE</span>时（<span>TRUE </span>值是缺省的）<span>,</span>你的<span>“</span>橡皮筋<span>”</span>只能从左上到右下的画，不允许反向。编译运行一下<span>FALSE</span>这个值。</span></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt"><span>特别值得注意的是：在</span><span><font face="Times New Roman">TrackRubberBand</font></span><span>的过程中是以右键的抬起为结束的，这其间并没有</span><span><font face="Times New Roman">CView</font></span><span>的</span><span><font face="Times New Roman">MouseMove</font></span><span>发生。这一点一定要记住！这时鼠标画过的区域已经记录在</span><span>CrectTracker </span><span>类数据成员</span><span> m_rect</span><span>里面了，既</span><span>CrectTracker:: m_rect.</span></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt"></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt"><span>////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////</span></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt"></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt"></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt"></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt"></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt"></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt"><span>下面是工程应用中的代码</span></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt"><span>void Cmfc02Dlg::OnLButtonDown(UINT nFlags, CPoint point)<br />{</span></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt"><span>//当鼠标左键按下时<br /><font color="#800000">CRectTracker temp;<br />temp.TrackRubberBand(this,point,TRUE);<br />temp.m_rect.NormalizeRect(); //标题化矩形</font></span></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt"><span>//获取选取的矩形<br />RECT rc;<br />temp.GetTrueRect(&amp;rc);</span></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt"><span>//在选取的整个过程，CRectTracker.TrackRubberBand()是阻塞的，直到鼠标左键弹起才返回，并且接管了WM_LBUTTONUP消息<br />SendMessage(WM_LBUTTONUP);</span></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt"><span>CDialog::OnLButtonDown(nFlags, point);<br />}</span></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt"></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt"><span><span>////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////</span></span></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt"></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt"></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt"></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt"></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt"><span>如果要自己实现的话，可以这样做</span></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt"><span>BOOL bDown = FALSE;<br />CPoint posLast, posDown;</span></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt"><span>void Cmfc02Dlg::OnLButtonDown(UINT nFlags, CPoint point)<br />{<br />bDown = TRUE;<br />posLast = point;<br />posDown = point;</span></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt"><span>CDialog::OnLButtonDown(nFlags, point);<br />}</span></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt"><span>void Cmfc02Dlg::OnLButtonUp(UINT nFlags, CPoint point)<br />{<br />if (bDown)<br />{<br />&nbsp;&nbsp; bDown = FALSE;</span></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt"><span>&nbsp;&nbsp; CClientDC&nbsp;&nbsp; dc(this);&nbsp;&nbsp; <br />&nbsp;&nbsp; CRect&nbsp;&nbsp; rect(posDown.x,&nbsp;&nbsp; posDown.y,&nbsp;&nbsp; posLast.x,&nbsp;&nbsp; posLast.y);&nbsp;&nbsp; <br />&nbsp;&nbsp; rect.NormalizeRect();&nbsp;&nbsp; <br />&nbsp;&nbsp;<font color="#800000">dc.DrawFocusRect(rect);&nbsp;&nbsp; //异或前面画过的矩形<br /></font>}</span></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt"><span>CDialog::OnLButtonUp(nFlags, point);<br />}</span></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt"><span>void Cmfc02Dlg::OnMouseMove(UINT nFlags, CPoint point)<br />{<br />// TODO: 在此添加消息处理程序代码和/或调用默认值<br />if (bDown)<br />{<br />&nbsp;&nbsp; CClientDC dc(this);</span></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt"><span>&nbsp;&nbsp;<font color="#800000">if (posLast.x != posDown.x &amp;&amp; posLast.y != posDown.y)</font><br />&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp; CRect&nbsp;&nbsp; rect(posDown.x,&nbsp;&nbsp; posDown.y,&nbsp;&nbsp; posLast.x,&nbsp;&nbsp; posLast.y);&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; rect.NormalizeRect();<br />&nbsp;&nbsp;&nbsp; dc.DrawFocusRect(rect); <br />&nbsp;&nbsp; }<br />&nbsp;&nbsp; CRect rect(posDown.x,&nbsp;&nbsp; posDown.y,&nbsp;&nbsp; point.x,&nbsp;&nbsp; point.y);&nbsp;&nbsp; <br />&nbsp;&nbsp; rect.NormalizeRect();&nbsp;&nbsp; <br />&nbsp;&nbsp; dc.DrawFocusRect(rect);&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;<font color="#800000">posLast&nbsp;&nbsp; =&nbsp;&nbsp; point;</font>&nbsp;&nbsp; <br />}</span></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt"><span>CDialog::OnMouseMove(nFlags, point);<br />}</span></div>]]></description>
 <link><![CDATA[http://juwen.blog.51cto.com/135311/132159]]></link>
 <author><![CDATA[juwen]]></author>
 <category><![CDATA[C/C++]]></category>
 <pubdate><![CDATA[Sat, 21 Feb 2009 09:14:14 +0000]]></pubdate>
</item>
<item>
 <title><![CDATA[Halcon 摄像机标定流程]]></title>
 <description><![CDATA[<div>Halcon标定流程</div>
<div>&nbsp;</div>
<div>摄像机分两种，一种是面扫描摄像机（Area Scan Camera），一种是线扫描摄像机（Line Scan Camera）。准确来说，叫摄像机系统比较正确。两者的区别我也提一提吧，有些同学可能不知道，所谓的面扫描摄像系统是指可以通过单纯曝光取得面积影像，而线扫描摄像机，必须利用运动速度才能取得影像。</div>
<div>&nbsp;</div>
<div>两种不同的摄像系统由于成像的过程有区别，所以标定的过程也有区别，这里仅讨论面扫描摄像系统。流程如下：</div>
<div>&nbsp;</div>
<div>1、初始摄像机参数：</div>
<div>startCamPar：＝[f,k,Sx,Sy,Cx,Cy,NumCol,NumRow]</div>
<div>f&nbsp;&nbsp; 焦距</div>
<div>k&nbsp; 初始为0.0</div>
<div>Sx 两个相邻像素点的水平距离</div>
<div>Sy 两个相邻像素点的垂直距离</div>
<div>Cx、Cy 图像中心点的位置</div>
<div>NumCol NumRow图像长和宽</div>
<div>&nbsp;</div>
<div>2、caltab_points读取标定板描述文件里面描述的点到X[],Y[],z[],描述文件由gen_caltab生成。</div>
<div>&nbsp;</div>
<div>3、fin_caltab找到标定板的位置</div>
<div>&nbsp;</div>
<div>4、find_marks_and_pose 输出标定点的位置和外参startpose</div>
<div>&nbsp;</div>
<div>5、camera_calibration输出内参和所有外部参数</div>
<div>&nbsp;</div>
<div>到第五步时，工作已经完成了一半，计算出各个参数后可以用map_image来还原形变的图像或者用坐标转换参数将坐标转换到世界坐标中。</div>]]></description>
 <link><![CDATA[http://juwen.blog.51cto.com/135311/124033]]></link>
 <author><![CDATA[juwen]]></author>
 <category><![CDATA[开发技术]]></category>
 <pubdate><![CDATA[Fri, 02 Jan 2009 16:03:30 +0000]]></pubdate>
</item>
<item>
 <title><![CDATA[命令行下装WinPcap ]]></title>
 <description><![CDATA[<div>WinPcap是个很常用的工具，但必须在窗口界面下安装。在网上也可以找到不用GUI的版本（但还是有版权页），其实我们完全可以 </div>
<div>自己做一个。 </div>
<div>以WinPcap 3.0a 为例。通过比较安装前后的文件系统和注册表快照，很容易了解整个安装过程。 <br />除去反安装的部分，关键的文件有三个：wpcap.dll，packet.dll和npf.sys。前面两个文件位于system32目录下，第三个在system </div>
<div>32\drivers下。而注册表的变化是增加了一个系统服务NPF。注意，是系统服务（即驱动）不是Win32服务。 </div>
<div>作为系统服务，不但要在HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services下增加主键，在HKEY_LOCAL_MACHINE\SYSTEM\ </div>
<div>CurrentControlSet\Enum\Root下也增加主键。而后者默认只有SYSTEM身份才可以修改。幸运的是，并不需要手动添加它，winpcap </div>
<div>被调用时会自动搞定。甚至完全不用手动修改注册表，所有的事winpcap都会自己完成，只需要将三个文件复制到合适的位置就行 </div>
<div>了。 </div>
<div>作为范例，还是演示一下如何修改注册表：利用前面说过的inf文件来实现。 </div>
<div>[Version] <br />Signature="$WINDOWS NT$" <br />[DefaultInstall.Services] <br />AddService=NPF,,winpcap_svr <br />[winpcap_svr] <br />DisplayName=Netgroup Packet Filter <br />ServiceType=0x1 <br />StartType=3 <br />ErrorControl=1 <br />ServiceBinary=%12%\npf.sys </div>
<div>将上面这些内容保存为_wpcap_.inf文件。 <br />再写一个批处理_wpcap_.bat： </div>
<div>rundll32.exe setupapi,InstallHinfSection DefaultInstall 128 %CD%\_wpcap_.inf <br />del _wpcap_.inf <br />if /i %CD%==%SYSTEMROOT%\system32 goto COPYDRV <br />copy packet.dll %SYSTEMROOT%\system32\ <br />copy wpcap.dll %SYSTEMROOT%\system32\ <br />del packet.dll <br />del wpcap.dll <br />:COPYDRV <br />if /i %CD%==%SYSTEMROOT%\system32\drivers goto END <br />copy npf.sys %SYSTEMROOT%\system32\drivers\ <br />del npf.sys <br />:END <br />del %0 </div>
<div>然后用winrar将所有文件（5个）打包为自解压的exe，并将『高级自解压选项』-&gt;『解压后运行』设置为_wpcap_.bat，命令行的w </div>
<div>inpcap安装包就制作完成了。 </div>
<div>注意，批处理最后一行没有回车符。否则会因为正在运行而无法删除自己。</div>]]></description>
 <link><![CDATA[http://juwen.blog.51cto.com/135311/119865]]></link>
 <author><![CDATA[juwen]]></author>
 <category><![CDATA[C/C++]]></category>
 <pubdate><![CDATA[Tue, 16 Dec 2008 10:16:00 +0000]]></pubdate>
</item>
<item>
 <title><![CDATA[symbian oggplay 音乐播放器开发（2）]]></title>
 <description><![CDATA[<div><font size="4">上一篇文章已经下载好oggplay的源代码。</font></div>
<div><font size="4">这里开始进行第一编译，经常下载开源项目下来调试的朋友都知道，第一次编译是成功的关键，因为很多时候开源项目下载下来后由于机器本身的差异或者环境的差异，软件的差异，很多时候都不能正常编译（好像我觉得是绝大多数都不能一编译就成功）。</font></div>
<div><font size="4"></font>&nbsp;</div>
<div><font size="4">第一件事就是查看一下下载下来的文档HowToCompile.txt</font></div>
<div><font size="4">我将比较关键的部分贴出来，其它自行查看文档。</font></div>
<div>&nbsp;/////////////////////////////////////////<br />&nbsp; Modules<br />&nbsp;///////////////////////////////////////// <br />&nbsp;OggPlay comes in two modules. <br />&nbsp;An application for OggPlay Application and a dll for the ogg vorbis decoder.<br />&nbsp;Because of the plugin nature of the decoder, the application and the decoder<br />&nbsp;are separate entities, and each must be compiled separately.<br /><strong><font size="4">&nbsp;不一一翻译，大意就是有两部分，程序和解码器，要分开编译。</font><br /></strong>&nbsp;<br />&nbsp;/////////////////////////////////////////<br />&nbsp; Non-MMF and MMF versions<br />&nbsp;///////////////////////////////////////// <br />&nbsp;<br />&nbsp;OggPlay comes in two flavor, the Non-MMF and the MMF version. In the MMF version,<br />&nbsp;the ogg vorbis decoder is an MMF Plugin, that can be used by any application, <br />&nbsp;like the built-in music player, for instance.<br />&nbsp;The MMF version requires OS support for MMF. This support is available from Symbian 7.0s.<br />&nbsp;<br />&nbsp;Series60 SDK 2.0 or higher is required to compile the MMF version for Series 60.</div>
<div>&nbsp;</div>
<div><font size="4"><strong>有两个版本，一个是使用MMF的一个是不使用MMF的，根据自己的需要选择编译，别问我MMF是什么。</strong></font></div>
<div>&nbsp;</div>
<div>&nbsp;/////////////////////////////////////////<br />&nbsp; Compilation Flags<br />&nbsp;///////////////////////////////////////// </div>
<div>&nbsp;Compilation flags should be set before starting to do any compilation.<br />&nbsp;All compilation flags are in OggOs.h.<br />&nbsp;There are several flags in that file, but basically, only 5 flags should be <br />&nbsp;modified, the others are ok as they are.<br />&nbsp;<br />&nbsp;#define SERIES60&nbsp; : When set, compilation is done for S60<br />&nbsp;#define UIQ&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : When set, compilation is done for UIQ</div>
<div>&nbsp;#define OS70S&nbsp;&nbsp;&nbsp;&nbsp; : When set, MMF is used.</div>
<div>&nbsp;#define MOTOROLA&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : When set, compilation for Motorola UIQ (A92X)<br />&nbsp;#define SONYERICSSON&nbsp; : When set, compilation is done for P800/P900</div>
<div>&nbsp;</div>
<div><font size="4"><strong>其实这里你大可以不用理会，因为oggos.h的头文件里并没有这部分的内容，另外放到其它地方。这份文档应该是早期的版本的。由于oggplay包含很多系统的版本，里面的代码会选择性编译。这里以后再说。反正第一次编译就不用理会这么多。暂时我们只需要选择合适的bld.inf就可以了。详细的看文件夹结构。我用s60v3mmf编译。所以直接使用/groups60v3mmf，其它类同。一句话，找你需要的，闲事莫理。</strong></font></div>
<div>&nbsp;</div>
<div>&nbsp;/////////////////////////////////////////<br />&nbsp;Compilation for target device<br />&nbsp;///////////////////////////////////////// <br />&nbsp;<br />&nbsp;To compile the code for target ( this expects a valid Symbian Compilation environment):<br />&nbsp;<br />&nbsp;For non-MMF version:<br />&nbsp;<br />&nbsp;&nbsp; Edit the file vorbis\group\bld.inf so that oggvorbis.mmp is used.<br />&nbsp;&nbsp; cd \vorbis\group<br />&nbsp;&nbsp; bldmake bldfiles <br />&nbsp;&nbsp; abld build armi </div>
<div>&nbsp;&nbsp; cd \group&nbsp;&nbsp; <br />&nbsp;&nbsp; bldmake bldfiles <br />&nbsp;&nbsp; abld build armi </div>
<div>&nbsp;For MMF version: <br />&nbsp;<br />&nbsp;&nbsp; Edit the file vorbis\group\bld.inf so that OggPluginDecoder.mmp is used.<br />&nbsp;&nbsp; cd \group&nbsp;&nbsp; <br />&nbsp;&nbsp; bldmake bldfiles <br />&nbsp;&nbsp; abld build armi <br />&nbsp; <br />&nbsp;&nbsp; cd \vorbis\group<br />&nbsp;&nbsp; bldmake bldfiles <br />&nbsp;&nbsp; abld build armi </div>
<div><br />&nbsp;Note that the order is reversed in MMF case: the Application is built first, and the<br />&nbsp;MMF plugin built afterward.</div>
<div>&nbsp;</div>
<div><strong><font size="4">到编译命令了。这里可以说就是问题的关键地方，开始时由于我对symbian的开发环境不是很熟悉，我在这里走了不少弯路。我没有直接用命令行，而是使用carbide c++来进行编译，结果死活都出了几个link错误。上google找，一条相同的信息都没有。</font></strong></div>
<div><font color="#ff0000" size="4">Severity and Description Path Resource Location Creation Time Id Undefined symbol: '_ogg_sync_bufferin'[] oggplay Unknown 1228526161234 1072</font></div>
<div><strong></strong>&nbsp;</div>
<div><strong><font size="4">几条类似的错误。各个版本都尝试编译，结果都是差不多的错误。然后我再尝试用命令行来编译。</font></strong></div>
<div><font size="4"><strong>&nbsp;运行</strong> <font color="#00ff00">abld build armi</font><strong> </strong><strong>时提示</strong></font></div>
<div><font color="#ff0000" size="4">This project does not support platform.</font></div>
<div><strong><font size="4">这个还好解决，上网找了找。原来这里分winscw、gcce、armv5,具体内容不说了。自己查查资料吧。我是安装了gcc的工具链。所以改一改代码。</font></strong></div>
<div><font color="#00ff00" size="4">abld build gcce urel</font></div>
<div>&nbsp;</div>
<div><font color="#ff0000">play\groupS60V3MMF\OGGPLAYS60V3MMF\GCCE\OGGPLAYS60V3MMF.GCCE" RESOURCEUREL<br />make[1]: *** No rule to make target `\Symbian\Carbide\symbianoggplay\bitmaps\s60<br />v3mmfsplash.bmp', needed by `\Symbian\9.2\S60_3rd_FP1\EPOC32\DATA\Z\private\F000<br />A661\OggSplash.mbm'.&nbsp; Stop.<br />make: *** [RESOURCEOGGPLAYS60V3MMF] Error 2<br />&nbsp; make -r&nbsp; -f "\Symbian\9.2\S60_3rd_FP1\EPOC32\BUILD\Symbian\Carbide\symbianoggp<br />lay\groupS60V3MMF\GCCE.make" TARGET CFG=UREL VERBOSE=-s<br />make -s&nbsp; -r -f "\Symbian\9.2\S60_3rd_FP1\EPOC32\BUILD\Symbian\Carbide\symbianogg<br />play\groupS60V3MMF\OGGSHAREDS60V3MMF\GCCE\OGGSHAREDS60V3MMF.GCCE" UREL<br />utf8fix.c<br />cc1.exe: warning: command line option "-Wno-ctor-dtor-privacy" is valid for C++/<br />ObjC++ but not for C<br />In file included from /Symbian/Carbide/symbianoggplay/SHARED/OggShared.h:23,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; from /Symbian/Carbide/symbianoggplay/SHARED/utf8fix.c:38:<br />/Symbian/9.2/S60_3rd_FP1/EPOC32/include/e32def.h:2803: error: initializer elemen<br />t is not constant<br />make[1]: *** [\Symbian\9.2\S60_3rd_FP1\EPOC32\BUILD\Symbian\Carbide\symbianoggpl<br />ay\groupS60V3MMF\OGGSHAREDS60V3MMF\GCCE\UREL\utf8fix.o] Error 1<br />make: *** [TARGETOGGSHAREDS60V3MMF] Error 2<br />&nbsp; make -r&nbsp; -f "\Symbian\9.2\S60_3rd_FP1\EPOC32\BUILD\Symbian\Carbide\symbianoggp<br />lay\groupS60V3MMF\GCCE.make" FINAL CFG=UREL VERBOSE=-s</font><br /></div>
<div><strong><font size="4">还是有错，追到底了。又一轮搜索，查资料。后来看了一位大哥的文章，估计开始时是函数导出有问题。</font></strong></div>
<div>Hi jacjames,&nbsp;<br />&nbsp;<br />Frozen exports are a common issue when dealing with a DLL type projects unfortunately. I'm not sure exactly how to work it out through CodeWarrior but if you type 'abld freeze winscw' on a command prompt while inside the /group directory you'll get those exports frozen. After that you should be able to compile normally on CodeWarrior or on the command prompt ('abld build winscw udeb' is the command). &nbsp;<br />&nbsp;<br />In the off chance that it doesn't work (abld is tricky) delete the BMARM and BWINS (if there is one) directories. Don't worry, abld should recreate them.&nbsp;<br />&nbsp;<br />Regards,&nbsp;<br />Francisco Pimenta<!-- google_ad_section_end -->&nbsp;</div>
<div>&nbsp;</div>
<div><strong><font size="4">我也有样学样，先</font></strong></div>
<div><font color="#00ff00" size="4">abld freeze winscw</font></div>
<div><strong><font size="4">再编译。竟然通过了。期间会有些提示找不到s60v3mmfsplash.bmp之类的错误，自己做个图片上去就行了。<br /></font></strong></div>]]></description>
 <link><![CDATA[http://juwen.blog.51cto.com/135311/117610]]></link>
 <author><![CDATA[juwen]]></author>
 <category><![CDATA[C/C++]]></category>
 <pubdate><![CDATA[Sat, 06 Dec 2008 16:58:18 +0000]]></pubdate>
</item>
<item>
 <title><![CDATA[symbian oggplay 音乐播放器开发（1）]]></title>
 <description><![CDATA[<div>symbian oggplay是symbian平台的一个开源音乐播放器。</div>
<div>下载下来有很多个版本，包括s60,s60v3,UIQ,S80,S90</div>
<div>我对音乐播放器比较感兴趣。现在开始一步步的来尝试在这个基础上开发一个音乐播放器。</div>
<div>首先下载源代码：</div>
<div><a href="http://symbianoggplay.sourceforge.net">[url]http://symbianoggplay.sourceforge.net[/url]</a></div>
<div>&nbsp;</div>
<div>由于symbianoggplay并没有提供源代码的打包下载。必须使用cvs进行下载,如果你手上已经 有eclipse或者carbide c++，可以直接在里面新建一个cvs任务将源代码下载下来，如果没有CVS下载工具，装一个吧。怎么样安装CVS客户端不在本文讨论范围，本来甚至下载源代码这篇文章也是多余的，不过我的确是找了很长时间oggplay的源代码。所以记录下来，让后面在找oggplay源代码的朋友可以省回不少功夫。</div>
<div>&nbsp;</div>
<div><b>Anonymous CVS Access</b> </div>
<div><tt><font face=新宋体>cvs -d:pserver:anonymous@symbianoggplay.cvs.sourceforge.net:/cvsroot/symbianoggplay login <br />&nbsp;<br />cvs -z3 -d:pserver:anonymous@symbianoggplay.cvs.sourceforge.net:/cvsroot/symbianoggplay co -P <i>modulename</i> </font></tt></div>
<div><!-- developer access --><br /></div>
<div><b>Developer CVS Access via SSH</b> </div>
<div><tt><font face=新宋体>export CVS_RSH=ssh <br />&nbsp;<br />cvs -z3 -d:ext:<i>developername</i>@symbianoggplay.cvs.sourceforge.net:/cvsroot/symbianoggplay co -P <i>modulename</i> </font></tt></div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>&nbsp;</div>]]></description>
 <link><![CDATA[http://juwen.blog.51cto.com/135311/117174]]></link>
 <author><![CDATA[juwen]]></author>
 <category><![CDATA[C/C++]]></category>
 <pubdate><![CDATA[Thu, 04 Dec 2008 14:11:42 +0000]]></pubdate>
</item>
<item>
 <title><![CDATA[symbian 视频播放解决方案]]></title>
 <description><![CDATA[<div class=MsoNormal style="margin: 0cm 0cm 0pt; text-indent: 21pt; line-height: 150%; mso-char-indent-count: 2.0"><font size="3"><span lang=EN-US><font face=Calibri>1. <span style="mso-spacerun: yes">&nbsp;</span>S60</font></span><span style="font-family: 宋体; mso-fareast-font-family: 宋体; mso-ascii-font-family: calibri; mso-ascii-theme-font: minor-latin; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: calibri; mso-hansi-theme-font: minor-latin">用多媒体框架</span><span lang=EN-US><font face=Calibri>(MMF)</font></span><span style="font-family: 宋体; mso-fareast-font-family: 宋体; mso-ascii-font-family: calibri; mso-ascii-theme-font: minor-latin; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: calibri; mso-hansi-theme-font: minor-latin">实现视频和音频的回放和录制，其拥有一个插件架构，可使用多种类型的用于媒体回放和录制的插件，比如</span><span lang=EN-US><font face=Calibri>RealPlayer</font></span><span style="font-family: 宋体; mso-fareast-font-family: 宋体; mso-ascii-font-family: calibri; mso-ascii-theme-font: minor-latin; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: calibri; mso-hansi-theme-font: minor-latin">引擎是针对</span><span lang=EN-US><font face=Calibri>MMF</font></span><span style="font-family: 宋体; mso-fareast-font-family: 宋体; mso-ascii-font-family: calibri; mso-ascii-theme-font: minor-latin; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: calibri; mso-hansi-theme-font: minor-latin">控制器的插件，支持视频和音频回放及流。</span></font></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt; text-indent: 21pt; line-height: 150%; mso-char-indent-count: 2.0"><font size="3"><span lang=EN-US><font face=Calibri>2. <span style="mso-spacerun: yes">&nbsp;</span>s60</font></span><span style="font-family: 宋体; mso-fareast-font-family: 宋体; mso-ascii-font-family: calibri; mso-ascii-theme-font: minor-latin; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: calibri; mso-hansi-theme-font: minor-latin">内置播放器采用</span><span lang=EN-US><font face=Calibri>Realplayer</font></span><span style="font-family: 宋体; mso-fareast-font-family: 宋体; mso-ascii-font-family: calibri; mso-ascii-theme-font: minor-latin; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: calibri; mso-hansi-theme-font: minor-latin">引擎。</span><font face=Calibri>&nbsp;</font><span style="font-family: 宋体; mso-fareast-font-family: 宋体; mso-ascii-font-family: calibri; mso-ascii-theme-font: minor-latin; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: calibri; mso-hansi-theme-font: minor-latin">不支持</span><span lang=EN-US><font face=Calibri>HTTP</font></span><span style="font-family: 宋体; mso-fareast-font-family: 宋体; mso-ascii-font-family: calibri; mso-ascii-theme-font: minor-latin; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: calibri; mso-hansi-theme-font: minor-latin">流媒体，因为在显示之前必须把所有的视频数据一次性读入缓存。</span></font></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt; text-indent: 21pt; line-height: 150%; mso-char-indent-count: 2.0"><font size="3"><span lang=EN-US><font face=Calibri>3. <span style="mso-spacerun: yes">&nbsp;</span>S60</font></span><span style="font-family: 宋体; mso-fareast-font-family: 宋体; mso-ascii-font-family: calibri; mso-ascii-theme-font: minor-latin; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: calibri; mso-hansi-theme-font: minor-latin">的常用格式是</span><span lang=EN-US><font face=Calibri> MP4(</font></span><span style="font-family: 宋体; mso-fareast-font-family: 宋体; mso-ascii-font-family: calibri; mso-ascii-theme-font: minor-latin; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: calibri; mso-hansi-theme-font: minor-latin">编解码标准为</span><span lang=EN-US><font face=Calibri>H.263</font></span><span style="font-family: 宋体; mso-fareast-font-family: 宋体; mso-ascii-font-family: calibri; mso-ascii-theme-font: minor-latin; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: calibri; mso-hansi-theme-font: minor-latin">和</span><span lang=EN-US><font face=Calibri>MPEG4)</font></span><span style="font-family: 宋体; mso-fareast-font-family: 宋体; mso-ascii-font-family: calibri; mso-ascii-theme-font: minor-latin; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: calibri; mso-hansi-theme-font: minor-latin">、</span><span lang=EN-US><font face=Calibri>3GP(H.263</font></span><span style="font-family: 宋体; mso-fareast-font-family: 宋体; mso-ascii-font-family: calibri; mso-ascii-theme-font: minor-latin; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: calibri; mso-hansi-theme-font: minor-latin">和</span><span lang=EN-US><font face=Calibri>MPEG4)<span style="mso-spacerun: yes">&nbsp; </span></font></span></font></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt; text-indent: 21pt; line-height: 150%; mso-char-indent-count: 2.0"><font size="3"><span lang=EN-US><font face=Calibri>4.<span style="mso-spacerun: yes">&nbsp; </span>S60</font></span><span style="font-family: 宋体; mso-fareast-font-family: 宋体; mso-ascii-font-family: calibri; mso-ascii-theme-font: minor-latin; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: calibri; mso-hansi-theme-font: minor-latin">平台支持</span><span lang=EN-US><font face=Calibri>C++</font></span><span style="font-family: 宋体; mso-fareast-font-family: 宋体; mso-ascii-font-family: calibri; mso-ascii-theme-font: minor-latin; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: calibri; mso-hansi-theme-font: minor-latin">进行多媒体开发，下表总结了如何用</span><span lang=EN-US><font face=Calibri>C++</font></span><span style="font-family: 宋体; mso-fareast-font-family: 宋体; mso-ascii-font-family: calibri; mso-ascii-theme-font: minor-latin; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: calibri; mso-hansi-theme-font: minor-latin">实现多媒体应用</span></font></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt; text-indent: 21pt; line-height: 150%; mso-char-indent-count: 2.0">
<table class=MsoTableGrid style="border-right: medium none; border-top: medium none; border-left: medium none; border-bottom: medium none; border-collapse: collapse; mso-border-alt: solid black .5pt; mso-border-themecolor: text1; mso-yfti-tbllook: 1184; mso-padding-alt: 0cm 5.4pt 0cm 5.4pt" cellspacing="0" cellpadding="0" border="1">
<tbody>
<tr style="mso-yfti-irow: 0; mso-yfti-firstrow: yes">
<td style="border-right: black 1pt solid; padding-right: 5.4pt; border-top: black 1pt solid; padding-left: 5.4pt; background: #c6d9f1; padding-bottom: 0cm; border-left: black 1pt solid; width: 161.35pt; padding-top: 0cm; border-bottom: black 1pt solid; mso-border-alt: solid black .5pt; mso-border-themecolor: text1; mso-background-themecolor: text2; mso-background-themetint: 51" vAlign=top width="215">
<div class=MsoNormal style="margin: 0cm 0cm 0pt; line-height: 150%"><span style="font-family: 宋体; mso-fareast-font-family: 宋体; mso-ascii-font-family: calibri; mso-ascii-theme-font: minor-latin; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: calibri; mso-hansi-theme-font: minor-latin"><font size="3">用例</font></span></div></td>
<td style="border-right: black 1pt solid; padding-right: 5.4pt; border-top: black 1pt solid; padding-left: 5.4pt; border-left-color: #ffffff; background: #c6d9f1; padding-bottom: 0cm; width: 264.75pt; padding-top: 0cm; border-bottom: black 1pt solid; mso-border-alt: solid black .5pt; mso-border-themecolor: text1; mso-background-themecolor: text2; mso-background-themetint: 51; mso-border-left-alt: solid black .5pt; mso-border-left-themecolor: text1" vAlign=top width="353">
<div class=MsoNormal style="margin: 0cm 0cm 0pt; line-height: 150%"><span lang=EN-US><font face=Calibri size="3">Symbian C++</font></span></div></td></tr>
<tr style="mso-yfti-irow: 1">
<td style="border-right: black 1pt solid; padding-right: 5.4pt; padding-left: 5.4pt; padding-bottom: 0cm; border-left: black 1pt solid; width: 161.35pt; border-top-color: #ffffff; padding-top: 0cm; border-bottom: black 1pt solid; background-color: transparent; mso-border-alt: solid black .5pt; mso-border-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1" vAlign=top width="215">
<div class=MsoNormal style="margin: 0cm 0cm 0pt; line-height: 150%"><font size="3"><span style="font-family: 宋体; mso-fareast-font-family: 宋体; mso-ascii-font-family: calibri; mso-ascii-theme-font: minor-latin; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: calibri; mso-hansi-theme-font: minor-latin">使用</span><span lang=EN-US><font face=Calibri>S60</font></span><span style="font-family: 宋体; mso-fareast-font-family: 宋体; mso-ascii-font-family: calibri; mso-ascii-theme-font: minor-latin; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: calibri; mso-hansi-theme-font: minor-latin">媒体播放器和</span><span lang=EN-US><font face=Calibri>RealPlayer</font></span><span style="font-family: 宋体; mso-fareast-font-family: 宋体; mso-ascii-font-family: calibri; mso-ascii-theme-font: minor-latin; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: calibri; mso-hansi-theme-font: minor-latin">引擎播放本地文件和</span><span lang=EN-US><font face=Calibri>RTSP</font></span><span style="font-family: 宋体; mso-fareast-font-family: 宋体; mso-ascii-font-family: calibri; mso-ascii-theme-font: minor-latin; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: calibri; mso-hansi-theme-font: minor-latin">流。</span></font></div></td>
<td style="border-right: black 1pt solid; padding-right: 5.4pt; padding-left: 5.4pt; border-left-color: #ffffff; padding-bottom: 0cm; width: 264.75pt; border-top-color: #ffffff; padding-top: 0cm; border-bottom: black 1pt solid; background-color: transparent; mso-border-alt: solid black .5pt; mso-border-themecolor: text1; mso-border-left-alt: solid black .5pt; mso-border-left-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1; mso-border-bottom-themecolor: text1; mso-border-right-themecolor: text1" vAlign=top width="353">
<div class=MsoNormal style="margin: 0cm 0cm 0pt; line-height: 150%"><font size="3"><span style="font-family: 宋体; mso-fareast-font-family: 宋体; mso-ascii-font-family: calibri; mso-ascii-theme-font: minor-latin; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: calibri; mso-hansi-theme-font: minor-latin">使用</span><span lang=EN-US><font face=Calibri>AppArc API</font></span><span style="font-family: 宋体; mso-fareast-font-family: 宋体; mso-ascii-font-family: calibri; mso-ascii-theme-font: minor-latin; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: calibri; mso-hansi-theme-font: minor-latin">（</span><span lang=EN-US><font face=Calibri>RApaLsSession</font></span><span style="font-family: 宋体; mso-fareast-font-family: 宋体; mso-ascii-font-family: calibri; mso-ascii-theme-font: minor-latin; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: calibri; mso-hansi-theme-font: minor-latin">）启动</span><span lang=EN-US><font face=Calibri>S60</font></span><span style="font-family: 宋体; mso-fareast-font-family: 宋体; mso-ascii-font-family: calibri; mso-ascii-theme-font: minor-latin; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: calibri; mso-hansi-theme-font: minor-latin">媒体播放器应用。</span></font></div></td></tr>
<tr style="mso-yfti-irow: 2">
<td style="border-right: black 1pt solid; padding-right: 5.4pt; padding-left: 5.4pt; padding-bottom: 0cm; border-left: black 1pt solid; width: 161.35pt; border-top-color: #ffffff; padding-top: 0cm; border-bottom: black 1pt solid; background-color: transparent; mso-border-alt: solid black .5pt; mso-border-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1" vAlign=top width="215">
<div class=MsoNormal style="margin: 0cm 0cm 0pt; line-height: 150%"><font size="3"><span style="font-family: 宋体; mso-fareast-font-family: 宋体; mso-ascii-font-family: calibri; mso-ascii-theme-font: minor-latin; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: calibri; mso-hansi-theme-font: minor-latin">使用定制的用户界面和</span><span lang=EN-US><font face=Calibri>RealPlayer</font></span><span style="font-family: 宋体; mso-fareast-font-family: 宋体; mso-ascii-font-family: calibri; mso-ascii-theme-font: minor-latin; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: calibri; mso-hansi-theme-font: minor-latin">引擎播放本地文件和</span><span lang=EN-US><font face=Calibri>RTSP</font></span><span style="font-family: 宋体; mso-fareast-font-family: 宋体; mso-ascii-font-family: calibri; mso-ascii-theme-font: minor-latin; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: calibri; mso-hansi-theme-font: minor-latin">流。</span></font></div></td>
<td style="border-right: black 1pt solid; padding-right: 5.4pt; padding-left: 5.4pt; border-left-color: #ffffff; padding-bottom: 0cm; width: 264.75pt; border-top-color: #ffffff; padding-top: 0cm; border-bottom: black 1pt solid; background-color: transparent; mso-border-alt: solid black .5pt; mso-border-themecolor: text1; mso-border-left-alt: solid black .5pt; mso-border-left-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1; mso-border-bottom-themecolor: text1; mso-border-right-themecolor: text1" vAlign=top width="353">
<div class=MsoNormal style="margin: 0cm 0cm 0pt; line-height: 150%"><font size="3"><span style="font-family: 宋体; mso-fareast-font-family: 宋体; mso-ascii-font-family: calibri; mso-ascii-theme-font: minor-latin; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: calibri; mso-hansi-theme-font: minor-latin">创建自己的用户界面并使用</span><span lang=EN-US><font face=Calibri>CVideoPlayerUtility API</font></span><span style="font-family: 宋体; mso-fareast-font-family: 宋体; mso-ascii-font-family: calibri; mso-ascii-theme-font: minor-latin; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: calibri; mso-hansi-theme-font: minor-latin">播放和控制文件或</span><span lang=EN-US><font face=Calibri>URL</font></span><span style="font-family: 宋体; mso-fareast-font-family: 宋体; mso-ascii-font-family: calibri; mso-ascii-theme-font: minor-latin; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: calibri; mso-hansi-theme-font: minor-latin">。</span></font></div></td></tr>
<tr style="mso-yfti-irow: 3">
<td style="border-right: black 1pt solid; padding-right: 5.4pt; padding-left: 5.4pt; padding-bottom: 0cm; border-left: black 1pt solid; width: 161.35pt; border-top-color: #ffffff; padding-top: 0cm; border-bottom: black 1pt solid; background-color: transparent; mso-border-alt: solid black .5pt; mso-border-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1" vAlign=top width="215">
<div class=MsoNormal style="margin: 0cm 0cm 0pt; line-height: 150%"><span style="font-family: 宋体; mso-fareast-font-family: 宋体; mso-ascii-font-family: calibri; mso-ascii-theme-font: minor-latin; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: calibri; mso-hansi-theme-font: minor-latin"><font size="3">使用自己的播放器播放本地文件。</font></span></div></td>
<td style="border-right: black 1pt solid; padding-right: 5.4pt; padding-left: 5.4pt; border-left-color: #ffffff; padding-bottom: 0cm; width: 264.75pt; border-top-color: #ffffff; padding-top: 0cm; border-bottom: black 1pt solid; background-color: transparent; mso-border-alt: solid black .5pt; mso-border-themecolor: text1; mso-border-left-alt: solid black .5pt; mso-border-left-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1; mso-border-bottom-themecolor: text1; mso-border-right-themecolor: text1" vAlign=top width="353">
<div class=MsoNormal style="margin: 0cm 0cm 0pt; line-height: 150%"><font size="3"><span style="font-family: 宋体; mso-fareast-font-family: 宋体; mso-ascii-font-family: calibri; mso-ascii-theme-font: minor-latin; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: calibri; mso-hansi-theme-font: minor-latin">创建自己的播放器。使用</span><span lang=EN-US><font face=Calibri>CMdaAudioOutputStream</font></span><span style="font-family: 宋体; mso-fareast-font-family: 宋体; mso-ascii-font-family: calibri; mso-ascii-theme-font: minor-latin; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: calibri; mso-hansi-theme-font: minor-latin">进行音频渲染（</span><span lang=EN-US><font face=Calibri>1</font></span><span style="font-family: 宋体; mso-fareast-font-family: 宋体; mso-ascii-font-family: calibri; mso-ascii-theme-font: minor-latin; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: calibri; mso-hansi-theme-font: minor-latin">），使用</span><span lang=EN-US><font face=Calibri>CDirectScreenAccess API </font></span><span style="font-family: 宋体; mso-fareast-font-family: 宋体; mso-ascii-font-family: calibri; mso-ascii-theme-font: minor-latin; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: calibri; mso-hansi-theme-font: minor-latin">进行视频渲染。</span></font></div></td></tr>
<tr style="mso-yfti-irow: 4; mso-yfti-lastrow: yes">
<td style="border-right: black 1pt solid; padding-right: 5.4pt; padding-left: 5.4pt; padding-bottom: 0cm; border-left: black 1pt solid; width: 161.35pt; border-top-color: #ffffff; padding-top: 0cm; border-bottom: black 1pt solid; background-color: transparent; mso-border-alt: solid black .5pt; mso-border-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1" vAlign=top width="215">
<div class=MsoNormal style="margin: 0cm 0cm 0pt; line-height: 150%"><span style="font-family: 宋体; mso-fareast-font-family: 宋体; mso-ascii-font-family: calibri; mso-ascii-theme-font: minor-latin; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: calibri; mso-hansi-theme-font: minor-latin"><font size="3">使用自己的播放器实施流视频内容。</font></span></div></td>
<td style="border-right: black 1pt solid; padding-right: 5.4pt; padding-left: 5.4pt; border-left-color: #ffffff; padding-bottom: 0cm; width: 264.75pt; border-top-color: #ffffff; padding-top: 0cm; border-bottom: black 1pt solid; background-color: transparent; mso-border-alt: solid black .5pt; mso-border-themecolor: text1; mso-border-left-alt: solid black .5pt; mso-border-left-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1; mso-border-bottom-themecolor: text1; mso-border-right-themecolor: text1" vAlign=top width="353">
<div class=MsoNormal style="margin: 0cm 0cm 0pt; line-height: 150%"><font size="3"><span style="font-family: 宋体; mso-fareast-font-family: 宋体; mso-ascii-font-family: calibri; mso-ascii-theme-font: minor-latin; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: calibri; mso-hansi-theme-font: minor-latin">使用</span><span lang=EN-US><font face=Calibri>network APIs( RSocketServ</font></span><span style="font-family: 宋体; mso-fareast-font-family: 宋体; mso-ascii-font-family: calibri; mso-ascii-theme-font: minor-latin; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: calibri; mso-hansi-theme-font: minor-latin">、</span><span lang=EN-US><font face=Calibri>RConnection</font></span><span style="font-family: 宋体; mso-fareast-font-family: 宋体; mso-ascii-font-family: calibri; mso-ascii-theme-font: minor-latin; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: calibri; mso-hansi-theme-font: minor-latin">、</span><span lang=EN-US><font face=Calibri>RSocket) </font></span><span style="font-family: 宋体; mso-fareast-font-family: 宋体; mso-ascii-font-family: calibri; mso-ascii-theme-font: minor-latin; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: calibri; mso-hansi-theme-font: minor-latin">连接到网络（</span><span lang=EN-US><font face=Calibri>2</font></span><span style="font-family: 宋体; mso-fareast-font-family: 宋体; mso-ascii-font-family: calibri; mso-ascii-theme-font: minor-latin; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: calibri; mso-hansi-theme-font: minor-latin">）。</span><font face=Calibri>&nbsp;</font><span style="font-family: 宋体; mso-fareast-font-family: 宋体; mso-ascii-font-family: calibri; mso-ascii-theme-font: minor-latin; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: calibri; mso-hansi-theme-font: minor-latin">然后使用</span><span lang=EN-US><font face=Calibri>CMdaAudioOutputStream</font></span><span style="font-family: 宋体; mso-fareast-font-family: 宋体; mso-ascii-font-family: calibri; mso-ascii-theme-font: minor-latin; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: calibri; mso-hansi-theme-font: minor-latin">进行音频渲染，使用</span><span lang=EN-US><font face=Calibri>CDirectScreenAccess API </font></span><span style="font-family: 宋体; mso-fareast-font-family: 宋体; mso-ascii-font-family: calibri; mso-ascii-theme-font: minor-latin; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: calibri; mso-hansi-theme-font: minor-latin">进行视频渲染。</span></font></div></td></tr></tbody></table></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt; text-indent: 21pt; line-height: 150%; mso-char-indent-count: 2.0"><span lang=EN-US>
<div><font face=Calibri size="3"></font>&nbsp;</div></span>
<div></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt; text-indent: 21pt; line-height: 150%; mso-char-indent-count: 2.0"><font size="3"><span lang=EN-US><font face=Calibri>5. <span style="mso-spacerun: yes">&nbsp;</span></font></span><span style="font-family: 宋体; mso-fareast-font-family: 宋体; mso-ascii-font-family: calibri; mso-ascii-theme-font: minor-latin; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: calibri; mso-hansi-theme-font: minor-latin">从上表得出结论，</span><span lang=EN-US><font face=Calibri>CVideoPlayerUtility</font></span><span style="font-family: 宋体; mso-fareast-font-family: 宋体; mso-ascii-font-family: calibri; mso-ascii-theme-font: minor-latin; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: calibri; mso-hansi-theme-font: minor-latin">用来开发视频剪辑的播放和录制。如果要开发一个读取本地文件或</span><span lang=EN-US><font face=Calibri>RTSP</font></span><span style="font-family: 宋体; mso-fareast-font-family: 宋体; mso-ascii-font-family: calibri; mso-ascii-theme-font: minor-latin; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: calibri; mso-hansi-theme-font: minor-latin">流而且格式为</span><span lang=EN-US><font face=Calibri>MP4</font></span><span style="font-family: 宋体; mso-fareast-font-family: 宋体; mso-ascii-font-family: calibri; mso-ascii-theme-font: minor-latin; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: calibri; mso-hansi-theme-font: minor-latin">、</span><span lang=EN-US><font face=Calibri>3GP</font></span><span style="font-family: 宋体; mso-fareast-font-family: 宋体; mso-ascii-font-family: calibri; mso-ascii-theme-font: minor-latin; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: calibri; mso-hansi-theme-font: minor-latin">或</span><span lang=EN-US><font face=Calibri>Rmvb</font></span><span style="font-family: 宋体; mso-fareast-font-family: 宋体; mso-ascii-font-family: calibri; mso-ascii-theme-font: minor-latin; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: calibri; mso-hansi-theme-font: minor-latin">的播放器，使用</span><span lang=EN-US><font face=Calibri>CVideoPlayerUtility</font></span><span style="font-family: 宋体; mso-fareast-font-family: 宋体; mso-ascii-font-family: calibri; mso-ascii-theme-font: minor-latin; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: calibri; mso-hansi-theme-font: minor-latin">就够了。</span><font face=Calibri>&nbsp;</font><span style="font-family: 宋体; mso-fareast-font-family: 宋体; mso-ascii-font-family: calibri; mso-ascii-theme-font: minor-latin; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: calibri; mso-hansi-theme-font: minor-latin">但如果需要读取网络数据流，就必须用</span><span lang=EN-US><font face=Calibri>network APIs</font></span><span style="font-family: 宋体; mso-fareast-font-family: 宋体; mso-ascii-font-family: calibri; mso-ascii-theme-font: minor-latin; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: calibri; mso-hansi-theme-font: minor-latin">连接到网络获取数据，接着用</span><span lang=EN-US><font face=Calibri>CDirectScreenAccess API</font></span><span style="font-family: 宋体; mso-fareast-font-family: 宋体; mso-ascii-font-family: calibri; mso-ascii-theme-font: minor-latin; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: calibri; mso-hansi-theme-font: minor-latin">绘制屏幕，当中主要步骤有</span><span lang=EN-US><font face=Calibri>RTP</font></span><span style="font-family: 宋体; mso-fareast-font-family: 宋体; mso-ascii-font-family: calibri; mso-ascii-theme-font: minor-latin; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: calibri; mso-hansi-theme-font: minor-latin">传输，</span><span lang=EN-US><font face=Calibri>mpeg4/h264</font></span><span style="font-family: 宋体; mso-fareast-font-family: 宋体; mso-ascii-font-family: calibri; mso-ascii-theme-font: minor-latin; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: calibri; mso-hansi-theme-font: minor-latin">解码，</span><span lang=EN-US><font face=Calibri>yuv2rgb</font></span><span style="font-family: 宋体; mso-fareast-font-family: 宋体; mso-ascii-font-family: calibri; mso-ascii-theme-font: minor-latin; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: calibri; mso-hansi-theme-font: minor-latin">转换。如果不用</span><span lang=EN-US><font face=Calibri>symbian</font></span><span style="font-family: 宋体; mso-fareast-font-family: 宋体; mso-ascii-font-family: calibri; mso-ascii-theme-font: minor-latin; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: calibri; mso-hansi-theme-font: minor-latin">的</span><span lang=EN-US><font face=Calibri>API</font></span><span style="font-family: 宋体; mso-fareast-font-family: 宋体; mso-ascii-font-family: calibri; mso-ascii-theme-font: minor-latin; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: calibri; mso-hansi-theme-font: minor-latin">，流媒体传输可移植</span><span lang=EN-US><font face=Calibri>live555,</font></span><span style="font-family: 宋体; mso-fareast-font-family: 宋体; mso-ascii-font-family: calibri; mso-ascii-theme-font: minor-latin; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: calibri; mso-hansi-theme-font: minor-latin">视音频解码可用</span><span lang=EN-US><font face=Calibri>ffmpeg</font></span><span style="font-family: 宋体; mso-fareast-font-family: 宋体; mso-ascii-font-family: calibri; mso-ascii-theme-font: minor-latin; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: calibri; mso-hansi-theme-font: minor-latin">。</span></font></div>]]></description>
 <link><![CDATA[http://juwen.blog.51cto.com/135311/116161]]></link>
 <author><![CDATA[juwen]]></author>
 <category><![CDATA[C/C++]]></category>
 <pubdate><![CDATA[Sat, 29 Nov 2008 15:38:34 +0000]]></pubdate>
</item>
<item>
 <title><![CDATA[Symbian 资源文件解析]]></title>
 <description><![CDATA[<div style="margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><span style="font-size: 10.5pt; color: black"><font face=宋体>一、何为资源文件：<span lang=EN-US><?XML:NAMESPACE PREFIX = O /><o:P></O:P></span></font></span></div>
<div style="margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><span style="font-size: 10.5pt; color: black"><font face=宋体>在<span lang=EN-US>symbian</span>应用程序中，资源文件指的是后缀名为<span lang=EN-US>.rss</span>的文件，每个应用程序至少要有一个与之关联的资源文件。资源编译器<span lang=EN-US>rcomp</span>编译资源文件后，生成一个<span lang=EN-US>.rsc</span>二进制文件和一个相伴的头文件（<span lang=EN-US>.rsg</span>）。这样在应用程序框架启动应用程序时，会打开这个二进制文件，借助在<span lang=EN-US>.rsg</span>文件中创建的资源标志符，根据需要把各个资源加载到<span lang=EN-US>C++</span>代码中。<span lang=EN-US><o:P></O:P></span></font></span></div>
<div style="margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><span lang=EN-US style="font-size: 10.5pt; color: black"><o:P><font face=宋体>&nbsp;</font></O:P></span></div>
<div style="margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><span style="font-size: 10.5pt; color: black"><font face=宋体>二、资源文件的作用：<span lang=EN-US><o:P></O:P></span></font></span></div>
<div style="margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><span style="font-size: 10.5pt; color: black"><font face=宋体>在资源文件中指定用户界面的布局，如常用组件菜单、对话框、列表等在界面上的排列样式，另外还可以在其中指定界面上用户可见的文本信息。当然，这些可见文本并不一定通过字符串在<span lang=EN-US>.rss</span>资源文件中定义，我们一般在<span lang=EN-US>.loc</span>本地文件中定义，而只需在<span lang=EN-US>.rss</span>资源文件中将<span lang=EN-US>.loc</span>本地文件引入（<span lang=EN-US>include</span>）即可。（刚开始我百思不得其解，真不知道程序终相关的字符串定义在哪里的）<span lang=EN-US><o:P></O:P></span></font></span></div>
<div style="margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><span lang=EN-US style="font-size: 10.5pt; color: black"><o:P><font face=宋体>&nbsp;</font></O:P></span></div>
<div style="margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><span style="font-size: 10.5pt; color: black"><font face=宋体>三、资源文件的结构（语法）：<span lang=EN-US><o:P></O:P></span></font></span></div>
<div style="margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><span style="font-size: 10.5pt; color: black"><font face=宋体>资源文件的具体结构由两部分构成，分别称为头部和主体。<span lang=EN-US><o:P></O:P></span></font></span></div>
<div style="margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><font face=宋体><span lang=EN-US style="font-size: 10.5pt; color: black">1</span><span style="font-size: 10.5pt; color: black">、头部：主要包括五部分，分别是文件名字、<span lang=EN-US>include</span>包含语句、签名、文档名缓冲、应用程序信息资源这些些资源文件标准信息。<span lang=EN-US><o:P></O:P></span></span></font></div>
<div style="margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><span style="font-size: 10.5pt; color: black"><font face=宋体>（<span lang=EN-US>1</span>）名字：用<span lang=EN-US>NAME</span>语句定义，该语句必须是资源文件中第一个有意义的行（注释和空白语句不在有意义行定义内），即这条语句要位于<span lang=EN-US>include</span>包含语句之前，后面没有分号。该语句指定一个由<span lang=EN-US>1</span>到<span lang=EN-US>4</span>个字符组成的名字，并建议使用大写字符。如果应用程序使用了多个资源文件的话，那么可以通过它进行区分。如：<span lang=EN-US>NAME HELL<o:P></O:P></span></font></span></div>
<div style="margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><span style="font-size: 10.5pt; color: black"><font face=宋体>（<span lang=EN-US>2</span>）<span lang=EN-US>include</span>包含语句：允许使用其他地方定义的符号和结构。常见的有<span lang=EN-US>uikon.rh</span>、<span lang=EN-US>eikon.rh</span>、<span lang=EN-US>avkon.rh</span>等<span lang=EN-US><o:P></O:P></span></font></span></div>
<div style="margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><span style="font-size: 10.5pt; color: black"><font face=宋体>（<span lang=EN-US>3</span>）签名：它的内容实际上被忽略，但必须有这条语句，否则加载资源时便报错。一般将实际内容置为空，如：<span lang=EN-US>RESOURCE RSS_SIGNATURE { } </span>，后面没有分号。<span lang=EN-US><o:P></O:P></span></font></span></div>
<div style="margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><span style="font-size: 10.5pt; color: black"><font face=宋体>（<span lang=EN-US>4</span>）文档名缓冲：指定应用程序默认文档名的<span lang=EN-US>TBUF</span>资源。大部分程序不使用文档，但仍然必须包含此资源，否则加载资源失败。不需指定文件的扩展名，因为<span lang=EN-US>S60</span>本地文档不使用扩展名。如：<span lang=EN-US>RESOURCE TBUF { buffer=”HelloWorld”;}<o:P></O:P></span></font></span></div>
<div style="margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><span style="font-size: 10.5pt; color: black"><font face=宋体>在这里的文件名将作为参数传递给<span lang=EN-US>CAknDocument</span>类的<span lang=EN-US>OpenFileL(TBool aDoOpen, const TDesC&amp; aFilename, RFs&amp; aFs)</span>方法。这允许一个应用程序在运行时打开一个默认的文档。如果这里的值为空那么程序默认文档名和应用程序名一致。<span lang=EN-US><o:P></O:P></span></font></span></div>
<div style="margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><span style="font-size: 10.5pt; color: black"><font face=宋体>（<span lang=EN-US>5</span>）应用程序信息资源：这个资源比较重要。<span lang=EN-US>EIK_APP_INFO</span>资源为应用程序指定各种标准控件。如状态面板等，通常会创建一个为状态面板指定新内容的资源，然后使用<span lang=EN-US>EIK_APP_INFO</span>资源的<span lang=EN-US>status_pane</span>字段引用它。如：<span lang=EN-US><o:P></O:P></span></font></span></div>
<div style="background: #cccccc; margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><span lang=EN-US style="font-size: 10.5pt; color: black"><font face=宋体>RESOURCE EIK_APP_INFO<o:P></O:P></font></span></div>
<div style="background: #cccccc; margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><span lang=EN-US style="font-size: 10.5pt; color: black"><font face=宋体>{<o:P></O:P></font></span></div>
<div style="background: #cccccc; margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><span lang=EN-US style="font-size: 10.5pt; color: black"><font face=宋体>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; hotkeys = r_HelloWorld_hotkeys;<o:P></O:P></font></span></div>
<div style="background: #cccccc; margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><span lang=EN-US style="font-size: 10.5pt; color: black"><font face=宋体>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;menubar = r_HelloWorld_menubar;<o:P></O:P></font></span></div>
<div style="background: #cccccc; margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><span lang=EN-US style="font-size: 10.5pt; color: black"><font face=宋体>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cba = R_AVKON_SOFTKEYS_OPTIONS_BACK;<o:P></O:P></font></span></div>
<div style="background: #cccccc; margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><span lang=EN-US style="font-size: 10.5pt; color: black"><font face=宋体>&nbsp;}<o:P></O:P></font></span></div>
<div style="margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><span style="font-size: 10.5pt; color: black"><font face=宋体>注意：头部中定义的各种资源都没有资源名。<span lang=EN-US><o:P></O:P></span></font></span></div>
<div style="margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><span lang=EN-US style="font-size: 10.5pt; color: black"><o:P><font face=宋体>&nbsp;</font></O:P></span></div>
<div style="margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><font face=宋体><span lang=EN-US style="font-size: 10.5pt; color: black">2</span><span style="font-size: 10.5pt; color: black">、主体<span lang=EN-US><o:P></O:P></span></span></font></div>
<div style="margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><span style="font-size: 10.5pt; color: black"><font face=宋体>主体部分主要定义了应用程序中将要使用的各种资源。<span lang=EN-US><o:P></O:P></span></font></span></div>
<div style="margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><span style="font-size: 10.5pt; color: black"><font face=宋体>它的一般定义格式如下：<span lang=EN-US><o:P></O:P></span></font></span></div>
<div style="background: #cccccc; margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><span lang=EN-US style="font-size: 10.5pt; color: black"><font face=宋体>RESOURCE STRUCTNAME resource-name<o:P></O:P></font></span></div>
<div style="background: #cccccc; margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><span lang=EN-US style="font-size: 10.5pt; color: black"><font face=宋体>{<o:P></O:P></font></span></div>
<div style="background: #cccccc; margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><span lang=EN-US style="font-size: 10.5pt; color: black"><font face=宋体>&nbsp;&nbsp;&nbsp; resource-initializer-list<o:P></O:P></font></span></div>
<div style="background: #cccccc; margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><span lang=EN-US style="font-size: 10.5pt; color: black"><font face=宋体>}<o:P></O:P></font></span></div>
<div style="margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><span style="font-size: 10.5pt; color: black"><font face=宋体>在这里<span lang=EN-US>STRUCTNAME</span>应替换为具体的资源结构类型，而这些资源结构类型已在文件头部<span lang=EN-US>include</span>包含的<span lang=EN-US>eikon.rh</span>、<span lang=EN-US>uikon.rh</span>、<span lang=EN-US>avkon.rh</span>中进行了定义。<span lang=EN-US><o:P></O:P></span></font></span></div>
<div style="margin: 0cm 0cm 0pt; text-indent: 21.1pt; mso-char-indent-count: 2.0"><font face=宋体><strong style="mso-bidi-font-weight: normal"><span style="font-size: 10.5pt; color: black">资源名<span lang=EN-US>resource-name</span>必须小写，通常以<span lang=EN-US>r_</span>开头，而在<span lang=EN-US>C++</span>文件中使用他们时必须大写</span></strong><span style="font-size: 10.5pt; color: black">，这和资源编译器工作方式有关。例如：<span lang=EN-US><o:P></O:P></span></span></font></div>
<div style="margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><font face=宋体><span lang=EN-US style="font-size: 10.5pt; color: black">//</span><span style="font-size: 10.5pt; color: black">资源名定义<span lang=EN-US><o:P></O:P></span></span></font></div>
<div style="background: #cccccc; margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><span lang=EN-US style="font-size: 10.5pt; color: black"><font face=宋体>RESOURCE AVKON_VIEW r_viewmychannelhot<o:P></O:P></font></span></div>
<div style="background: #cccccc; margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><span lang=EN-US style="font-size: 10.5pt; color: black"><font face=宋体>{<o:P></O:P></font></span></div>
<div style="background: #cccccc; margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><span lang=EN-US style="font-size: 10.5pt; color: black"><font face=宋体><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </span>hotkeys=r_xv_hotkeys;<o:P></O:P></font></span></div>
<div style="background: #cccccc; margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><span lang=EN-US style="font-size: 10.5pt; color: black"><font face=宋体><span style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp; </span>menubar=r_menubar_viewmychannelhot;<o:P></O:P></font></span></div>
<div style="background: #cccccc; margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><span lang=EN-US style="font-size: 10.5pt; color: black"><font face=宋体><span style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp; </span>cba=R_AVKON_SOFTKEYS_SELECTION_LIST;<o:P></O:P></font></span></div>
<div style="background: #cccccc; margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><span lang=EN-US style="font-size: 10.5pt; color: black"><font face=宋体>}<o:P></O:P></font></span></div>
<div style="background: #cccccc; margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><font face=宋体><span lang=EN-US style="font-size: 10.5pt; color: black">//</span><span style="font-size: 10.5pt; color: black">资源调用<span lang=EN-US><o:P></O:P></span></span></font></div>
<div style="background: #cccccc; margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><span lang=EN-US style="font-size: 10.5pt; color: black"><font face=宋体>BaseConstructL(R_VIEWMYCHANNELHOT);<o:P></O:P></font></span></div>
<div style="margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><span style="font-size: 10.5pt; color: black"><font face=宋体>下面具体研究<span lang=EN-US>resource-initializer-list</span>（初始化资源字段），根据要资源字段的不同类型，初始化字段有三种不同方式：简单初始化器、数组初始化器、结构初始化器。如下：<span lang=EN-US><o:P></O:P></span></font></span></div>
<div style="background: #cccccc; margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><span lang=EN-US style="font-size: 10.5pt; color: black"><font face=宋体>RESOURCE STRUCT r_my_example_struct<o:P></O:P></font></span></div>
<div style="background: #cccccc; margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><span lang=EN-US style="font-size: 10.5pt; color: black"><font face=宋体>{<o:P></O:P></font></span></div>
<div style="background: #cccccc; margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><font face=宋体><span lang=EN-US style="font-size: 10.5pt; color: black">&nbsp;&nbsp;&nbsp; simple=EeikCtLabel;&nbsp; //</span><span style="font-size: 10.5pt; color: black">简单初始化器，分配单个值或字符串<span lang=EN-US><o:P></O:P></span></span></font></div>
<div style="background: #cccccc; margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><font face=宋体><span lang=EN-US style="font-size: 10.5pt; color: black">&nbsp;&nbsp;&nbsp; array={1,2,3};&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //</span><span style="font-size: 10.5pt; color: black">数组初始化器，大括号，元素用逗号隔开<span lang=EN-US><o:P></O:P></span></span></font></div>
<div style="background: #cccccc; margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><font face=宋体><span lang=EN-US style="font-size: 10.5pt; color: black">&nbsp;&nbsp;&nbsp; structmember=OTHERSTRUCT&nbsp;&nbsp; //</span><span style="font-size: 10.5pt; color: black">结构初始化器，编译器不进行类型检查，要小心<span lang=EN-US><o:P></O:P></span></span></font></div>
<div style="background: #cccccc; margin: 0cm 0cm 0pt; text-indent: 36.75pt; mso-char-indent-count: 3.5"><span lang=EN-US style="font-size: 10.5pt; color: black"><font face=宋体>{<o:P></O:P></font></span></div>
<div style="background: #cccccc; margin: 0cm 0cm 0pt; text-indent: 36.75pt; mso-char-indent-count: 3.5"><span lang=EN-US style="font-size: 10.5pt; color: black"><font face=宋体>&nbsp;&nbsp;&nbsp;&nbsp; simple1=”hello”;<o:P></O:P></font></span></div>
<div style="background: #cccccc; margin: 0cm 0cm 0pt; text-indent: 36.75pt; mso-char-indent-count: 3.5"><span lang=EN-US style="font-size: 10.5pt; color: black"><font face=宋体>&nbsp;&nbsp;&nbsp;&nbsp; simple2=”goodbye”;<o:P></O:P></font></span></div>
<div style="background: #cccccc; margin: 0cm 0cm 0pt; text-indent: 36.75pt; mso-char-indent-count: 3.5"><span lang=EN-US style="font-size: 10.5pt; color: black"><font face=宋体>}<o:P></O:P></font></span></div>
<div style="background: #cccccc; margin: 0cm 0cm 0pt; text-indent: 26.25pt; mso-char-indent-count: 2.5"><span lang=EN-US style="font-size: 10.5pt; color: black"><font face=宋体>}<o:P></O:P></font></span></div>
<div style="margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><span style="font-size: 10.5pt; color: black"><font face=宋体>由以上示例可知：<span lang=EN-US><o:P></O:P></span></font></span></div>
<div style="margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><span style="font-size: 10.5pt; color: black"><font face=宋体>简单初始化器：为字段分配单个值或字符串；<span lang=EN-US><o:P></O:P></span></font></span></div>
<div style="margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><span style="font-size: 10.5pt; color: black"><font face=宋体>数组初始化器：为数组字段分配单个或多个值，格式用大括号括起，其中元素用逗号隔开；<span lang=EN-US><o:P></O:P></span></font></span></div>
<div style="margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><span style="font-size: 10.5pt; color: black"><font face=宋体>结构初始化器：为结构字段分配单个或多个值。首先初始化时需要提供结构名，而后指定结构每个字段；其次资源编译器不进行类型检查，所哦一设定值时必须与结构字段相应类型一致，否则编译能通过但是运行会出错。<span lang=EN-US><o:P></O:P></span></font></span></div>
<div style="margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><span lang=EN-US style="font-size: 10.5pt; color: black"><o:P><font face=宋体>&nbsp;</font></O:P></span></div>
<div style="margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><span style="font-size: 10.5pt; color: black"><font face=宋体>由于采用不同的控件时，其采用的资源字段各不相同，所以先分析三类具体的资源定义，具体控件的资源定义，放在具体控件中阐述。<span lang=EN-US><o:P></O:P></span></font></span></div>
<div style="margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><span style="font-size: 10.5pt; color: black"><font face=宋体>（<span lang=EN-US>1</span>）字符串资源：<span lang=EN-US><o:P></O:P></span></font></span></div>
<div style="margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><span style="font-size: 10.5pt; color: black"><font face=宋体>可以使用<span lang=EN-US>TBUF</span>资源将字符串包含在资源文件中。通常，会在一个<span lang=EN-US>.loc</span>文件中或是在指定语言的<span lang=EN-US>.lxx</span>文件中定义字符串文字，而不是在<span lang=EN-US>.rss</span>文件中定义它们，只需在<span lang=EN-US>.rss</span>文件中将<span lang=EN-US>.loc</span>文件包含进来即可。<span lang=EN-US><o:P></O:P></span></font></span></div>
<div style="margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><font face=宋体><span lang=EN-US style="font-size: 10.5pt; color: black">.lxx</span><span style="font-size: 10.5pt; color: black">文件中的<span lang=EN-US>xx</span>应该替换为<span lang=EN-US>e32std.h</span>中的<span lang=EN-US>Tlanguage</span>枚举定义的两位数字区域设置码，之后按照<span lang=EN-US>.mmp</span>项目文件中设置的当前生成区域设置把<span lang=EN-US>.lxx</span>文件包含到<span lang=EN-US>.loc</span>文件中。看一个定义了<span lang=EN-US>.lxx</span>文件的<span lang=EN-US>.loc</span>文件实例：<span lang=EN-US><o:P></O:P></span></span></font></div>
<div style="margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><span lang=EN-US style="font-size: 10.5pt; color: black"><font face=宋体>#ifdef LANGUAGE_01<o:P></O:P></font></span></div>
<div style="margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><span lang=EN-US style="font-size: 10.5pt; color: black"><font face=宋体>＃i nclude “MyApp<?XML:NAMESPACE PREFIX = ST1 /><st1:CHMETCNV UnitName="”" SourceValue=".101" HasSpace="False" Negative="False" NumberType="1" TCSC="0" w:st="on">.101”</ST1:CHMETCNV><o:P></O:P></font></span></div>
<div style="margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><span lang=EN-US style="font-size: 10.5pt; color: black"><font face=宋体>#endif<o:P></O:P></font></span></div>
<div style="margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><span lang=EN-US style="font-size: 10.5pt; color: black"><font face=宋体>#ifdef LANGUAGE_02<o:P></O:P></font></span></div>
<div style="margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><span lang=EN-US style="font-size: 10.5pt; color: black"><font face=宋体>＃i nclude “MyApp.l<st1:CHMETCNV UnitName="”" SourceValue="2" HasSpace="False" Negative="False" NumberType="1" TCSC="0" w:st="on">02”</ST1:CHMETCNV><o:P></O:P></font></span></div>
<div style="margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><span lang=EN-US style="font-size: 10.5pt; color: black"><font face=宋体>#endif<o:P></O:P></font></span></div>
<div style="margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><span style="font-size: 10.5pt; color: black"><font face=宋体>最后，<span lang=EN-US>.101</span>和<span lang=EN-US>.102</span>文件以各自的语言定义字符串，比如：<span lang=EN-US><o:P></O:P></span></font></span></div>
<div style="margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><span lang=EN-US style="font-size: 10.5pt; color: black"><font face=宋体>#define&nbsp; STR_HELL0&nbsp;&nbsp; “Hello World”<o:P></O:P></font></span></div>
<div style="margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><span style="font-size: 10.5pt; color: black"><font face=宋体>为了确保编译资源时将使用正确的字符串，应该在<span lang=EN-US>.mmp</span>文件中包含一行或多行<span lang=EN-US>LANG</span>语句，导致生成两个二进制资源文件：<span lang=EN-US>.r01</span>和<span lang=EN-US>.r02</span>。<span lang=EN-US><o:P></O:P></span></font></span></div>
<div style="margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><span lang=EN-US style="font-size: 10.5pt; color: black"><font face=宋体>LANG 01<o:P></O:P></font></span></div>
<div style="margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><span lang=EN-US style="font-size: 10.5pt; color: black"><font face=宋体>LANG 02<o:P></O:P></font></span></div>
<div style="margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><span style="font-size: 10.5pt; color: black"><font face=宋体>（<span lang=EN-US>2</span>）标点：介绍如何使用标点符号<span lang=EN-US><o:P></O:P></span></font></span></div>
<div style="margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><font face=宋体><span lang=EN-US style="font-size: 10.5pt; color: black">a</span><span style="font-size: 10.5pt; color: black">、所有赋值语句之后都应该有分号<span lang=EN-US><o:P></O:P></span></span></font></div>
<div style="margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><font face=宋体><span lang=EN-US style="font-size: 10.5pt; color: black">b</span><span style="font-size: 10.5pt; color: black">、列表中的元素以逗号分隔<span lang=EN-US><o:P></O:P></span></span></font></div>
<div style="margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><font face=宋体><span lang=EN-US style="font-size: 10.5pt; color: black">c</span><span style="font-size: 10.5pt; color: black">、资源定义后以及列表中最后一个元素之后不应有分号<span lang=EN-US><o:P></O:P></span></span></font></div>
<div style="margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><span style="font-size: 10.5pt; color: black"><font face=宋体>举例：<span lang=EN-US><o:P></O:P></span></font></span></div>
<div style="margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><span lang=EN-US style="font-size: 10.5pt; color: black"><font face=宋体>RESOURCE AVKON_VIEW r_myapp_view<o:P></O:P></font></span></div>
<div style="margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><span lang=EN-US style="font-size: 10.5pt; color: black"><font face=宋体>{<o:P></O:P></font></span></div>
<div style="margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><font face=宋体><span lang=EN-US style="font-size: 10.5pt; color: black"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </span>menubar=r_myapp_menubar;//</span><span style="font-size: 10.5pt; color: black">赋值语句后有分号<span lang=EN-US><o:P></O:P></span></span></font></div>
<div style="margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><font face=宋体><span lang=EN-US style="font-size: 10.5pt; color: black"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </span>cba=r_myapp_cba;//</span><span style="font-size: 10.5pt; color: black">赋值，需要分号<span lang=EN-US><o:P></O:P></span></span></font></div>
<div style="margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><font face=宋体><span lang=EN-US style="font-size: 10.5pt; color: black">}<span style="mso-spacerun: yes">&nbsp; </span>//</span><span style="font-size: 10.5pt; color: black">资源定义结尾，无需分号<span lang=EN-US><o:P></O:P></span></span></font></div>
<div style="margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><span lang=EN-US style="font-size: 10.5pt; color: black"><font face=宋体>…<o:P></O:P></font></span></div>
<div style="margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><span lang=EN-US style="font-size: 10.5pt; color: black"><font face=宋体>RESOURCE TAB_GROUP r_myapp_tabgroup<o:P></O:P></font></span></div>
<div style="margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><span lang=EN-US style="font-size: 10.5pt; color: black"><font face=宋体>{<o:P></O:P></font></span></div>
<div style="margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><span lang=EN-US style="font-size: 10.5pt; color: black"><font face=宋体>&nbsp;&nbsp;&nbsp; tab_width=EaknTabWidthWithTwoTabs;<o:P></O:P></font></span></div>
<div style="margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><span lang=EN-US style="font-size: 10.5pt; color: black"><font face=宋体>&nbsp;&nbsp;&nbsp;&nbsp;active = 0;<o:P></O:P></font></span></div>
<div style="margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><span lang=EN-US style="font-size: 10.5pt; color: black"><font face=宋体>&nbsp;&nbsp;&nbsp;&nbsp;tabs = <o:P></O:P></font></span></div>
<div style="margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><span lang=EN-US style="font-size: 10.5pt; color: black"><font face=宋体><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>{<o:P></O:P></font></span></div>
<div style="margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><font face=宋体><span lang=EN-US style="font-size: 10.5pt; color: black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;TAB&nbsp;&nbsp; //</span><span style="font-size: 10.5pt; color: black">列表中的第一个<span lang=EN-US>TAB STRUCT<o:P></O:P></span></span></font></div>
<div style="margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><span lang=EN-US style="font-size: 10.5pt; color: black"><font face=宋体><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>{<o:P></O:P></font></span></div>
<div style="margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><span lang=EN-US style="font-size: 10.5pt; color: black"><font face=宋体>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>&nbsp; id = EnavigationPaneTab1;<o:P></O:P></font></span></div>
<div style="margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><span lang=EN-US style="font-size: 10.5pt; color: black"><font face=宋体>&nbsp;&nbsp;&nbsp;&nbsp;<span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; txt = TAB1_TEXT;<o:P></O:P></font></span></div>
<div style="margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><font face=宋体><span lang=EN-US style="font-size: 10.5pt; color: black"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>},&nbsp;&nbsp; //</span><span style="font-size: 10.5pt; color: black">列表元素之间用逗号分隔<span lang=EN-US><o:P></O:P></span></span></font></div>
<div style="margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><span lang=EN-US style="font-size: 10.5pt; color: black"><font face=宋体><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="mso-spacerun: yes">&nbsp;&nbsp;</span>TAB<o:P></O:P></font></span></div>
<div style="margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><span lang=EN-US style="font-size: 10.5pt; color: black"><font face=宋体><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>{<o:P></O:P></font></span></div>
<div style="margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><span lang=EN-US style="font-size: 10.5pt; color: black"><font face=宋体>&nbsp;&nbsp;&nbsp;&nbsp;<span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>id = EnavigationPaneTab2;<o:P></O:P></font></span></div>
<div style="margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><span lang=EN-US style="font-size: 10.5pt; color: black"><font face=宋体>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>txt = TAB2_TEXT;<o:P></O:P></font></span></div>
<div style="margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><font face=宋体><span lang=EN-US style="font-size: 10.5pt; color: black"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>}&nbsp;&nbsp; //</span><span style="font-size: 10.5pt; color: black">列表结尾无需分号<span lang=EN-US><o:P></O:P></span></span></font></div>
<div style="margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><font face=宋体><span lang=EN-US style="font-size: 10.5pt; color: black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; };&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //</span><span style="font-size: 10.5pt; color: black">将列表赋值给<span lang=EN-US>tabs</span>，需要分号。<span lang=EN-US><o:P></O:P></span></span></font></div>
<div style="margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><span lang=EN-US style="font-size: 10.5pt; color: black"><font face=宋体>}<o:P></O:P></font></span></div>
<div style="margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><span style="font-size: 10.5pt; color: black"><font face=宋体>（<span lang=EN-US>3</span>）创建资源结构：<span lang=EN-US><o:P></O:P></span></font></span></div>
<div style="margin: 0cm 0cm 0pt; text-indent: 21.1pt; mso-char-indent-count: 2.0"><font face=宋体><strong style="mso-bidi-font-weight: normal"><span lang=EN-US style="font-size: 10.5pt; color: black">RESOURCE</span></strong><strong style="mso-bidi-font-weight: normal"><span style="font-size: 10.5pt; color: black">语句用于创建特定资源的实例，而<span lang=EN-US>STRUCT</span>语句则用于定义资源类型，创建的所有<span lang=EN-US>STRUCT</span>定义都应该保存在一个扩展名为<span lang=EN-US>.rh</span>的文件中</span></strong><span style="font-size: 10.5pt; color: black">。（从这里显然我们可以试着去打开<span lang=EN-US>eikon.rh</span>、<span lang=EN-US>uikon.rh</span>、<span lang=EN-US>avkon.rh</span>文件看看，里面是否都是<span lang=EN-US>STRUCT</span>打头的资源类型定义）<span lang=EN-US><o:P></O:P></span></span></font></div>
<div style="margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><span style="font-size: 10.5pt; color: black"><font face=宋体>常用<span lang=EN-US>STRUCT</span>字段类型见资源文件<span lang=EN-US>STRUCT</span>字段类型表。，除简单字段外，还可以把字段定义为一个由相同类型的值组成的数组，在字段名后添加一对方括号即可。如：<span lang=EN-US><o:P></O:P></span></font></span></div>
<div style="background: #cccccc; margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><span lang=EN-US style="font-size: 10.5pt; color: black"><font face=宋体>STRUCT MENU_PANE<o:P></O:P></font></span></div>
<div style="background: #cccccc; margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><span lang=EN-US style="font-size: 10.5pt; color: black"><font face=宋体>{<o:P></O:P></font></span></div>
<div style="background: #cccccc; margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><span lang=EN-US style="font-size: 10.5pt; color: black"><font face=宋体>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; STRUCT items[ ];<o:P></O:P></font></span></div>
<div style="background: #cccccc; margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><span lang=EN-US style="font-size: 10.5pt; color: black"><font face=宋体>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LLINK extension=0;<o:P></O:P></font></span></div>
<div style="background: #cccccc; margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><span lang=EN-US style="font-size: 10.5pt; color: black"><font face=宋体>}<o:P></O:P></font></span></div>
<div style="margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><span lang=EN-US style="font-size: 10.5pt; color: black"><o:P><font face=宋体>&nbsp;</font></O:P></span></div>
<div style="margin: 0cm 0cm 0pt; text-indent: 21pt; text-align: center; mso-char-indent-count: 2.0" align="center"><span style="font-size: 10.5pt; color: black"><font face=宋体>常用资源字段类型<span lang=EN-US><o:P></O:P></span></font></span></div>
<div>
<table class=MsoTableGrid style="border-right: medium none; border-top: medium none; margin: auto auto auto 23.4pt; border-left: medium none; width: 387pt; border-bottom: medium none; border-collapse: collapse; mso-border-alt: solid windowtext .5pt; mso-yfti-tbllook: 480; mso-padding-alt: 0cm 5.4pt 0cm 5.4pt; mso-border-insideh: .5pt solid windowtext; mso-border-insidev: .5pt solid windowtext" cellspacing="0" cellpadding="0" width="516" border="1">
<tbody>
<tr style="mso-yfti-irow: 0; mso-yfti-firstrow: yes">
<td style="border-right: windowtext 1pt solid; padding-right: 5.4pt; border-top: windowtext 1pt solid; padding-left: 5.4pt; padding-bottom: 0cm; border-left: windowtext 1pt solid; width: 95.4pt; padding-top: 0cm; border-bottom: windowtext 1pt solid; background-color: transparent; mso-border-alt: solid windowtext .5pt" vAlign=top width="127">
<div style="margin: 0cm 0cm 0pt; text-align: center" align="center"><span style="font-size: 10.5pt; color: black"><font face=宋体>字段类型<span lang=EN-US><o:P></O:P></span></font></span></div></td>
<td style="border-right: windowtext 1pt solid; padding-right: 5.4pt; border-top: windowtext 1pt solid; padding-left: 5.4pt; border-left-color: #ece9d8; padding-bottom: 0cm; width: 291.6pt; padding-top: 0cm; border-bottom: windowtext 1pt solid; background-color: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt" vAlign=top width="389">
<div style="margin: 0cm 0cm 0pt; text-align: center" align="center"><span style="font-size: 10.5pt; color: black"><font face=宋体>说明<span lang=EN-US><o:P></O:P></span></font></span></div></td></tr>
<tr style="mso-yfti-irow: 1">
<td style="border-right: windowtext 1pt solid; padding-right: 5.4pt; padding-left: 5.4pt; padding-bottom: 0cm; border-left: windowtext 1pt solid; width: 95.4pt; border-top-color: #ece9d8; padding-top: 0cm; border-bottom: windowtext 1pt solid; background-color: transparent; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width="127">
<div style="margin: 0cm 0cm 0pt; text-align: center" align="center"><span lang=EN-US style="font-size: 10.5pt; color: black"><font face=宋体>BYTE<o:P></O:P></font></span></div></td>
<td style="border-right: windowtext 1pt solid; padding-right: 5.4pt; padding-left: 5.4pt; border-left-color: #ece9d8; padding-bottom: 0cm; width: 291.6pt; border-top-color: #ece9d8; padding-top: 0cm; border-bottom: windowtext 1pt solid; background-color: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width="389">
<div style="margin: 0cm 0cm 0pt; text-align: center" align="center"><span style="font-size: 10.5pt; color: black"><font face=宋体>单字节，解释为一个有符号或无符号整数<span lang=EN-US><o:P></O:P></span></font></span></div></td></tr>
<tr style="mso-yfti-irow: 2">
<td style="border-right: windowtext 1pt solid; padding-right: 5.4pt; padding-left: 5.4pt; padding-bottom: 0cm; border-left: windowtext 1pt solid; width: 95.4pt; border-top-color: #ece9d8; padding-top: 0cm; border-bottom: windowtext 1pt solid; background-color: transparent; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width="127">
<div style="margin: 0cm 0cm 0pt; text-align: center" align="center"><span lang=EN-US style="font-size: 10.5pt; color: black"><font face=宋体>WORD<o:P></O:P></font></span></div></td>
<td style="border-right: windowtext 1pt solid; padding-right: 5.4pt; padding-left: 5.4pt; border-left-color: #ece9d8; padding-bottom: 0cm; width: 291.6pt; border-top-color: #ece9d8; padding-top: 0cm; border-bottom: windowtext 1pt solid; background-color: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width="389">
<div style="margin: 0cm 0cm 0pt; text-align: center" align="center"><span style="font-size: 10.5pt; color: black"><font face=宋体>双字节，解释为一个有符号或无符号整数<span lang=EN-US><o:P></O:P></span></font></span></div></td></tr>
<tr style="mso-yfti-irow: 3">
<td style="border-right: windowtext 1pt solid; padding-right: 5.4pt; padding-left: 5.4pt; padding-bottom: 0cm; border-left: windowtext 1pt solid; width: 95.4pt; border-top-color: #ece9d8; padding-top: 0cm; border-bottom: windowtext 1pt solid; background-color: transparent; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width="127">
<div style="margin: 0cm 0cm 0pt; text-align: center" align="center"><span lang=EN-US style="font-size: 10.5pt; color: black"><font face=宋体>LONG<o:P></O:P></font></span></div></td>
<td style="border-right: windowtext 1pt solid; padding-right: 5.4pt; padding-left: 5.4pt; border-left-color: #ece9d8; padding-bottom: 0cm; width: 291.6pt; border-top-color: #ece9d8; padding-top: 0cm; border-bottom: windowtext 1pt solid; background-color: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width="389">
<div style="margin: 0cm 0cm 0pt; text-align: center" align="center"><span style="font-size: 10.5pt; color: black"><font face=宋体>四字节，解释为一个有符号或无符号整数<span lang=EN-US><o:P></O:P></span></font></span></div></td></tr>
<tr style="mso-yfti-irow: 4">
<td style="border-right: windowtext 1pt solid; padding-right: 5.4pt; padding-left: 5.4pt; padding-bottom: 0cm; border-left: windowtext 1pt solid; width: 95.4pt; border-top-color: #ece9d8; padding-top: 0cm; border-bottom: windowtext 1pt solid; background-color: transparent; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width="127">
<div style="margin: 0cm 0cm 0pt; text-align: center" align="center"><span lang=EN-US style="font-size: 10.5pt; color: black"><font face=宋体>DOUBLE<o:P></O:P></font></span></div></td>
<td style="border-right: windowtext 1pt solid; padding-right: 5.4pt; padding-left: 5.4pt; border-left-color: #ece9d8; padding-bottom: 0cm; width: 291.6pt; border-top-color: #ece9d8; padding-top: 0cm; border-bottom: windowtext 1pt solid; background-color: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width="389">
<div style="margin: 0cm 0cm 0pt; text-align: center" align="center"><span style="font-size: 10.5pt; color: black"><font face=宋体>八字节，表示一个双精度浮点数<span lang=EN-US><o:P></O:P></span></font></span></div></td></tr>
<tr style="mso-yfti-irow: 5">
<td style="border-right: windowtext 1pt solid; padding-right: 5.4pt; padding-left: 5.4pt; padding-bottom: 0cm; border-left: windowtext 1pt solid; width: 95.4pt; border-top-color: #ece9d8; padding-top: 0cm; border-bottom: windowtext 1pt solid; background-color: transparent; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width="127">
<div style="margin: 0cm 0cm 0pt; text-align: center" align="center"><span lang=EN-US style="font-size: 10.5pt; color: black"><font face=宋体>TEXT<o:P></O:P></font></span></div></td>
<td style="border-right: windowtext 1pt solid; padding-right: 5.4pt; padding-left: 5.4pt; border-left-color: #ece9d8; padding-bottom: 0cm; width: 291.6pt; border-top-color: #ece9d8; padding-top: 0cm; border-bottom: windowtext 1pt solid; background-color: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width="389">
<div style="margin: 0cm 0cm 0pt; text-align: center" align="center"><span style="font-size: 10.5pt; color: black"><font face=宋体>以<span lang=EN-US>NULL</span>结尾的字符串，已废弃，建议使用<span lang=EN-US>LTEXT<o:P></O:P></span></font></span></div></td></tr>
<tr style="mso-yfti-irow: 6">
<td style="border-right: windowtext 1pt solid; padding-right: 5.4pt; padding-left: 5.4pt; padding-bottom: 0cm; border-left: windowtext 1pt solid; width: 95.4pt; border-top-color: #ece9d8; padding-top: 0cm; border-bottom: windowtext 1pt solid; background-color: transparent; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width="127">
<div style="margin: 0cm 0cm 0pt; text-align: center" align="center"><span lang=EN-US style="font-size: 10.5pt; color: black"><font face=宋体>LTEXT<o:P></O:P></font></span></div></td>
<td style="border-right: windowtext 1pt solid; padding-right: 5.4pt; padding-left: 5.4pt; border-left-color: #ece9d8; padding-bottom: 0cm; width: 291.6pt; border-top-color: #ece9d8; padding-top: 0cm; border-bottom: windowtext 1pt solid; background-color: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width="389">
<div style="margin: 0cm 0cm 0pt; text-align: center" align="center"><font face=宋体><span lang=EN-US style="font-size: 10.5pt; color: black">Unicode</span><span style="font-size: 10.5pt; color: black">字符串，带有一个前导字节保存长度，没有终止<span lang=EN-US>NULL<o:P></O:P></span></span></font></div></td></tr>
<tr style="mso-yfti-irow: 7">
<td style="border-right: windowtext 1pt solid; padding-right: 5.4pt; padding-left: 5.4pt; padding-bottom: 0cm; border-left: windowtext 1pt solid; width: 95.4pt; border-top-color: #ece9d8; padding-top: 0cm; border-bottom: windowtext 1pt solid; background-color: transparent; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width="127">
<div style="margin: 0cm 0cm 0pt; text-align: center" align="center"><span lang=EN-US style="font-size: 10.5pt; color: black"><font face=宋体>BUF<o:P></O:P></font></span></div></td>
<td style="border-right: windowtext 1pt solid; padding-right: 5.4pt; padding-left: 5.4pt; border-left-color: #ece9d8; padding-bottom: 0cm; width: 291.6pt; border-top-color: #ece9d8; padding-top: 0cm; border-bottom: windowtext 1pt solid; background-color: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width="389">
<div style="margin: 0cm 0cm 0pt; text-align: center" align="center"><font face=宋体><span lang=EN-US style="font-size: 10.5pt; color: black">Unicode</span><span style="font-size: 10.5pt; color: black">字符串，没有前导字节，没有终止<span lang=EN-US>NULL<o:P></O:P></span></span></font></div></td></tr>
<tr style="mso-yfti-irow: 8">
<td style="border-right: windowtext 1pt solid; padding-right: 5.4pt; padding-left: 5.4pt; padding-bottom: 0cm; border-left: windowtext 1pt solid; width: 95.4pt; border-top-color: #ece9d8; padding-top: 0cm; border-bottom: windowtext 1pt solid; background-color: transparent; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width="127">
<div style="margin: 0cm 0cm 0pt; text-align: center" align="center"><span lang=EN-US style="font-size: 10.5pt; color: black"><font face=宋体>BUF8<o:P></O:P></font></span></div></td>
<td style="border-right: windowtext 1pt solid; padding-right: 5.4pt; padding-left: 5.4pt; border-left-color: #ece9d8; padding-bottom: 0cm; width: 291.6pt; border-top-color: #ece9d8; padding-top: 0cm; border-bottom: windowtext 1pt solid; background-color: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width="389">
<div style="margin: 0cm 0cm 0pt; text-align: center" align="center"><font face=宋体><span lang=EN-US style="font-size: 10.5pt; color: black">8</span><span style="font-size: 10.5pt; color: black">位字符组成的字符串，没前导和终止，用于放入<span lang=EN-US>8</span>位数据<span lang=EN-US><o:P></O:P></span></span></font></div></td></tr>
<tr style="mso-yfti-irow: 9">
<td style="border-right: windowtext 1pt solid; padding-right: 5.4pt; padding-left: 5.4pt; padding-bottom: 0cm; border-left: windowtext 1pt solid; width: 95.4pt; border-top-color: #ece9d8; padding-top: 0cm; border-bottom: windowtext 1pt solid; background-color: transparent; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width="127">
<div style="margin: 0cm 0cm 0pt; text-align: center" align="center"><span lang=EN-US style="font-size: 10.5pt; color: black"><font face=宋体>BUF&lt;n&gt;<o:P></O:P></font></span></div></td>
<td style="border-right: windowtext 1pt solid; padding-right: 5.4pt; padding-left: 5.4pt; border-left-color: #ece9d8; padding-bottom: 0cm; width: 291.6pt; border-top-color: #ece9d8; padding-top: 0cm; border-bottom: windowtext 1pt solid; background-color: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width="389">
<div style="margin: 0cm 0cm 0pt; text-align: center" align="center"><span style="font-size: 10.5pt; color: black"><font face=宋体>最大长度为<span lang=EN-US>n</span>的<span lang=EN-US>Unicode</span>字符串，没有前导和终止<span lang=EN-US><o:P></O:P></span></font></span></div></td></tr>
<tr style="mso-yfti-irow: 10">
<td style="border-right: windowtext 1pt solid; padding-right: 5.4pt; padding-left: 5.4pt; padding-bottom: 0cm; border-left: windowtext 1pt solid; width: 95.4pt; border-top-color: #ece9d8; padding-top: 0cm; border-bottom: windowtext 1pt solid; background-color: transparent; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width="127">
<div style="margin: 0cm 0cm 0pt; text-align: center" align="center"><span lang=EN-US style="font-size: 10.5pt; color: black"><font face=宋体>LINK<o:P></O:P></font></span></div></td>
<td style="border-right: windowtext 1pt solid; padding-right: 5.4pt; padding-left: 5.4pt; border-left-color: #ece9d8; padding-bottom: 0cm; width: 291.6pt; border-top-color: #ece9d8; padding-top: 0cm; border-bottom: windowtext 1pt solid; background-color: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width="389">
<div style="margin: 0cm 0cm 0pt; text-align: center" align="center"><span style="font-size: 10.5pt; color: black"><font face=宋体>另一个资源的<span lang=EN-US>16</span>位<span lang=EN-US>ID</span>，类似于拥有指定资源的一个引用<span lang=EN-US><o:P></O:P></span></font></span></div></td></tr>
<tr style="mso-yfti-irow: 11">
<td style="border-right: windowtext 1pt solid; padding-right: 5.4pt; padding-left: 5.4pt; padding-bottom: 0cm; border-left: windowtext 1pt solid; width: 95.4pt; border-top-color: #ece9d8; padding-top: 0cm; border-bottom: windowtext 1pt solid; background-color: transparent; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width="127">
<div style="margin: 0cm 0cm 0pt; text-align: center" align="center"><span lang=EN-US style="font-size: 10.5pt; color: black"><font face=宋体>LLINK<o:P></O:P></font></span></div></td>
<td style="border-right: windowtext 1pt solid; padding-right: 5.4pt; padding-left: 5.4pt; border-left-color: #ece9d8; padding-bottom: 0cm; width: 291.6pt; border-top-color: #ece9d8; padding-top: 0cm; border-bottom: windowtext 1pt solid; background-color: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width="389">
<div style="margin: 0cm 0cm 0pt; text-align: center" align="center"><span style="font-size: 10.5pt; color: black"><font face=宋体>另一个资源的<span lang=EN-US>32</span>位<span lang=EN-US>ID<o:P></O:P></span></font></span></div></td></tr>
<tr style="mso-yfti-irow: 12">
<td style="border-right: windowtext 1pt solid; padding-right: 5.4pt; padding-left: 5.4pt; padding-bottom: 0cm; border-left: windowtext 1pt solid; width: 95.4pt; border-top-color: #ece9d8; padding-top: 0cm; border-bottom: windowtext 1pt solid; background-color: transparent; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width="127">
<div style="margin: 0cm 0cm 0pt; text-align: center" align="center"><span lang=EN-US style="font-size: 10.5pt; color: black"><font face=宋体>SRLINK<o:P></O:P></font></span></div></td>
<td style="border-right: windowtext 1pt solid; padding-right: 5.4pt; padding-left: 5.4pt; border-left-color: #ece9d8; padding-bottom: 0cm; width: 291.6pt; border-top-color: #ece9d8; padding-top: 0cm; border-bottom: windowtext 1pt solid; background-color: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width="389">
<div style="margin: 0cm 0cm 0pt; text-align: center" align="center"><span style="font-size: 10.5pt; color: black"><font face=宋体>自引用<span lang=EN-US>LINK</span>，该类型字段值由资源编译器自动分配，不能自行提供初始化值，是一个<span lang=EN-US>32</span>位<span lang=EN-US>ID<o:P></O:P></span></font></span></div></td></tr>
<tr style="mso-yfti-irow: 13; mso-yfti-lastrow: yes">
<td style="border-right: windowtext 1pt solid; padding-right: 5.4pt; padding-left: 5.4pt; padding-bottom: 0cm; border-left: windowtext 1pt solid; width: 95.4pt; border-top-color: #ece9d8; padding-top: 0cm; border-bottom: windowtext 1pt solid; background-color: transparent; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width="127">
<div style="margin: 0cm 0cm 0pt; text-align: center" align="center"><span lang=EN-US style="font-size: 10.5pt; color: black"><font face=宋体>STRUCT<o:P></O:P></font></span></div></td>
<td style="border-right: windowtext 1pt solid; padding-right: 5.4pt; padding-left: 5.4pt; border-left-color: #ece9d8; padding-bottom: 0cm; width: 291.6pt; border-top-color: #ece9d8; padding-top: 0cm; border-bottom: windowtext 1pt solid; background-color: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width="389">
<div style="margin: 0cm 0cm 0pt; text-align: center" align="center"><span style="font-size: 10.5pt; color: black"><font face=宋体>结构，创建本身就是<span lang=EN-US>STRUCT</span>的字段，使用它可以把<span lang=EN-US>STRUCT</span>嵌入到<span lang=EN-US>STRUCT</span>中<span lang=EN-US><o:P></O:P></span></font></span></div></td></tr></tbody></table></div>
<div style="margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><font face=宋体><span lang=EN-US style="font-size: 10.5pt; color: black">STRUCT</span><span style="font-size: 10.5pt; color: black">的类型名字必须都大写，不能含有空格，且以字母字符开始；在具体每个字段的定义时，依次由字段类型、字段名、可选初始值和一个分号组成。类型必须全部大写，字段名必须小写，如果提供默认值，则在资源定义中使用此类型资源结构是可以省略该字段，此时将使用默认值。<span lang=EN-US><o:P></O:P></span></span></font></div>
<div style="margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><span lang=EN-US style="font-size: 10.5pt; color: black"><o:P><font face=宋体>&nbsp;</font></O:P></span></div>
<div style="margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><span style="font-size: 10.5pt; color: black"><font face=宋体>三、与资源文件有关的系统头文件及其他文件：<span lang=EN-US><o:P></O:P></span></font></span></div>
<div style="margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><span style="font-size: 10.5pt; color: black"><font face=宋体>如上提到的与资源文件相关的<span lang=EN-US>*.rh</span>、<span lang=EN-US>*.loc</span>和<span lang=EN-US>*.*.rsg</span>之外，在资源文件中，往往还会引入其它诸如<span lang=EN-US>*.hrh</span>和<span lang=EN-US>*.mbg</span>文件，由于这是本人第一篇关于<span lang=EN-US>Symbian</span>的小结，所以在这里借资源文件的解析顺带将其它文件也小结一下：<span lang=EN-US><o:P></O:P></span></font></span></div>
<div style="margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><font face=宋体><span lang=EN-US style="font-size: 10.5pt; color: black">*.h</span><span style="font-size: 10.5pt; color: black">和<span lang=EN-US>*.cpp</span>是最基础的<span lang=EN-US>C++</span>头文件和<span lang=EN-US>C++</span>源文件（这个不用做介绍都知道）；<span lang=EN-US><o:P></O:P></span></span></font></div>
<div style="margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><font face=宋体><span lang=EN-US style="font-size: 10.5pt; color: black">*.rss</span><span style="font-size: 10.5pt; color: black">是<span lang=EN-US>Symbian</span>的资源源文件，主要定义资源实例，具体定义了应用程序<span lang=EN-US>UI</span>所需所有字符串、按键、菜单和列表等等控件资源，在<span lang=EN-US>Series 60</span>以后，将字符串的具体定义放在了<span lang=EN-US>*.loc</span>文件中，更有益于<span lang=EN-US>UI</span>本地化和国际化，另据文档说明，<span lang=EN-US>*.rss</span>可以扩展为<span lang=EN-US>*.r??</span>用于多国语言版本；<span lang=EN-US><o:P></O:P></span></span></font></div>
<div style="margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><font face=宋体><span lang=EN-US style="font-size: 10.5pt; color: black">*.rh</span><span style="font-size: 10.5pt; color: black">是<span lang=EN-US>Symbian</span>的资源头文件，负责资源结构类型的定义，除了预处理语句外就是<span lang=EN-US>STRUCT</span>语句，它只能被资源源文件包含；<span lang=EN-US><o:P></O:P></span></span></font></div>
<div style="margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><font face=宋体><span lang=EN-US style="font-size: 10.5pt; color: black">*.hrh</span><span style="font-size: 10.5pt; color: black">是可以被<span lang=EN-US>C++</span>文件（包括头文件和源文件）和<span lang=EN-US>Symbian</span>资源文件（包括<span lang=EN-US>*.rss</span>和<span lang=EN-US>*.rh</span>）包含的头文件，其内基本是预处理语句和<span lang=EN-US>enum</span>枚举语句，这些枚举语句往往是菜单、工具条等的命令索引值，在<span lang=EN-US>switch</span>…<span lang=EN-US>case</span>语句中使用；<span lang=EN-US><o:P></O:P></span></span></font></div>
<div style="margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><font face=宋体><span lang=EN-US style="font-size: 10.5pt; color: black">*.rsc</span><span style="font-size: 10.5pt; color: black">文件是<span lang=EN-US>*.rss</span>文件编译生成的资源（二进制）文件，在资源源文件编译过程中还会产生<span lang=EN-US>*.rsg</span>文件，该文件内是<span lang=EN-US>*.rss</span>资源源文件中资源的<span lang=EN-US>ID</span>值，<span lang=EN-US>C++</span>源文件包含它后可以通过资源<span lang=EN-US>ID</span>直接装载资源。<span lang=EN-US><o:P></O:P></span></span></font></div>
<div style="margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><span style="font-size: 10.5pt; color: black"><font face=宋体>与资源相关的还有<span lang=EN-US>*.mbg</span>文件，它和<span lang=EN-US>*.rsg</span>一样是编译生成的<span lang=EN-US>ID</span>文件，具体实现通常在<span lang=EN-US>*.mmp</span>（后面介绍）文件中将各种<span lang=EN-US>Window bmp</span>位图包含进来，通过编译生成<span lang=EN-US>*.mbm</span>的过程中产生（该过程可能调用了<span lang=EN-US>aifbuilder</span>这一图标设计工具）。而<span lang=EN-US>*.mbm</span>是<span lang=EN-US>Symbian</span>系统的图像文件。在这里只要对照<span lang=EN-US>rsc</span>文件的过程就行，只不过<span lang=EN-US>mbm</span>是<span lang=EN-US>UI</span>的图形和图像资源。（这里至于换肤和<span lang=EN-US>aifbuilder</span>的一些东西，我还不是很清楚，为此没做展开）<span lang=EN-US><o:P></O:P></span></font></span></div>
<div style="margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><font face=宋体><span lang=EN-US style="font-size: 10.5pt; color: black">*.inl</span><span style="font-size: 10.5pt; color: black">文件是内联函数的源文件，通常内联函数在<span lang=EN-US>C++</span>头文件中实现，但有时为了考虑将其实现与头文件分离，故意在另一文件中实现，通常它在声明内联函数的头文件的末尾被＃<span lang=EN-US>include</span>语句包含进来。<span lang=EN-US><o:P></O:P></span></span></font></div>
<div style="margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><font face=宋体><span lang=EN-US style="font-size: 10.5pt; color: red">*.pan</span><span style="font-size: 10.5pt; color: red">文件是为应用程序创建一份应急代码，字面意思应急代码在开发过程中显示程序的错误用的，但是具体我也没有用到过，所以也不知道如何解释更好些。<span lang=EN-US><o:P></O:P></span></span></font></div>
<div style="margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><font face=宋体><span lang=EN-US style="font-size: 10.5pt; color: red">*.aif</span><span style="font-size: 10.5pt; color: red">的文件，查到说是<span lang=EN-US>Symbian</span>系统的应用程序信息文件，<span lang=EN-US>Aif</span>文件的主要作用是在目标设备的菜单中显示图标</span><span style="font-size: 10.5pt; color: black">，</span><span style="font-size: 10.5pt; color: red">由专门的<span lang=EN-US>aiftool</span>应用程序产生，也跟本地化有关。<span lang=EN-US><o:P></O:P></span></span></font></div>
<div style="margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><span lang=EN-US style="font-size: 10.5pt; color: red"><o:P><font face=宋体>&nbsp;</font></O:P></span></div>
<div style="margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><span style="font-size: 10.5pt; color: black"><font face=宋体>构建文件<span lang=EN-US>*.mmp</span>是为控制台应用程序<span lang=EN-US>abld</span>准备的项目定义文件，其功能类似<span lang=EN-US>makefile</span>，但是它可能比<span lang=EN-US>makefile</span>还复杂，因为<span lang=EN-US>Symbian</span>构建工具在<span lang=EN-US>mmp</span>文件基础上才能产生<span lang=EN-US>makefile</span>文件，具体项目定义文件的格式后面再另作解析。<span lang=EN-US><o:P></O:P></span></font></span></div>
<div style="margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><span style="font-size: 10.5pt; color: black"><font face=宋体>构建文件<span lang=EN-US>bld.inf</span>是构建时的信息文件，通常其内只有一个<span lang=EN-US>*.mmp</span>用于指向要编译的项目定义文件，但是也可以包含多个<span lang=EN-US>*.mmp</span>，具体多个时我试过，只要路径设置正确就可以实现。<span lang=EN-US><o:P></O:P></span></font></span></div>
<div style="margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><span style="font-size: 10.5pt; color: black"><font face=宋体>根据不同的构建目的，执行<span lang=EN-US>abld</span>命令将产生各种不同的目标文件，具体由：<span lang=EN-US>*.app</span>（<span lang=EN-US>Symbian</span>的系统执行文件相当于<span lang=EN-US>Windows</span>的<span lang=EN-US>exe</span>文件，它是多态的<span lang=EN-US>DLL</span>）、<span lang=EN-US>*.dll</span>（共享的<span lang=EN-US>dll</span>文件）、<span lang=EN-US>*.exe</span>（<span lang=EN-US>Symbian</span>系统服务或可执行文件，我将其理解为控制台程序，不知道是否正确，该文件在<span lang=EN-US>Window</span>上装有模拟器情况下可以自动运行模拟器）。<span lang=EN-US><o:P></O:P></span></font></span></div>
<div style="margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><span style="font-size: 10.5pt; color: black"><font face=宋体>打包文件<span lang=EN-US>*.pkg</span>文件，该文件是为控制台应用程序<span lang=EN-US>makesis</span>准备用来生成<span lang=EN-US>*.sis</span>手机安装文件的的定义文件，其语法比较简单，在这里不做展开。<span lang=EN-US><o:P></O:P></span></font></span></div>
<div style="margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><span lang=EN-US style="font-size: 10.5pt; color: black"><o:P><font face=宋体>&nbsp;</font></O:P></span></div>
<div style="margin: 0cm 0cm 0pt; text-indent: 21pt; mso-char-indent-count: 2.0"><span style="font-size: 10.5pt; color: black"><font face=宋体>既然对文件已经做了如上分析，那么顺其自然对常见的文件目录也用下表列出做下简单描述<span lang=EN-US><o:P></O:P></span></font></span></div>
<div>
<table class=MsoTableGrid style="border-right: medium none; border-top: medium none; border-left: medium none; border-bottom: medium none; border-collapse: collapse; mso-border-alt: solid windowtext .5pt; mso-yfti-tbllook: 480; mso-padding-alt: 0cm 5.4pt 0cm 5.4pt; mso-border-insideh: .5pt solid windowtext; mso-border-insidev: .5pt solid windowtext" cellspacing="0" cellpadding="0" border="1">
<tbody>
<tr style="mso-yfti-irow: 0; mso-yfti-firstrow: yes">
<td style="border-right: windowtext 1pt solid; padding-right: 5.4pt; border-top: windowtext 1pt solid; padding-left: 5.4pt; padding-bottom: 0cm; border-left: windowtext 1pt solid; width: 77.4pt; padding-top: 0cm; border-bottom: windowtext 1pt solid; background-color: transparent; mso-border-alt: solid windowtext .5pt" vAlign=top width="103">
<div style="margin: 0cm 0cm 0pt; text-align: center" align="center"><span style="font-size: 10.5pt; color: black"><font face=宋体>文件夹<span lang=EN-US><o:P></O:P></span></font></span></div></td>
<td style="border-right: windowtext 1pt solid; padding-right: 5.4pt; border-top: windowtext 1pt solid; padding-left: 5.4pt; border-left-color: #ece9d8; padding-bottom: 0cm; width: 348.7pt; padding-top: 0cm; border-bottom: windowtext 1pt solid; background-color: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt" vAlign=top width="465">
<div style="margin: 0cm 0cm 0pt; text-align: center" align="center"><span style="font-size: 10.5pt; color: black"><font face=宋体>内容描述<span lang=EN-US><o:P></O:P></span></font></span></div></td></tr>
<tr style="mso-yfti-irow: 1">
<td style="border-right: windowtext 1pt solid; padding-right: 5.4pt; padding-left: 5.4pt; padding-bottom: 0cm; border-left: windowtext 1pt solid; width: 77.4pt; border-top-color: #ece9d8; padding-top: 0cm; border-bottom: windowtext 1pt solid; background-color: transparent; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width="103">
<div style="margin: 0cm 0cm 0pt; text-align: center" align="center"><span lang=EN-US style="font-size: 10.5pt; color: black"><font face=宋体>\aif<o:P></O:P></font></span></div></td>
<td style="border-right: windowtext 1pt solid; padding-right: 5.4pt; padding-left: 5.4pt; border-left-color: #ece9d8; padding-bottom: 0cm; width: 348.7pt; border-top-color: #ece9d8; padding-top: 0cm; border-bottom: windowtext 1pt solid; background-color: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width="465">
<div style="margin: 0cm 0cm 0pt; text-align: center" align="center"><span style="font-size: 10.5pt; color: black"><font face=宋体>存放<span lang=EN-US>*.aif</span>和<span lang=EN-US>*.aif</span>的源位图（<span lang=EN-US>*.bmp</span>）<span lang=EN-US><o:P></O:P></span></font></span></div></td></tr>
<tr style="mso-yfti-irow: 2">
<td style="border-right: windowtext 1pt solid; padding-right: 5.4pt; padding-left: 5.4pt; padding-bottom: 0cm; border-left: windowtext 1pt solid; width: 77.4pt; border-top-color: #ece9d8; padding-top: 0cm; border-bottom: windowtext 1pt solid; background-color: transparent; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width="103">
<div style="margin: 0cm 0cm 0pt; text-align: center" align="center"><span lang=EN-US style="font-size: 10.5pt; color: black"><font face=宋体>\data<o:P></O:P></font></span></div></td>
<td style="border-right: windowtext 1pt solid; padding-right: 5.4pt; padding-left: 5.4pt; border-left-color: #ece9d8; padding-bottom: 0cm; width: 348.7pt; border-top-color: #ece9d8; padding-top: 0cm; border-bottom: windowtext 1pt solid; background-color: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width="465">
<div style="margin: 0cm 0cm 0pt; text-align: center" align="center"><span style="font-size: 10.5pt; color: black"><font face=宋体>用于产生<span lang=EN-US>*.src</span>的<span lang=EN-US>*.rss</span>资源源文件<span lang=EN-US><o:P></O:P></span></font></span></div></td></tr>
<tr style="mso-yfti-irow: 3">
<td style="border-right: windowtext 1pt solid; padding-right: 5.4pt; padding-left: 5.4pt; padding-bottom: 0cm; border-left: windowtext 1pt solid; width: 77.4pt; border-top-color: #ece9d8; padding-top: 0cm; border-bottom: windowtext 1pt solid; background-color: transparent; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width="103">
<div style="margin: 0cm 0cm 0pt; text-align: center" align="center"><span lang=EN-US style="font-size: 10.5pt; color: black"><font face=宋体>\group<o:P></O:P></font></span></div></td>
<td style="border-right: windowtext 1pt solid; padding-right: 5.4pt; padding-left: 5.4pt; border-left-color: #ece9d8; padding-bottom: 0cm; width: 348.7pt; border-top-color: #ece9d8; padding-top: 0cm; border-bottom: windowtext 1pt solid; background-color: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width="465">
<div style="margin: 0cm 0cm 0pt; text-align: center" align="center"><span style="font-size: 10.5pt; color: black"><font face=宋体>与平台无关的项目文件如<span lang=EN-US>*.mmp</span>、<span lang=EN-US>*.inf</span>有时也放<span lang=EN-US>*.rss<o:P></O:P></span></font></span></div></td></tr>
<tr style="mso-yfti-irow: 4">
<td style="border-right: windowtext 1pt solid; padding-right: 5.4pt; padding-left: 5.4pt; padding-bottom: 0cm; border-left: windowtext 1pt solid; width: 77.4pt; border-top-color: #ece9d8; padding-top: 0cm; border-bottom: windowtext 1pt solid; background-color: transparent; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width="103">
<div style="margin: 0cm 0cm 0pt; text-align: center" align="center"><span lang=EN-US style="font-size: 10.5pt; color: black"><font face=宋体>\inc<o:P></O:P></font></span></div></td>
<td style="border-right: windowtext 1pt solid; padding-right: 5.4pt; padding-left: 5.4pt; border-left-color: #ece9d8; padding-bottom: 0cm; width: 348.7pt; border-top-color: #ece9d8; padding-top: 0cm; border-bottom: windowtext 1pt solid; background-color: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width="465">
<div style="margin: 0cm 0cm 0pt; text-align: center" align="center"><font face=宋体><span lang=EN-US style="font-size: 10.5pt; color: black">*.h</span><span style="font-size: 10.5pt; color: black">、<span lang=EN-US>*.loc</span>、<span lang=EN-US>*.l**</span>、<span lang=EN-US>*.pan</span>、<span lang=EN-US>*.hrh</span>等能被＃<span lang=EN-US>include””</span>包含的文件<span lang=EN-US><o:P></O:P></span></span></font></div></td></tr>
<tr style="mso-yfti-irow: 5">
<td style="border-right: windowtext 1pt solid; padding-right: 5.4pt; padding-left: 5.4pt; padding-bottom: 0cm; border-left: windowtext 1pt solid; width: 77.4pt; border-top-color: #ece9d8; padding-top: 0cm; border-bottom: windowtext 1pt solid; background-color: transparent; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width="103">
<div style="margin: 0cm 0cm 0pt; text-align: center" align="center"><span lang=EN-US style="font-size: 10.5pt; color: black"><font face=宋体>\install<o:P></O:P></font></span></div></td>
<td style="border-right: windowtext 1pt solid; padding-right: 5.4pt; padding-left: 5.4pt; border-left-color: #ece9d8; padding-bottom: 0cm; width: 348.7pt; border-top-color: #ece9d8; padding-top: 0cm; border-bottom: windowtext 1pt solid; background-color: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width="465">
<div style="margin: 0cm 0cm 0pt; text-align: center" align="center"><font face=宋体><span lang=EN-US style="font-size: 10.5pt; color: black">*.pkg</span><span style="font-size: 10.5pt; color: black">和随后生成的安装文件<span lang=EN-US>*.sis<o:P></O:P></span></span></font></div></td></tr>
<tr style="mso-yfti-irow: 6; mso-yfti-lastrow: yes">
<td style="border-right: windowtext 1pt solid; padding-right: 5.4pt; padding-left: 5.4pt; padding-bottom: 0cm; border-left: windowtext 1pt solid; width: 77.4pt; border-top-color: #ece9d8; padding-top: 0cm; border-bottom: windowtext 1pt solid; background-color: transparent; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width="103">
<div style="margin: 0cm 0cm 0pt; text-align: center" align="center"><span lang=EN-US style="font-size: 10.5pt; color: black"><font face=宋体>\src<o:P></O:P></font></span></div></td>
<td style="border-right: windowtext 1pt solid; padding-right: 5.4pt; padding-left: 5.4pt; border-left-color: #ece9d8; padding-bottom: 0cm; width: 348.7pt; border-top-color: #ece9d8; padding-top: 0cm; border-bottom: windowtext 1pt solid; background-color: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width="465">
<div style="margin: 0cm 0cm 0pt; text-align: center" align="center"><font face=宋体><span lang=EN-US style="font-size: 10.5pt; color: black">*.cpp</span><span style="font-size: 10.5pt; color: black">类的<span lang=EN-US>C++</span>源文件<span lang=EN-US><o:P></O:P></span></span></font></div></td></tr></tbody></table></div>]]></description>
 <link><![CDATA[http://juwen.blog.51cto.com/135311/115832]]></link>
 <author><![CDATA[juwen]]></author>
 <category><![CDATA[C/C++]]></category>
 <pubdate><![CDATA[Fri, 28 Nov 2008 09:25:33 +0000]]></pubdate>
</item>
<item>
 <title><![CDATA[NewL,ConstructL,NewLC的理解]]></title>
 <description><![CDATA[<div><strong>具体是这样的：</strong></div>
<div>把普通的new 操作分为2个步骤来进行，第一步只分配内存，当分配的内存被放入cleanupstack后，第二步进行构造。<br />但是在C++里 如何阻止编译器的new操作不调用构造函数呢？这个貌似不可以。。。</div>
<div><br />于是Symbian的设计者作了个规定，类在构造函数里不要做任何可能产生异常的操作，只能做那些绝对安全的事情，比如<br />简单的变量赋值，然后提供一个名字叫 ConstructL的函数，在这个函数里做所有类的初始化工作，当然包括那些危险<br />的可能导致异常的操作。</div>
<div>那么 Symbian的 类构造就变成了这样<br />比如 有一个叫 CFoo 的类，我想声明一个指针 p，创建一个CFoo的对象赋给 p<br /><strong>CFoo *p = new(ELeave) CFoo();<br />CleanupStack::PushL(p);<br />p-&gt;ConstructL();<br />CleanupStack::Pop();</strong></div>
<div>这样写是不是有点太罗嗦？每个对象都要用4条语句创建，如果是频繁使用实在是太麻烦了。<br />于是Symbian的设计者又作了一个规定，每个类要实现一个NewL的static函数来完成上面的4条语句的工作<br /><strong>class CFoo<br />{<br />public:<br />&nbsp;static CFoo *NewL()<br />&nbsp;{<br />&nbsp;&nbsp;CFoo *self = new(ELeave) CFoo();<br />&nbsp;&nbsp;CleanupStack::PushL(self);<br />&nbsp;&nbsp;self-&gt;ConstructL();<br />&nbsp;&nbsp;CleanupStack::Pop();<br />&nbsp;&nbsp;return self;<br />&nbsp;}<br />}</strong></div>
<div>有了NewL以后，调用CFoo的类的程序简化了<br /><strong>CFoo *p = CFoo::NewL();</strong></div>
<div>那么NewLC又是什么呢？和NewL有什么不同？<br />有些类是这样的，他们提供一些方法，需要在对象创建完成后执行，但是这些方法也是会产生异常的比如<br />CFoo 如果有一个方法叫 DoSomethingL() </div>
<div>那么程序可以这样写吗？<br /><strong><font color="#ff0000">CFoo *p = CFoo::NewL();<br />p-&gt;DoSomethingL();</font></strong></div>
<div><font color="#000000">显然这样写是有问题的正</font>确的写法是<br /><strong><font color="#0000ff">CFoo *p = CFoo::NewL();<br />CleanupStack::PushL(p);<br />p-&gt;DoSomethingL();<br />CleanupStack::Pop();</font></strong></div>
<div>天啊，又是4条语句，太麻烦了。要知道在NewL结尾我们刚刚把CFoo的指针从CleanupStack里拿出来，马上就又放了进去。<br />是不是可以简化呢，那好我们再节约2条语句<br />NewL去掉结尾的CleanupStack::Pop();<br />&nbsp;static CFoo *NewL()<br />&nbsp;{<br />&nbsp;&nbsp;CFoo *self = new(ELeave) CFoo();<br />&nbsp;&nbsp;CleanupStack::PushL(self);<br />&nbsp;&nbsp;self-&gt;ConstructL();<br />&nbsp;&nbsp;return self;<br />&nbsp;}<br />调用去掉CleanupStack::PushL<br />CFoo *p = CFoo::NewL();<br />p-&gt;DoSomethingL();<br />CleanupStack::Pop();</div>
<div>Symbian的设计者又规定了，具有以上行为的NewL 应该叫NewLC。表示指针返回后，没有从CleanupStack里取出，你可以继续调用一个危险的操作，在最后调用CleanupStack::Pop();</div>
<div>我发现 NewL 可以通过调用NewLC实现。<br />那么一个符合Symbian设计师的N条规定的类应该这样写</div>
<div><strong><font color="#0000ff">class CFoo<br />{<br />public:<br />&nbsp;static CFoo *NewLC()<br />&nbsp;{<br />&nbsp;&nbsp;CFoo *self = new(ELeave) CFoo();<br />&nbsp;&nbsp;CleanupStack::PushL(self);<br />&nbsp;&nbsp;self-&gt;ConstructL();<br />&nbsp;&nbsp;return self;<br />&nbsp;}</font></strong></div>
<div><strong><font color="#0000ff">&nbsp;static CFoo *NewL()<br />&nbsp;{<br />&nbsp;&nbsp;CFoo *self = NewLC();<br />&nbsp;&nbsp;CleanupStack::Pop();<br />&nbsp;&nbsp;return self;<br />&nbsp;}</font></strong></div>
<div><strong><font color="#0000ff">&nbsp;virtual ~CFoo()<br />&nbsp;{<br />&nbsp;}</font></strong></div>
<div><strong><font color="#0000ff">protected:<br />&nbsp;CFoo()<br />&nbsp;{<br />&nbsp;}</font></strong></div>
<div><strong><font color="#0000ff">&nbsp;void ConstructL()<br />&nbsp;{<br />&nbsp;//&nbsp;....<br />&nbsp;}<br />}</font></strong></div>
<div><strong><font color="#0000ff"></font></strong>&nbsp;</div>
<div>原文：<a href="http://blog.joycode.com/yaodong/articles/94824.aspx">[url]http://blog.joycode.com/yaodong/articles/94824.aspx[/url]</a>&nbsp;</div>
<div>这位大哥写得实在太好了， 我看书本的解说有点不明不白的，群里的知了大哥给我看了这篇文章后就如梦初醒。所以抄了下来。</div>
<div>&nbsp;</div>
<div>文章后面有评论，又是另一位大侠。我也抄了下来，如下：</div>
<div class=CommentTitle>与博主探讨“何时使用NewLC” <a id="ctl00_MainContent_Comments1_CommentList_ctl06_EditLink" href="javascript:__doPostBack("ctl00$MainContent$Comments1$CommentList$ctl06$EditLink','')"></a></div>
<div class=CommentContent>博主对于NewLC引入原因的理解似乎有误。 <br />是否选用NewLC构建对象，并非像博主所说，看是否要使用该对象的异常退出函数（DoSomethingL()）。 <br />其实在一个类被实例化而成为对象的这个时段（对象的生存期）内，任何异常（包括与该对象无关的异常）的退出，都需要将该对象空间释放掉，以避免内存泄露。这与博主所说原因是没有直接关系的（或者说博主所说情况只是一个特例）。 <br />那么什么时候使用NewLC呢？ <br />这主要看接收该对象的变量（指针）的类型。如果接收变量是自动变量（不属于任何其他对象），就需要使用NewLC来进行构造；而如果接收变量是成员变量（属于某个对象），就必须用NewL来进行构造。 <br />为什么呢？因为如果该变量属于某个对象，对其的销毁责任就归属于该对象的解构器。如果又把它加入到清除堆栈中，岂不多此一举？可以想象，如此一来，当程序发生异常退出时它就会被销毁两次： <br />第一次：直接销毁该变量所指向的对象； <br />第二次：在销毁该变量所属对象时，其解构器对变量所指对象进行销毁。</div>
<div class=CommentContent>&nbsp;</div>
<div class=CommentContent>&nbsp;<a id="ctl00_MainContent_Comments1_CommentList_ctl06_NameLink" title="http://shujiantang.blogbus.com/" href="http://shujiantang.blogbus.com/" target="_blank">今去冠首你你魔</a></div>]]></description>
 <link><![CDATA[http://juwen.blog.51cto.com/135311/115449]]></link>
 <author><![CDATA[juwen]]></author>
 <category><![CDATA[C/C++]]></category>
 <pubdate><![CDATA[Wed, 26 Nov 2008 15:43:35 +0000]]></pubdate>
</item>
<item>
 <title><![CDATA[halcon加载图片到mfc]]></title>
 <description><![CDATA[<div>halcon加载图片到mfc中实际上和直接加载图片到MFC是有很大的区别。</div>
<div>halcon加载图片到MFC实际流程是这样的：</div>
<div>1. halcon在mfc窗口上面打开一个halcon窗口。halcon生成的窗口依附在mfc上，看起来就像MFC窗口的一部分。</div>
<div>&nbsp;open_window(10,10,1024,768,(Hlong)showwin,"visible","",&amp;CPPExpDefaultWindow);</div>
<div>showwin是MFC窗口的handle.</div>
<div>&nbsp;</div>
<div>2.在halcon窗口上面显示图片。</div>
<div>&nbsp;&nbsp;&nbsp; disp_obj(Image CPPExpDefaultWindow);</div>
<div>&nbsp;</div>
<div>看起来就像在MFC上显示一样。</div>]]></description>
 <link><![CDATA[http://juwen.blog.51cto.com/135311/115309]]></link>
 <author><![CDATA[juwen]]></author>
 <category><![CDATA[C/C++]]></category>
 <pubdate><![CDATA[Wed, 26 Nov 2008 08:43:13 +0000]]></pubdate>
</item>
<item>
 <title><![CDATA[运行Carbide epoc模拟器后十几秒后自动退出]]></title>
 <description><![CDATA[<div>关闭操作系统数据执行保护。</div>
<div>问题解决。</div>]]></description>
 <link><![CDATA[http://juwen.blog.51cto.com/135311/114854]]></link>
 <author><![CDATA[juwen]]></author>
 <category><![CDATA[C/C++]]></category>
 <pubdate><![CDATA[Mon, 24 Nov 2008 16:58:43 +0000]]></pubdate>
</item>
<item>
 <title><![CDATA[flashcom中远程共享对象SharedObject的用法]]></title>
 <description><![CDATA[<div>觉得这篇文章比较好，转载回来。</div>
<div>&nbsp;</div>
<div>学习fcs也有差不多一个月了,感觉最有特色的东西还是SharedObject.<br />SharedObject有不少东西,本地操作就不说了(相信很多人没接触fcs也用过);就说说远程共享对象吧.<br />基本的应用流程是:</div>
<div class=HtmlCode>my_nc&nbsp;=&nbsp;new&nbsp;NetConnection(); <br />my_nc.connect("rtmp:/app",变量1,变量2,...); <br />mySO=getRemote("mySO",my_nc.uri,false) <br />mySO.connect(my_nc); <br />mySO.onSync=function(info){&nbsp; <br />} <br />mySO.data[property]=newValue <br />//</div>
<div>下面解析一下:</div>
<div class=HtmlCode>my_nc&nbsp;=&nbsp;new&nbsp;NetConnection(); <br />my_nc.connect("rtmp:/app",变量1,变量2,...); <br />mySO=getRemote("mySO",my_nc.uri,false) <br />//&nbsp;mySO:共享对象名字; <br />//&nbsp;my_nc.uri:共享对象共享连接到my_nc.uri的用户; <br />//&nbsp;false:还可以用true或空;英文解析是: <br />//&nbsp;1.&nbsp;null&nbsp;or&nbsp;false&nbsp;:persistence&nbsp;not&nbsp;on&nbsp;the&nbsp;server <br />//&nbsp;2.&nbsp;true:&nbsp;persistence&nbsp;on&nbsp;the&nbsp;server&nbsp;(not&nbsp;on&nbsp;the&nbsp;local); <br />//&nbsp;3.&nbsp;A&nbsp;full&nbsp;or&nbsp;partial&nbsp;local&nbsp;path&nbsp;to&nbsp;the&nbsp;shared&nbsp;object <br />//&nbsp;persistence&nbsp;on&nbsp;the&nbsp;server&nbsp;and&nbsp;local <br />//&nbsp;我也不大清楚这个意思,但我总结:false:当所有用户都停掉&nbsp; <br />//&nbsp;时&nbsp;mySO清空;true:&nbsp;不清空, <br />mySO.connect(my_nc); <br />//连接mySO到服务器 <br />mySO.onSync=function(info){&nbsp; <br />} <br />//mySO事件 <br />改变它的值(一旦改变它的值就会触发onSync事件): <br />mySO.data[property]=newValue</div>
<div>到这里就可以基本应用,当然如果你想在服务器也创建一个对应的mySO来也可以用<br />application.mySO = SharedObject.get("mySO", false);<br />但要注意的是在服务器里操作mySO的属性是要用setProperty来改变,或是把一个对象作为它的属性,那么操作对象就不用用setProperty了.<br />//<br />下面来重点说下mySO的事件:onSync<br />SharedObject有两个事件:onStatus和onSync<br />两个基本上是一样的,但是有一点(不知道是不是这点使得大家不用onStatus):onStatus对新值和旧值相同时是不会触发这个事件的,<br />而onSync却不管是否相同都会触发;<br />先看一个例子:</div>
<div class=HtmlCode>my_So.onSync&nbsp;=&nbsp;function(info)&nbsp;{ <br />for&nbsp;(name&nbsp;in&nbsp;info)&nbsp;{ <br />trace("[sync]&nbsp;Reading&nbsp;Array&nbsp;Object&nbsp;#"+name+"&nbsp;code&nbsp;("+info[name].code+","+info[name].name+")"); <br />switch&nbsp;(info[name].code)&nbsp;{ <br />case&nbsp;"change"&nbsp;: <br />var&nbsp;property&nbsp;=&nbsp;info[name].name; <br />var&nbsp;newValue&nbsp;=&nbsp;this.data[property]; <br />_root[property+"_in"].text&nbsp;=&nbsp;newValue; <br />break; <br />case&nbsp;"success"&nbsp;: <br />break; <br />case&nbsp;"reject"&nbsp;: <br />break; <br />case&nbsp;"clear"&nbsp;: <br />break; <br />case&nbsp;"delete"&nbsp;: <br />break; <br />trace("data&nbsp;is&nbsp;updated"); <br />} <br />} <br />};</div>
<div>操作:</div>
<div class=HtmlCode>mySO.data[mytxt]=50</div>
<div>干脆就在上面注析吧:</div>
<div class=HtmlCode>my_So.onSync&nbsp;=&nbsp;function(info)&nbsp;{ <br />//info:事件onSync触发的返回信息,&nbsp;是个一维数组,两个属性(code,name) <br />for&nbsp;(name&nbsp;in&nbsp;info)&nbsp;{ <br />//name:变化的属性名,这个是一个遍历,看看在这次事件中有哪些属性改变了,(常常只有一个属性改变) <br />trace("info[name].code:"+info[name].code+"&nbsp;info[name].name:&nbsp;"+info[name].name); <br />//输出info[name].code:相对于本客户端的事件类型:如下的switch; <br />//输出info[name].name:属性名字 <br />switch&nbsp;(info[name].code)&nbsp;{ <br />case&nbsp;"change"&nbsp;: <br />//当事件类型是"改变"时,基本就是在这里广播事件的,其它的每个客户都执行这里的语句 <br />var&nbsp;_property&nbsp;=&nbsp;info[name].name; <br />var&nbsp;_newValue&nbsp;=&nbsp;this.data[_property]; <br />_root[_property].text&nbsp;=&nbsp;_newValue; <br />break; <br />case&nbsp;"success"&nbsp;: <br />//当事件类型是"成功"时:注意:当本客户端上改动触发自已是"成功";而其它客户端则是"改变"; <br />break; <br />case&nbsp;"reject"&nbsp;: <br />//当事件类型是"修改不成功"时: <br />break; <br />case&nbsp;"clear"&nbsp;: <br />//这个用得比较少,不是很清楚,根据英语的意思自已也不是很理解: <br />//This&nbsp;value&nbsp;is&nbsp;received&nbsp;by&nbsp;a&nbsp;Flash&nbsp;player&nbsp;<br />that&nbsp;connected&nbsp;to&nbsp;a&nbsp;SharedObject&nbsp;for&nbsp;the&nbsp;first&nbsp;time. <br />//Clear&nbsp;is&nbsp;also&nbsp;sent&nbsp;if&nbsp;the&nbsp;server&nbsp;and&nbsp;client&nbsp;data&nbsp;are&nbsp;<br />so&nbsp;far&nbsp;out&nbsp;of&nbsp;sync&nbsp;that&nbsp;the&nbsp;client&nbsp;dumps&nbsp; <br />its&nbsp;version&nbsp;of&nbsp;the&nbsp;SharedObject&nbsp;and&nbsp;resynchronizes&nbsp;itself&nbsp;completely. <br />break; <br />case&nbsp;"delete"&nbsp;: <br />//当mySO给delete掉时 <br />break; <br />trace("data&nbsp;is&nbsp;updated"); <br />} <br />} <br />} <br />//</div>
<div>说到my_SO不得不提的是my_SO.send()这个函数(我很喜欢用),它也是类似onSync的广播事件的用途.这个很好用.<br />用法:</div>
<div class=HtmlCode>mySO.send("toggleBall",&nbsp;变量1,&nbsp;变量2...); <br />对应在client或是server端的mySO属性函数: <br />mySO.toggleBall=function(&nbsp;变量1,&nbsp;变量2..){ <br />这个函数在其它所有的客户端执行,就像onSync一样的效果 <br />} <br /></div>]]></description>
 <link><![CDATA[http://juwen.blog.51cto.com/135311/111492]]></link>
 <author><![CDATA[juwen]]></author>
 <category><![CDATA[Web开发]]></category>
 <pubdate><![CDATA[Mon, 10 Nov 2008 21:03:05 +0000]]></pubdate>
</item>
<item>
 <title><![CDATA[机器视觉实际应用例子]]></title>
 <description><![CDATA[<div class=MsoNormal style="margin: 0cm 0cm 0pt"><span lang=EN-US style="font-size: 12pt">有空整理了一下机器视觉的内容，将halcon里面的例子，我认为比较好理解的东西整理出来，机器视觉现在国内应用得还不多，前途是光明的，道路是曲折的。反正平时也讨论多，但也没有见过比较成熟的实际应用，参观过政府的车牌析别的工程，但好像也没有真的放到道路上使用。应该是数据采集还有些问题没有解决吧。闲话少说。看下面：其实有几个应用有些重叠。一言闭之，流程：找到感兴趣区域，分析对象。</span></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt"><b style="mso-bidi-font-weight: normal"><span lang=EN-US style="font-size: 12pt">1</span></b><b style="mso-bidi-font-weight: normal"><span style="font-size: 12pt; font-family: 宋体; mso-ascii-font-family: " Roman?? New ?Times mso-hansi-font-family: Roman?; Times>、检测开关情况</span></b><b style="mso-bidi-font-weight: normal"><span lang=EN-US style="font-size: 12pt"><?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></span></b></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt"><span lang=EN-US><?xml:namespace prefix = v ns = "urn:schemas-microsoft-com:vml" /><v:shapetype id="_x0000_t75" coordsize="21600,21600" o:spt="75" o:preferrelative="t" path="m@4@5l@4@11@9@11@9@5xe" filled="f" stroked="f"><v:stroke joinstyle="miter"></v:stroke><v:formulas><v:f eqn="if lineDrawn pixelLineWidth 0"></v:f><v:f eqn="sum @0 1 0"></v:f><v:f eqn="sum 0 0 @1"></v:f><v:f eqn="prod @2 1 2"></v:f><v:f eqn="prod @3 21600 pixelWidth"></v:f><v:f eqn="prod @3 21600 pixelHeight"></v:f><v:f eqn="sum @0 0 1"></v:f><v:f eqn="prod @6 1 2"></v:f><v:f eqn="prod @7 21600 pixelWidth"></v:f><v:f eqn="sum @8 21600 0"></v:f><v:f eqn="prod @7 21600 pixelHeight"></v:f><v:f eqn="sum @10 21600 0"></v:f></v:formulas><v:path o:extrusionok="f" gradientshapeok="t" o:connecttype="rect"></v:path><o:lock v:ext="edit" aspectratio="t"></o:lock></v:shapetype><span lang=EN-US style="font-size: 10.5pt; font-family: " New Roman?; Times AR-SA? mso-bidi-language: ZH-CN; mso-fareast-language: EN-US; mso-ansi-language: 1.0pt; mso-font-kerning: 宋体; mso-fareast-font-family: 12.0pt; mso-bidi-font-size:><v:shapetype id="_x0000_t75" coordsize="21600,21600" o:spt="75" o:preferrelative="t" path="m@4@5l@4@11@9@11@9@5xe" filled="f" stroked="f">&nbsp;<span lang=EN-US style="font-size: 12pt"><img onclick='window.open(this.src)' alt="" src="http://juwen.blog.51cto.com/attachment/200811/200811061225951554109.jpg" border="0" /></span><v:stroke joinstyle="miter"></v:stroke><v:formulas><v:f eqn="if lineDrawn pixelLineWidth 0"></v:f><v:f eqn="sum @0 1 0"></v:f><v:f eqn="sum 0 0 @1"></v:f><v:f eqn="prod @2 1 2"></v:f><v:f eqn="prod @3 21600 pixelWidth"></v:f><v:f eqn="prod @3 21600 pixelHeight"></v:f><v:f eqn="sum @0 0 1"></v:f><v:f eqn="prod @6 1 2"></v:f><v:f eqn="prod @7 21600 pixelWidth"></v:f><v:f eqn="sum @8 21600 0"></v:f><v:f eqn="prod @7 21600 pixelHeight"></v:f><v:f eqn="sum @10 21600 0"></v:f></v:formulas><v:path o:extrusionok="f" gradientshapeok="t" o:connecttype="rect"></v:path><o:lock v:ext="edit" aspectratio="t"></o:lock></v:shapetype></span></span></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt"><font size="3"><span style="font-family: 宋体; mso-ascii-font-family: " Roman?? New ?Times mso-hansi-font-family: Roman?; Times>输出结果</span><span lang=EN-US> 0 0 1 0 0 1 1 0 1 0 0 1</span></font></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt"><font size="3"><span style="font-family: 宋体; mso-ascii-font-family: " Roman?? New ?Times mso-hansi-font-family: Roman?; Times>对应上面的</span><span lang=EN-US>12</span><span style="font-family: 宋体; mso-ascii-font-family: " Roman?? New ?Times mso-hansi-font-family: Roman?; Times>个开关。</span><span lang=EN-US>0</span><span style="font-family: 宋体; mso-ascii-font-family: " Roman?? New ?Times mso-hansi-font-family: Roman?; Times>表示向下，</span><span lang=EN-US>1</span><span style="font-family: 宋体; mso-ascii-font-family: " Roman?? New ?Times mso-hansi-font-family: Roman?; Times>表示向上。</span></font></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt"><span lang=EN-US><o:p><font size="3">&nbsp;</font></o:p></span></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt"><b style="mso-bidi-font-weight: normal"><span lang=EN-US style="font-size: 12pt">2</span></b><b style="mso-bidi-font-weight: normal"><span style="font-size: 12pt; font-family: 宋体; mso-ascii-font-family: " Roman?? New ?Times mso-hansi-font-family: Roman?; Times>、检查钳子状态</span></b><b style="mso-bidi-font-weight: normal"><span lang=EN-US style="font-size: 12pt"><o:p></o:p></span></b></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt"><span lang=EN-US></span></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt"><font size="3"><span lang=EN-US><img onclick='window.open(this.src)' alt="" src="http://juwen.blog.51cto.com/attachment/200811/200811061225951577906.jpg" border="0" /></span></font></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt"><font size="3"><span lang=EN-US>A</span><span style="font-family: 宋体; mso-ascii-font-family: " Roman?? New ?Times mso-hansi-font-family: Roman?; Times>图钳子打开，</span><span lang=EN-US>b</span><span style="font-family: 宋体; mso-ascii-font-family: " Roman?? New ?Times mso-hansi-font-family: Roman?; Times>图的钳子合上</span></font></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt"><span lang=EN-US><o:p><font size="3">&nbsp;</font></o:p></span></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt"><b style="mso-bidi-font-weight: normal"><span lang=EN-US style="font-size: 14pt">3</span></b><b style="mso-bidi-font-weight: normal"><span style="font-size: 14pt; font-family: 宋体; mso-ascii-font-family: " Roman?? New ?Times mso-hansi-font-family: Roman?; Times>、检测生产日期</span></b></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt"><b style="mso-bidi-font-weight: normal"><span style="font-size: 14pt; font-family: 宋体; mso-ascii-font-family: " Roman?? New ?Times mso-hansi-font-family: Roman?; Times></span></b><b style="mso-bidi-font-weight: normal"><span lang=EN-US style="font-size: 14pt"><o:p><img onclick='window.open(this.src)' alt="" src="http://juwen.blog.51cto.com/attachment/200811/200811061225951589734.jpg" border="0" /></o:p></span></b></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt"><span lang=EN-US></span></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt"><font size="3"><span style="font-family: 宋体; mso-ascii-font-family: " Roman?? New ?Times mso-hansi-font-family: Roman?; Times>拍摄生产日期图片，得到生产日期数据</span><span lang=EN-US>.</span></font></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt"><b style="mso-bidi-font-weight: normal"><span lang=EN-US style="font-size: 12pt">4</span></b><b style="mso-bidi-font-weight: normal"><span style="font-size: 12pt; font-family: 宋体; mso-ascii-font-family: " Roman?? New ?Times mso-hansi-font-family: Roman?; Times>、检测金属表面字符</span></b><b style="mso-bidi-font-weight: normal"><span lang=EN-US style="font-size: 12pt"><o:p></o:p></span></b></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt"><span lang=EN-US></span></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt"><span lang=EN-US><o:p><font size="3"><img onclick='window.open(this.src)' alt="" src="http://juwen.blog.51cto.com/attachment/200811/200811061225951602875.jpg" border="0" />&nbsp;</font></o:p></span></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt"><b style="mso-bidi-font-weight: normal"><span lang=EN-US style="font-size: 12pt">5</span></b><b style="mso-bidi-font-weight: normal"><span style="font-size: 12pt; font-family: 宋体; mso-ascii-font-family: " Roman?? New ?Times mso-hansi-font-family: Roman?; Times>、检测印刷品上的条形码</span></b><b style="mso-bidi-font-weight: normal"><span lang=EN-US style="font-size: 12pt"><o:p></o:p></span></b></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt"><span lang=EN-US></span></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt"><span lang=EN-US><o:p><font size="3"><img onclick='window.open(this.src)' alt="" src="http://juwen.blog.51cto.com/attachment/200811/200811061225951615406.jpg" border="0" />&nbsp;</font></o:p></span></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt"><b style="mso-bidi-font-weight: normal"><span lang=EN-US style="font-size: 12pt">6</span></b><b style="mso-bidi-font-weight: normal"><span style="font-size: 12pt; font-family: 宋体; mso-ascii-font-family: " Roman?? New ?Times mso-hansi-font-family: Roman?; Times>、检测划痕</span></b><b style="mso-bidi-font-weight: normal"><span lang=EN-US style="font-size: 12pt"><o:p></o:p></span></b></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt"><span lang=EN-US></span></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt"><span lang=EN-US><o:p><font size="3"><img onclick='window.open(this.src)' alt="" src="http://juwen.blog.51cto.com/attachment/200811/200811061225951626484.jpg" border="0" />&nbsp;</font></o:p></span></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt"><span lang=EN-US><o:p><font size="3">&nbsp;</font></o:p></span></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt"><b style="mso-bidi-font-weight: normal"><span lang=EN-US style="font-size: 12pt">7</span></b><b style="mso-bidi-font-weight: normal"><span style="font-size: 12pt; font-family: 宋体; mso-ascii-font-family: " Roman?? New ?Times mso-hansi-font-family: Roman?; Times>、检测印刷图标</span></b><b style="mso-bidi-font-weight: normal"><span lang=EN-US style="font-size: 12pt"><o:p></o:p></span></b></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt"><span lang=EN-US></span></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt"><span lang=EN-US><o:p><font size="3"><img onclick='window.open(this.src)' alt="" src="http://juwen.blog.51cto.com/attachment/200811/200811061225951635265.jpg" border="0" />&nbsp;</font></o:p></span></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt"><b style="mso-bidi-font-weight: normal"><span lang=EN-US style="font-size: 12pt">8</span></b><b style="mso-bidi-font-weight: normal"><span style="font-size: 12pt; font-family: 宋体; mso-ascii-font-family: " Roman?? New ?Times mso-hansi-font-family: Roman?; Times>、电路板管脚检测</span></b><b style="mso-bidi-font-weight: normal"><span lang=EN-US style="font-size: 12pt"><o:p></o:p></span></b></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt"><span lang=EN-US></span></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt"><span style="font-family: 宋体; mso-ascii-font-family: " Roman?? New ?Times mso-hansi-font-family: Roman?; Times><font size="3"><img onclick='window.open(this.src)' alt="" src="http://juwen.blog.51cto.com/attachment/200811/200811061225951651312.jpg" border="0" /></font></span></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt"><span style="font-family: 宋体; mso-ascii-font-family: " Roman?? New ?Times mso-hansi-font-family: Roman?; Times><font size="3">检测管脚有没有短路</font></span></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt"><span lang=EN-US><o:p><font size="3">&nbsp;</font></o:p></span></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt"><b style="mso-bidi-font-weight: normal"><span lang=EN-US style="font-size: 12pt">9</span></b><b style="mso-bidi-font-weight: normal"><span style="font-size: 12pt; font-family: 宋体; mso-ascii-font-family: " Roman?? New ?Times mso-hansi-font-family: Roman?; Times>、统计数量</span></b><b style="mso-bidi-font-weight: normal"><span lang=EN-US style="font-size: 12pt"><o:p></o:p></span></b></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt"><span lang=EN-US></span></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt"><b style="mso-bidi-font-weight: normal"><span lang=EN-US style="font-size: 12pt"><img onclick='window.open(this.src)' alt="" src="http://juwen.blog.51cto.com/attachment/200811/200811061225951663812.jpg" border="0" /></span></b></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt"><b style="mso-bidi-font-weight: normal"><span lang=EN-US style="font-size: 12pt">10</span></b><b style="mso-bidi-font-weight: normal"><span style="font-size: 12pt; font-family: 宋体; mso-ascii-font-family: " Roman?? New ?Times mso-hansi-font-family: Roman?; Times>、检查瓶盖</span></b><b style="mso-bidi-font-weight: normal"><span lang=EN-US style="font-size: 12pt"><o:p></o:p></span></b></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt"><span lang=EN-US></span></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt"><span lang=EN-US><o:p><font size="3"><img onclick='window.open(this.src)' alt="" src="http://juwen.blog.51cto.com/attachment/200811/200811061225951672546.jpg" border="0" />&nbsp;</font></o:p></span></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt"><b style="mso-bidi-font-weight: normal"><span lang=EN-US style="font-size: 12pt">11</span></b><b style="mso-bidi-font-weight: normal"><span style="font-size: 12pt; font-family: 宋体; mso-ascii-font-family: " Roman?? New ?Times mso-hansi-font-family: Roman?; Times>、检测零件</span></b><b style="mso-bidi-font-weight: normal"><span lang=EN-US style="font-size: 12pt"><o:p></o:p></span></b></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt"><span lang=EN-US></span></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt"><span lang=EN-US><o:p><font size="3"><img onclick='window.open(this.src)' alt="" src="http://juwen.blog.51cto.com/attachment/200811/200811061225951685109.jpg" border="0" />&nbsp;</font></o:p></span></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt"><span lang=EN-US><o:p><font size="3">这里也是指出几个比较容易理解的内容，做起来比较好做的，还有其它三维重建，双目视觉，这些复杂一点，以后再整理。上面的例子应该一看就明白的了。</font></o:p></span></div>
<div class=MsoNormal style="margin: 0cm 0cm 0pt"><span lang=EN-US><o:p>实际中还需要解决很多问题，机器视觉中图像分析仅是其中一环。还有外部各种硬件的配合，图像采集，分析后产品的处理。需要很多工作要做的，欢迎大家留下自己的意见，一起讨论。</o:p></span></div>]]></description>
 <link><![CDATA[http://juwen.blog.51cto.com/135311/110582]]></link>
 <author><![CDATA[juwen]]></author>
 <category><![CDATA[开发技术]]></category>
 <pubdate><![CDATA[Thu, 06 Nov 2008 14:14:40 +0000]]></pubdate>
</item>
</channel></rss>