﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>C++博客-积木</title><link>http://www.cppblog.com/Tongy0/</link><description>No sub title</description><language>zh-cn</language><lastBuildDate>Tue, 07 Apr 2026 13:08:10 GMT</lastBuildDate><pubDate>Tue, 07 Apr 2026 13:08:10 GMT</pubDate><ttl>60</ttl><item><title>【转载】C中的预编译宏定义</title><link>http://www.cppblog.com/Tongy0/archive/2015/03/18/210093.html</link><dc:creator>Jacc.Kim</dc:creator><author>Jacc.Kim</author><pubDate>Wed, 18 Mar 2015 01:56:00 GMT</pubDate><guid>http://www.cppblog.com/Tongy0/archive/2015/03/18/210093.html</guid><wfw:comment>http://www.cppblog.com/Tongy0/comments/210093.html</wfw:comment><comments>http://www.cppblog.com/Tongy0/archive/2015/03/18/210093.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/Tongy0/comments/commentRss/210093.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/Tongy0/services/trackbacks/210093.html</trackback:ping><description><![CDATA[ 原文转载自：http://www.uml.org.cn/c++/200902104.asp 

一篇讲解宏预编译的内容。 

<img src ="http://www.cppblog.com/Tongy0/aggbug/210093.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/Tongy0/" target="_blank">Jacc.Kim</a> 2015-03-18 09:56 <a href="http://www.cppblog.com/Tongy0/archive/2015/03/18/210093.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>【转载】C语言stat()函数：获取文件状态</title><link>http://www.cppblog.com/Tongy0/archive/2015/01/20/209594.html</link><dc:creator>Jacc.Kim</dc:creator><author>Jacc.Kim</author><pubDate>Tue, 20 Jan 2015 11:36:00 GMT</pubDate><guid>http://www.cppblog.com/Tongy0/archive/2015/01/20/209594.html</guid><wfw:comment>http://www.cppblog.com/Tongy0/comments/209594.html</wfw:comment><comments>http://www.cppblog.com/Tongy0/archive/2015/01/20/209594.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/Tongy0/comments/commentRss/209594.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/Tongy0/services/trackbacks/209594.html</trackback:ping><description><![CDATA[<div><font style="background-color: #c7edcc">转自:<a href="http://c.biancheng.net/cpp/html/326.html">http://c.biancheng.net/cpp/html/326.html</a><br /><br />
<div style="padding-bottom: 5px; text-transform: none; background-color: rgb(238,238,238); text-indent: 0px; font: 14px 'Microsoft Yahei', Arial, Helvetica, sans-serif; white-space: normal; letter-spacing: normal; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-stroke-width: 0px" id="ad-shoutu">站长收徒：<a style="border-bottom: medium none; border-left: medium none; color: rgb(0,136,204); border-top: medium none; border-right: medium none; text-decoration: none" href="http://www.weixueyuan.net/shoutu/" target="_blank">C语言基础视频 + C语言扩展视频 + C语言高级视频 + 一对一答疑</a></div>
<div style="text-transform: none; background-color: rgb(238,238,238); text-indent: 0px; font: 14px/1.6em 'Microsoft Yahei', Arial, Helvetica, sans-serif; white-space: normal; margin-bottom: 12px; letter-spacing: normal; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-stroke-width: 0px" id="art-body">相关函数：fstat, lstat, chmod, chown, readlink, utime<br /><br />头文件：#include &lt;sys/stat.h&gt; &nbsp;&nbsp;#include &lt;unistd.h&gt;<br /><br />定义函数：int stat(const char * file_name, struct stat *buf);<br /><br /><span style="color: rgb(255,0,0)">函数说明：stat()用来将参数file_name 所指的文件状态, 复制到参数buf 所指的结构中。</span><br /><br />下面是struct stat 内各参数的说明：<br />struct stat<br />{<br />&nbsp; &nbsp; dev_t st_dev; //device 文件的设备编号<br />&nbsp; &nbsp; ino_t st_ino; //inode 文件的i-node<br />&nbsp; &nbsp; mode_t st_mode; //protection 文件的类型和存取的权限<br />&nbsp; &nbsp; nlink_t st_nlink; //number of hard links 连到该文件的硬连接数目, 刚建立的文件值为1.<br />&nbsp; &nbsp; uid_t st_uid; //user ID of owner 文件所有者的用户识别码<br />&nbsp; &nbsp; gid_t st_gid; //group ID of owner 文件所有者的组识别码<br />&nbsp; &nbsp; dev_t st_rdev; //device type 若此文件为装置设备文件, 则为其设备编号<br />&nbsp; &nbsp; off_t st_size; //total size, in bytes 文件大小, 以字节计算<br />&nbsp; &nbsp; unsigned long st_blksize; //blocksize for filesystem I/O 文件系统的I/O 缓冲区大小.<br />&nbsp; &nbsp; unsigned long st_blocks; //number of blocks allocated 占用文件区块的个数, 每一区块大小为512 个字节.<br />&nbsp; &nbsp; time_t st_atime; //time of lastaccess 文件最近一次被存取或被执行的时间, 一般只有在用mknod、utime、read、write 与tructate 时改变.<br />&nbsp; &nbsp; time_t st_mtime; //time of last modification 文件最后一次被修改的时间, 一般只有在用mknod、utime 和write 时才会改变<br />&nbsp; &nbsp; time_t st_ctime; //time of last change i-node 最近一次被更改的时间, 此参数会在文件所有者、组、权限被更改时更新<br />};<br /><br /><span style="color: rgb(165,42,42)">先前所描述的st_mode 则定义了下列数种情况：<br />1、S_IFMT 0170000 文件类型的位遮罩<br />2、S_IFSOCK 0140000 scoket<br />3、S_IFLNK 0120000 符号连接<br />4、S_IFREG 0100000 一般文件<br />5、S_IFBLK 0060000 区块装置<br />6、S_IFDIR 0040000 目录<br />7、S_IFCHR 0020000 字符装置<br />8、S_IFIFO 0010000 先进先出<br />9、S_ISUID 04000 文件的 (set user-id on execution)位<br />10、S_ISGID 02000 文件的 (set group-id on execution)位<br />11、S_ISVTX 01000 文件的sticky 位<br />12、S_IRUSR (S_IREAD) 00400 文件所有者具可读取权限<br />13、S_IWUSR (S_IWRITE)00200 文件所有者具可写入权限<br />14、S_IXUSR (S_IEXEC) 00100 文件所有者具可执行权限<br />15、S_IRGRP 00040 用户组具可读取权限<br />16、S_IWGRP 00020 用户组具可写入权限<br />17、S_IXGRP 00010 用户组具可执行权限<br />18、S_IROTH 00004 其他用户具可读取权限<br />19、S_IWOTH 00002 其他用户具可写入权限<br />20、S_IXOTH 00001 其他用户具可执行权限上述的文件类型在 POSIX 中定义了检查这些类型的宏定义<br />21、S_ISLNK (st_mode) 判断是否为符号连接<br />22、S_ISREG (st_mode) 是否为一般文件<br />23、S_ISDIR (st_mode) 是否为目录<br />24、S_ISCHR (st_mode) 是否为字符装置文件<br />25、S_ISBLK (s3e) 是否为先进先出<br />26、S_ISSOCK (st_mode) 是否为socket 若一目录具有sticky 位 (S_ISVTX), 则表示在此目录下的文件只能被该文件所有者、此目录所有者或root 来删除或改名.</span><br /><br />返回值：执行成功则返回0，失败返回-1，错误代码存于errno。<br /><br /><span style="color: rgb(165,42,42)">错误代码：<br />1、ENOENT 参数file_name 指定的文件不存在<br />2、ENOTDIR 路径中的目录存在但却非真正的目录<br />3、ELOOP 欲打开的文件有过多符号连接问题, 上限为16 符号连接<br />4、EFAULT 参数buf 为无效指针, 指向无法存在的内存空间<br />5、EACCESS 存取文件时被拒绝<br />6、ENOMEM 核心内存不足<br />7、ENAMETOOLONG 参数file_name 的路径名称太长</span><br /><br />范例<br />#include &lt;sys/stat.h&gt;<br />#include &lt;unistd.h&gt;<br />main()<br />{<br />&nbsp; &nbsp; struct stat buf;<br />&nbsp; &nbsp; stat("/etc/passwd", &amp;buf);<br />&nbsp; &nbsp; printf("/etc/passwd file size = %d \n", buf.st_size);<br />}<br /><br />执行：<br />/etc/passwd file size = 705</div><br /></font></div><img src ="http://www.cppblog.com/Tongy0/aggbug/209594.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/Tongy0/" target="_blank">Jacc.Kim</a> 2015-01-20 19:36 <a href="http://www.cppblog.com/Tongy0/archive/2015/01/20/209594.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>【转载】创建并调用MFC规则DLL的实例</title><link>http://www.cppblog.com/Tongy0/archive/2014/11/14/208874.html</link><dc:creator>Jacc.Kim</dc:creator><author>Jacc.Kim</author><pubDate>Fri, 14 Nov 2014 02:02:00 GMT</pubDate><guid>http://www.cppblog.com/Tongy0/archive/2014/11/14/208874.html</guid><wfw:comment>http://www.cppblog.com/Tongy0/comments/208874.html</wfw:comment><comments>http://www.cppblog.com/Tongy0/archive/2014/11/14/208874.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/Tongy0/comments/commentRss/208874.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/Tongy0/services/trackbacks/208874.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 原文转载自：http://blog.csdn.net/callbackfunc/article/details/7233894本例通过新建一个MFC规则DLL并新建一个MFC对话框程序调用它，演示MFC规则DLL的创建及调用。（VS2010环境下实例代码亲测可编译通过）一、MFC规则DLL项目1.创建MFC规则DLL2.新建global.cpp(新建此文件没有特殊意义，仅用...&nbsp;&nbsp;<a href='http://www.cppblog.com/Tongy0/archive/2014/11/14/208874.html'>阅读全文</a><img src ="http://www.cppblog.com/Tongy0/aggbug/208874.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/Tongy0/" target="_blank">Jacc.Kim</a> 2014-11-14 10:02 <a href="http://www.cppblog.com/Tongy0/archive/2014/11/14/208874.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>手机游戏开发之打Log日志</title><link>http://www.cppblog.com/Tongy0/archive/2014/11/13/208865.html</link><dc:creator>Jacc.Kim</dc:creator><author>Jacc.Kim</author><pubDate>Thu, 13 Nov 2014 02:43:00 GMT</pubDate><guid>http://www.cppblog.com/Tongy0/archive/2014/11/13/208865.html</guid><wfw:comment>http://www.cppblog.com/Tongy0/comments/208865.html</wfw:comment><comments>http://www.cppblog.com/Tongy0/archive/2014/11/13/208865.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/Tongy0/comments/commentRss/208865.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/Tongy0/services/trackbacks/208865.html</trackback:ping><description><![CDATA[<div style="border-bottom: #cccccc 1px solid; border-left: #cccccc 1px solid; padding-bottom: 4px; background-color: #eeeeee; padding-left: 4px; width: 98%; padding-right: 5px; font-size: 13px; word-break: break-all; border-top: #cccccc 1px solid; border-right: #cccccc 1px solid; padding-top: 4px"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><span style="color: #008080">&nbsp;1</span>&nbsp;<span style="color: #0000ff">void</span><span style="color: #000000">&nbsp;CLogService::kkLog2(</span><span style="color: #0000ff">const</span><span style="color: #000000">&nbsp;</span><span style="color: #0000ff">char</span><span style="color: #000000">*</span><span style="color: #000000">&nbsp;pszName,&nbsp;</span><span style="color: #0000ff">const</span><span style="color: #000000">&nbsp;</span><span style="color: #0000ff">char</span><span style="color: #000000">*</span><span style="color: #000000">&nbsp;fmt,&nbsp;<img src="http://www.cppblog.com/Images/dot.gif"  alt="" />)&nbsp;{<br /></span><span style="color: #008080">&nbsp;2</span>&nbsp;<span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;cocos2d::CCFileUtils&nbsp;</span><span style="color: #000000">*</span><span style="color: #000000">pCCFileUtils&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;cocos2d::CCFileUtils::sharedFileUtils();<br /></span><span style="color: #008080">&nbsp;3</span>&nbsp;<span style="color: #000000"></span><span style="color: #0000ff">#if</span><span style="color: #000000">&nbsp;defined(WIN32)&nbsp;||&nbsp;defined(_WIN32)</span><span style="color: #000000"><br /></span><span style="color: #008080">&nbsp;4</span>&nbsp;<span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;SSString&nbsp;path&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;getExePath().c_str();<br /></span><span style="color: #008080">&nbsp;5</span>&nbsp;<span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;path&nbsp;</span><span style="color: #000000">+=</span><span style="color: #000000">&nbsp;</span><span style="color: #000000">"</span><span style="color: #000000">log/</span><span style="color: #000000">"</span><span style="color: #000000">;<br /></span><span style="color: #008080">&nbsp;6</span>&nbsp;<span style="color: #000000"></span><span style="color: #0000ff">#elif</span><span style="color: #000000">&nbsp;defined(IOS)&nbsp;||&nbsp;defined(__APPLE__)</span><span style="color: #000000"><br /></span><span style="color: #008080">&nbsp;7</span>&nbsp;<span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;SSString&nbsp;path&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;pCCFileUtils</span><span style="color: #000000">-&gt;</span><span style="color: #000000">getWritablePath();<br /></span><span style="color: #008080">&nbsp;8</span>&nbsp;<span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;path&nbsp;</span><span style="color: #000000">+=</span><span style="color: #000000">&nbsp;</span><span style="color: #000000">"</span><span style="color: #000000">log/</span><span style="color: #000000">"</span><span style="color: #000000">;<br /></span><span style="color: #008080">&nbsp;9</span>&nbsp;<span style="color: #000000"></span><span style="color: #0000ff">#else</span><span style="color: #000000"><br /></span><span style="color: #008080">10</span>&nbsp;<span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;SSString&nbsp;path&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;</span><span style="color: #000000">"</span><span style="color: #000000">/mnt/sdcard/external-sd/</span><span style="color: #000000">"</span><span style="color: #000000">;<br /></span><span style="color: #008080">11</span>&nbsp;<span style="color: #000000"></span><span style="color: #0000ff">#endif</span><span style="color: #000000"><br /></span><span style="color: #008080">12</span>&nbsp;<span style="color: #000000"><br /></span><span style="color: #008080">13</span>&nbsp;<span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;SSString&nbsp;filename&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;path&nbsp;</span><span style="color: #000000">+</span><span style="color: #000000">&nbsp;pszName;<br /></span><span style="color: #008080">14</span>&nbsp;<span style="color: #000000"><br /></span><span style="color: #008080">15</span>&nbsp;<span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;va_list&nbsp;ap;<br /></span><span style="color: #008080">16</span>&nbsp;<span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;va_start(ap,&nbsp;fmt);<br /></span><span style="color: #008080">17</span>&nbsp;<span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">char</span><span style="color: #000000">&nbsp;buf[</span><span style="color: #000000">1024</span><span style="color: #000000">];<br /></span><span style="color: #008080">18</span>&nbsp;<span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;vsprintf(buf,&nbsp;fmt,&nbsp;ap);<br /></span><span style="color: #008080">19</span>&nbsp;<span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;va_end(ap);<br /></span><span style="color: #008080">20</span>&nbsp;<span style="color: #000000"><br /></span><span style="color: #008080">21</span>&nbsp;<span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;std::</span><span style="color: #0000ff">string</span><span style="color: #000000">&nbsp;strTime;<br /></span><span style="color: #008080">22</span>&nbsp;<span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;___getTime(strTime);<br /></span><span style="color: #008080">23</span>&nbsp;<span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;strTime&nbsp;</span><span style="color: #000000">+=</span><span style="color: #000000">&nbsp;</span><span style="color: #000000">"</span><span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">"</span><span style="color: #000000">;<br /></span><span style="color: #008080">24</span>&nbsp;<span style="color: #000000"><br /></span><span style="color: #008080">25</span>&nbsp;<span style="color: #000000"></span><span style="color: #0000ff">#if</span><span style="color: #000000">&nbsp;defined(_WIN32)&nbsp;||&nbsp;defined(WIN32)</span><span style="color: #000000"><br /></span><span style="color: #008080">26</span>&nbsp;<span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;std::</span><span style="color: #0000ff">string</span><span style="color: #000000">&nbsp;strLogText&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;strTime&nbsp;</span><span style="color: #000000">+</span><span style="color: #000000">&nbsp;buf&nbsp;</span><span style="color: #000000">+</span><span style="color: #000000">&nbsp;</span><span style="color: #000000">"</span><span style="color: #000000">\r\n</span><span style="color: #000000">"</span><span style="color: #000000">;<br /></span><span style="color: #008080">27</span>&nbsp;<span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;::OutputDebugStringA((LPCSTR)strLogText.c_str());<br /></span><span style="color: #008080">28</span>&nbsp;<span style="color: #000000"></span><span style="color: #0000ff">#endif</span><span style="color: #000000"><br /></span><span style="color: #008080">29</span>&nbsp;<span style="color: #000000"><br /></span><span style="color: #008080">30</span>&nbsp;<span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #008000">//</span><span style="color: #008000">&nbsp;ensure&nbsp;the&nbsp;path&nbsp;is&nbsp;exist</span><span style="color: #008000"><br /></span><span style="color: #008080">31</span>&nbsp;<span style="color: #008000"></span><span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;_create_dir(path.c_str());<br /></span><span style="color: #008080">32</span>&nbsp;<span style="color: #000000"><br /></span><span style="color: #008080">33</span>&nbsp;<span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;FILE&nbsp;</span><span style="color: #000000">*</span><span style="color: #000000">fp&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;fopen(filename.c_str(),&nbsp;</span><span style="color: #000000">"</span><span style="color: #000000">ab+</span><span style="color: #000000">"</span><span style="color: #000000">);<br /></span><span style="color: #008080">34</span>&nbsp;<span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">if</span><span style="color: #000000">(fp)&nbsp;{<br /></span><span style="color: #008080">35</span>&nbsp;<span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fwrite(strTime.c_str(),&nbsp;strTime.length(),&nbsp;</span><span style="color: #000000">1</span><span style="color: #000000">,&nbsp;fp);<br /></span><span style="color: #008080">36</span>&nbsp;<span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fwrite(buf,&nbsp;strlen(buf),&nbsp;</span><span style="color: #000000">1</span><span style="color: #000000">,&nbsp;fp);<br /></span><span style="color: #008080">37</span>&nbsp;<span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fputs(</span><span style="color: #000000">"</span><span style="color: #000000">\r\n</span><span style="color: #000000">"</span><span style="color: #000000">,&nbsp;fp);<br /></span><span style="color: #008080">38</span>&nbsp;<span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fclose(fp);<br /></span><span style="color: #008080">39</span>&nbsp;<span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;}<br /></span><span style="color: #008080">40</span>&nbsp;<span style="color: #000000">}</span></div><img src ="http://www.cppblog.com/Tongy0/aggbug/208865.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/Tongy0/" target="_blank">Jacc.Kim</a> 2014-11-13 10:43 <a href="http://www.cppblog.com/Tongy0/archive/2014/11/13/208865.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>手机中的可读写路径</title><link>http://www.cppblog.com/Tongy0/archive/2014/11/13/208864.html</link><dc:creator>Jacc.Kim</dc:creator><author>Jacc.Kim</author><pubDate>Thu, 13 Nov 2014 02:42:00 GMT</pubDate><guid>http://www.cppblog.com/Tongy0/archive/2014/11/13/208864.html</guid><wfw:comment>http://www.cppblog.com/Tongy0/comments/208864.html</wfw:comment><comments>http://www.cppblog.com/Tongy0/archive/2014/11/13/208864.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/Tongy0/comments/commentRss/208864.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/Tongy0/services/trackbacks/208864.html</trackback:ping><description><![CDATA[<div>
<div style="border-bottom: #cccccc 1px solid; border-left: #cccccc 1px solid; padding-bottom: 4px; background-color: #eeeeee; padding-left: 4px; width: 98%; padding-right: 5px; font-size: 13px; word-break: break-all; border-top: #cccccc 1px solid; border-right: #cccccc 1px solid; padding-top: 4px"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><span style="color: #008080">&nbsp;1</span>&nbsp;<span style="color: #0000ff">void</span><span style="color: #000000">&nbsp;CShopData::generateWebDataSaveFileName(std::</span><span style="color: #0000ff">string</span><span style="color: #000000">&nbsp;</span><span style="color: #000000">&amp;</span><span style="color: #000000">strFileName)&nbsp;{<br /></span><span style="color: #008080">&nbsp;2</span>&nbsp;<span style="color: #000000"><br /></span><span style="color: #008080">&nbsp;3</span>&nbsp;<span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;CCFileUtils&nbsp;</span><span style="color: #000000">*</span><span style="color: #000000">pCCFileUtils&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;CCFileUtils::sharedFileUtils();<br /></span><span style="color: #008080">&nbsp;4</span>&nbsp;<span style="color: #000000"></span><span style="color: #0000ff">#if</span><span style="color: #000000">&nbsp;defined(WIN32)&nbsp;||&nbsp;defined(_WIN32)</span><span style="color: #000000"><br /></span><span style="color: #008080">&nbsp;5</span>&nbsp;<span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;SSString&nbsp;path&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;</span><span style="color: #000000">""</span><span style="color: #000000">;<br /></span><span style="color: #008080">&nbsp;6</span>&nbsp;<span style="color: #000000"></span><span style="color: #0000ff">#elif</span><span style="color: #000000">&nbsp;defined(IOS)&nbsp;||&nbsp;defined(__APPLE__)</span><span style="color: #000000"><br /></span><span style="color: #008080">&nbsp;7</span>&nbsp;<span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;SSString&nbsp;path&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;pCCFileUtils</span><span style="color: #000000">-&gt;</span><span style="color: #000000">getWritablePath();<br /></span><span style="color: #008080">&nbsp;8</span>&nbsp;<span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #008000">//</span><span style="color: #008000">path&nbsp;+=&nbsp;"log/";</span><span style="color: #008000"><br /></span><span style="color: #008080">&nbsp;9</span>&nbsp;<span style="color: #008000"></span><span style="color: #0000ff">#else</span><span style="color: #000000"><br /></span><span style="color: #008080">10</span>&nbsp;<span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;SSString&nbsp;path&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;</span><span style="color: #000000">"</span><span style="color: #000000">/mnt/sdcard/external-sd/</span><span style="color: #000000">"</span><span style="color: #000000">;<br /></span><span style="color: #008080">11</span>&nbsp;<span style="color: #000000"></span><span style="color: #0000ff">#endif</span><span style="color: #000000"><br /></span><span style="color: #008080">12</span>&nbsp;<span style="color: #000000"><br /></span><span style="color: #008080">13</span>&nbsp;<span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;strFileName&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;path.c_str();<br /></span><span style="color: #008080">14</span>&nbsp;<span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;strFileName&nbsp;</span><span style="color: #000000">+=</span><span style="color: #000000">&nbsp;g_pcszWebDataSaveFile;<br /></span><span style="color: #008080">15</span>&nbsp;<span style="color: #000000"><br /></span><span style="color: #008080">16</span>&nbsp;<span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;CWebUrlConfig&nbsp;</span><span style="color: #000000">*</span><span style="color: #000000">pUrlCfg&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;CWebUrlConfigInstance::singleton();<br /></span><span style="color: #008080">17</span>&nbsp;<span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;std::</span><span style="color: #0000ff">string</span><span style="color: #000000">&nbsp;strGameId&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;pUrlCfg</span><span style="color: #000000">-&gt;</span><span style="color: #000000">getWebUrlAddress(</span><span style="color: #000000">"</span><span style="color: #000000">gameid</span><span style="color: #000000">"</span><span style="color: #000000">);<br /></span><span style="color: #008080">18</span>&nbsp;<span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;strFileName&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;strFileName&nbsp;</span><span style="color: #000000">+</span><span style="color: #000000">&nbsp;strGameId&nbsp;</span><span style="color: #000000">+</span><span style="color: #000000">&nbsp;</span><span style="color: #000000">"</span><span style="color: #000000">.json</span><span style="color: #000000">"</span><span style="color: #000000">;<br /></span><span style="color: #008080">19</span>&nbsp;<span style="color: #000000"><br /></span><span style="color: #008080">20</span>&nbsp;<span style="color: #000000"><br /></span><span style="color: #008080">21</span>&nbsp;<span style="color: #000000"></span><span style="color: #008000">//</span><span style="color: #008000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;strFileName&nbsp;=&nbsp;g_pcszWebDataSaveFile;<br /></span><span style="color: #008080">22</span>&nbsp;<span style="color: #008000"></span><span style="color: #008000">//</span><span style="color: #008000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CWebUrlConfig&nbsp;*pUrlCfg&nbsp;=&nbsp;CWebUrlConfigInstance::singleton();<br /></span><span style="color: #008080">23</span>&nbsp;<span style="color: #008000"></span><span style="color: #008000">//</span><span style="color: #008000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;std::string&nbsp;strGameId&nbsp;=&nbsp;pUrlCfg-&gt;getWebUrlAddress("gameid");<br /></span><span style="color: #008080">24</span>&nbsp;<span style="color: #008000"></span><span style="color: #008000">//</span><span style="color: #008000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;strFileName&nbsp;=&nbsp;strFileName&nbsp;+&nbsp;strGameId&nbsp;+&nbsp;".json";</span><span style="color: #008000"><br /></span><span style="color: #008080">25</span>&nbsp;<span style="color: #008000"></span><span style="color: #000000">}</span></div></div><img src ="http://www.cppblog.com/Tongy0/aggbug/208864.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/Tongy0/" target="_blank">Jacc.Kim</a> 2014-11-13 10:42 <a href="http://www.cppblog.com/Tongy0/archive/2014/11/13/208864.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>C++ Json数据保存与解析(到文件)</title><link>http://www.cppblog.com/Tongy0/archive/2014/10/21/208634.html</link><dc:creator>Jacc.Kim</dc:creator><author>Jacc.Kim</author><pubDate>Tue, 21 Oct 2014 01:49:00 GMT</pubDate><guid>http://www.cppblog.com/Tongy0/archive/2014/10/21/208634.html</guid><wfw:comment>http://www.cppblog.com/Tongy0/comments/208634.html</wfw:comment><comments>http://www.cppblog.com/Tongy0/archive/2014/10/21/208634.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/Tongy0/comments/commentRss/208634.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/Tongy0/services/trackbacks/208634.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 直接上代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->&nbsp;&nbsp;1&nbsp;#include&nbsp;"stdafx.h"&nbsp;&nbsp;2&nbsp;#include&nbsp;&lt;fstream&gt;&nbs...&nbsp;&nbsp;<a href='http://www.cppblog.com/Tongy0/archive/2014/10/21/208634.html'>阅读全文</a><img src ="http://www.cppblog.com/Tongy0/aggbug/208634.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/Tongy0/" target="_blank">Jacc.Kim</a> 2014-10-21 09:49 <a href="http://www.cppblog.com/Tongy0/archive/2014/10/21/208634.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>【转载】Android 开发 之 JNI入门 - NDK从入门到精通</title><link>http://www.cppblog.com/Tongy0/archive/2014/09/19/208355.html</link><dc:creator>Jacc.Kim</dc:creator><author>Jacc.Kim</author><pubDate>Fri, 19 Sep 2014 02:17:00 GMT</pubDate><guid>http://www.cppblog.com/Tongy0/archive/2014/09/19/208355.html</guid><wfw:comment>http://www.cppblog.com/Tongy0/comments/208355.html</wfw:comment><comments>http://www.cppblog.com/Tongy0/archive/2014/09/19/208355.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/Tongy0/comments/commentRss/208355.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/Tongy0/services/trackbacks/208355.html</trackback:ping><description><![CDATA[<div><font style="background-color: #c7edcc">原文转载自：<a href="http://blog.csdn.net/shulianghan/article/details/18964835">http://blog.csdn.net/shulianghan/article/details/18964835</a><br /><br />一篇非常不错的，讲解 java与c++交互、以及使用ndk编并最终用eclipse链接成最终包的流程。原文太长，在此，仅留下原文链接。<br /></font></div><img src ="http://www.cppblog.com/Tongy0/aggbug/208355.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/Tongy0/" target="_blank">Jacc.Kim</a> 2014-09-19 10:17 <a href="http://www.cppblog.com/Tongy0/archive/2014/09/19/208355.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>【转载】一个不错的介绍配置Android SDK Manager安装的教程与注意事项</title><link>http://www.cppblog.com/Tongy0/archive/2014/09/18/208351.html</link><dc:creator>Jacc.Kim</dc:creator><author>Jacc.Kim</author><pubDate>Thu, 18 Sep 2014 07:44:00 GMT</pubDate><guid>http://www.cppblog.com/Tongy0/archive/2014/09/18/208351.html</guid><wfw:comment>http://www.cppblog.com/Tongy0/comments/208351.html</wfw:comment><comments>http://www.cppblog.com/Tongy0/archive/2014/09/18/208351.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/Tongy0/comments/commentRss/208351.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/Tongy0/services/trackbacks/208351.html</trackback:ping><description><![CDATA[<div><font style="background-color: #c7edcc">原文转载自：<a href="https://software.intel.com/zh-cn/blogs/2013/12/17/android-android-sdk-manager">https://software.intel.com/zh-cn/blogs/2013/12/17/android-android-sdk-manager</a><br /><br />
<p style="box-sizing: border-box; widows: 2; text-transform: none; text-indent: 0px; margin: 0px 0px 20px; font: 14px/16px Arial, SimHei, SimSun, 宋体, Tahoma, Helvetica, sans-serif; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(102,102,102); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">在<a style="box-sizing: border-box; color: rgb(0,113,197); text-decoration: none" href="http://software.intel.com/zh-cn/blogs/2013/12/17/android-android">跟燕青一起学Android应用开发（一）：安装Android开发环境</a>一文中，笔者简单的介绍了如何安装Android开发环境。将安装环境搭建好之后，我们需要配置Android SDK Manager，本篇博客将着重解说如何配置Android SDK Manager。</p>
<p style="box-sizing: border-box; widows: 2; text-transform: none; text-indent: 0px; margin: 0px 0px 20px; font: 14px/16px Arial, SimHei, SimSun, 宋体, Tahoma, Helvetica, sans-serif; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(102,102,102); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">Android SDK Manager是Eclipse的一个重要配置，在安装目录下打开eclipse/eclipse.exe执行文件，选择&#8220;Windows&#8221;菜单下的子菜单项&#8220;Android SDK Manager&#8221;，如图1所示。</p>
<p style="box-sizing: border-box; widows: 2; text-transform: none; text-indent: 0px; margin: 0px 0px 20px; font: 14px/16px Arial, SimHei, SimSun, 宋体, Tahoma, Helvetica, sans-serif; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(102,102,102); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" align="center"><a style="box-sizing: border-box; color: rgb(0,113,197); text-decoration: none" href="https://software.intel.com/sites/default/files/managed/0c/b7/Android%20SDK%20Manager01.png"><img style="box-sizing: border-box; border-bottom: 0px; border-left: 0px; width: auto; max-width: 100%; height: auto; border-top: 0px; border-right: 0px" alt="" src="https://software.intel.com/sites/default/files/managed/0c/b7/Android%20SDK%20Manager01.png" /></a></p>
<p style="box-sizing: border-box; widows: 2; text-transform: none; text-indent: 0px; margin: 0px 0px 20px; font: 14px/16px Arial, SimHei, SimSun, 宋体, Tahoma, Helvetica, sans-serif; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(102,102,102); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" align="center">图1</p>
<p style="box-sizing: border-box; widows: 2; text-transform: none; text-indent: 0px; margin: 0px 0px 20px; font: 14px/16px Arial, SimHei, SimSun, 宋体, Tahoma, Helvetica, sans-serif; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(102,102,102); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">&nbsp;</p>
<p style="box-sizing: border-box; widows: 2; text-transform: none; text-indent: 0px; margin: 0px 0px 20px; font: 14px/16px Arial, SimHei, SimSun, 宋体, Tahoma, Helvetica, sans-serif; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(102,102,102); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">在Android SDK Manager中，Android SDK Tools, Android SDK Platform-tools和Android SDK Platform是必须要安装的，如图2所示，其他的项目可以自选。</p>
<p style="box-sizing: border-box; widows: 2; text-transform: none; text-indent: 0px; margin: 0px 0px 20px; font: 14px/16px Arial, SimHei, SimSun, 宋体, Tahoma, Helvetica, sans-serif; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(102,102,102); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" align="center"><a style="box-sizing: border-box; color: rgb(0,113,197); text-decoration: none" href="https://software.intel.com/sites/default/files/managed/df/53/Android%20SDK%20Manager02.png"><img style="box-sizing: border-box; border-bottom: 0px; border-left: 0px; width: auto; max-width: 100%; height: auto; border-top: 0px; border-right: 0px" alt="" src="https://software.intel.com/sites/default/files/managed/df/53/Android%20SDK%20Manager02.png" /></a></p>
<p style="box-sizing: border-box; widows: 2; text-transform: none; text-indent: 0px; margin: 0px 0px 20px; font: 14px/16px Arial, SimHei, SimSun, 宋体, Tahoma, Helvetica, sans-serif; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(102,102,102); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" align="center">图2</p>
<p style="box-sizing: border-box; widows: 2; text-transform: none; text-indent: 0px; margin: 0px 0px 20px; font: 14px/16px Arial, SimHei, SimSun, 宋体, Tahoma, Helvetica, sans-serif; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(102,102,102); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">在本篇博客中，Android4.4（API19）做为安装项目，读者选择它，点击右下角的安装按钮可以开始安装。</p>
<p style="box-sizing: border-box; widows: 2; text-transform: none; text-indent: 0px; margin: 0px 0px 20px; font: 14px/16px Arial, SimHei, SimSun, 宋体, Tahoma, Helvetica, sans-serif; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(102,102,102); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">&nbsp;</p>
<p style="box-sizing: border-box; widows: 2; text-transform: none; text-indent: 0px; margin: 0px 0px 20px; font: 14px/16px Arial, SimHei, SimSun, 宋体, Tahoma, Helvetica, sans-serif; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(102,102,102); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">在安装的时候，我们可能会遇到一个错误，类似信息是: &#8221;<span class="Apple-converted-space">&nbsp;</span><strong style="box-sizing: border-box; font-weight: bold">Missing SDK platform Android, API 19</strong>&#8221;，笔者折腾很很久才发现，这个主要的原因是ADT太老。什么？！在<a style="box-sizing: border-box; color: rgb(0,113,197); text-decoration: none" href="http://software.intel.com/zh-cn/blogs/2013/12/17/android-android">跟燕青一起学Android应用开发（一）：安装Android开发环境</a>一文中，笔者不是下载了最新的ADT，怎么可能太老呢？！没错，笔者也为此思考了半天，后来发现虽然ADT是最新的，但是里面的部分内容还是陈旧的。<strong style="box-sizing: border-box; font-weight: bold">那么如何搞定呢？</strong></p>
<p style="box-sizing: border-box; widows: 2; text-transform: none; text-indent: 0px; margin: 0px 0px 20px; font: 14px/16px Arial, SimHei, SimSun, 宋体, Tahoma, Helvetica, sans-serif; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(102,102,102); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">&nbsp;</p>
<p style="box-sizing: border-box; widows: 2; text-transform: none; text-indent: 0px; margin: 0px 0px 20px; font: 14px/16px Arial, SimHei, SimSun, 宋体, Tahoma, Helvetica, sans-serif; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(102,102,102); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">不急，很简单，只要升级一下eclipse就可以了，如图3所示。打开&#8220;Help&#8220;菜单中的&#8220;Check for Updates&#8221;子菜单，耐心等待一下吧。</p>
<p style="box-sizing: border-box; widows: 2; text-transform: none; text-indent: 0px; margin: 0px 0px 20px; font: 14px/16px Arial, SimHei, SimSun, 宋体, Tahoma, Helvetica, sans-serif; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(102,102,102); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" align="center"><a style="box-sizing: border-box; color: rgb(0,113,197); text-decoration: none" href="https://software.intel.com/sites/default/files/managed/9c/6c/Android%20SDK%20Manager03.png"><img style="box-sizing: border-box; border-bottom: 0px; border-left: 0px; width: auto; max-width: 100%; height: auto; border-top: 0px; border-right: 0px" alt="" src="https://software.intel.com/sites/default/files/managed/9c/6c/Android%20SDK%20Manager03.png" /></a></p>
<p style="box-sizing: border-box; widows: 2; text-transform: none; text-indent: 0px; margin: 0px 0px 20px; font: 14px/16px Arial, SimHei, SimSun, 宋体, Tahoma, Helvetica, sans-serif; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(102,102,102); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" align="center">图3</p>
<p style="box-sizing: border-box; widows: 2; text-transform: none; text-indent: 0px; margin: 0px 0px 20px; font: 14px/16px Arial, SimHei, SimSun, 宋体, Tahoma, Helvetica, sans-serif; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(102,102,102); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">Content.jar包会在耐心的等待中被升级完毕，现在在试试看能否安装了？</p>
<p style="box-sizing: border-box; widows: 2; text-transform: none; text-indent: 0px; margin: 0px 0px 20px; font: 14px/16px Arial, SimHei, SimSun, 宋体, Tahoma, Helvetica, sans-serif; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(102,102,102); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">&nbsp;</p>
<p style="box-sizing: border-box; widows: 2; text-transform: none; text-indent: 0px; margin: 0px 0px 20px; font: 14px/16px Arial, SimHei, SimSun, 宋体, Tahoma, Helvetica, sans-serif; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(102,102,102); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">哈哈哈，估计某人一脸的微笑了吧J</p>
<p style="box-sizing: border-box; widows: 2; text-transform: none; text-indent: 0px; margin: 0px 0px 20px; font: 14px/16px Arial, SimHei, SimSun, 宋体, Tahoma, Helvetica, sans-serif; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(102,102,102); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">&nbsp;</p>
<p style="box-sizing: border-box; widows: 2; text-transform: none; text-indent: 0px; margin: 0px 0px 20px; font: 14px/16px Arial, SimHei, SimSun, 宋体, Tahoma, Helvetica, sans-serif; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(102,102,102); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">对于其他包的安装，只要在Android SDK Manager中选中它们，点击右下角的安装按钮，你就可以泡杯咖啡，翘起二郎腿慢慢享受一段快乐时光了J。</p><br /></font></div><img src ="http://www.cppblog.com/Tongy0/aggbug/208351.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/Tongy0/" target="_blank">Jacc.Kim</a> 2014-09-18 15:44 <a href="http://www.cppblog.com/Tongy0/archive/2014/09/18/208351.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>【转载】DLL导出函数的声明和调用</title><link>http://www.cppblog.com/Tongy0/archive/2014/03/31/206401.html</link><dc:creator>Jacc.Kim</dc:creator><author>Jacc.Kim</author><pubDate>Mon, 31 Mar 2014 01:40:00 GMT</pubDate><guid>http://www.cppblog.com/Tongy0/archive/2014/03/31/206401.html</guid><wfw:comment>http://www.cppblog.com/Tongy0/comments/206401.html</wfw:comment><comments>http://www.cppblog.com/Tongy0/archive/2014/03/31/206401.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/Tongy0/comments/commentRss/206401.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/Tongy0/services/trackbacks/206401.html</trackback:ping><description><![CDATA[文章转载自：http://blog.csdn.net/antoinette/article/details/2112671<br /><br /><br /><span style="color: #333333; font-family: Arial; line-height: 26px; background-color: #ffffff;">导读：&nbsp;</span><br style="color: #333333; font-family: Arial; line-height: 26px; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; line-height: 26px; background-color: #ffffff;">　　</span><strong style="color: #333333; font-family: Arial; line-height: 26px; background-color: #ffffff;">声明导出函数：</strong>&nbsp;<br style="color: #333333; font-family: Arial; line-height: 26px; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; line-height: 26px; background-color: #ffffff;">　　DLL内的函数分两种：只在DLL内部调用的、DLL导出函数&#8212;&#8212;供应用程序调用&nbsp;</span><br style="color: #333333; font-family: Arial; line-height: 26px; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; line-height: 26px; background-color: #ffffff;">　　声明导出函数两种方法：&nbsp;</span><br style="color: #333333; font-family: Arial; line-height: 26px; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; line-height: 26px; background-color: #ffffff;">　　（1）在函数声明中加上extern"C" int _declspec(dllexport)add(int x,int y);//一定要加上extern "C"&nbsp;</span><br style="color: #333333; font-family: Arial; line-height: 26px; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; line-height: 26px; background-color: #ffffff;">　　（2）采用模块定义(.def)文件声明。.def文件为链接器提供了有关被链接程序的导出、属性和其他信息。&nbsp;</span><br style="color: #333333; font-family: Arial; line-height: 26px; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; line-height: 26px; background-color: #ffffff;">　　MFC AppWizard为MFC DLL创建一个.def文件，而Win32 DLL，用户必须自己创建.def文件。&nbsp;</span><br style="color: #333333; font-family: Arial; line-height: 26px; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; line-height: 26px; background-color: #ffffff;">　　.def定义示例代码如下：&nbsp;</span><br style="color: #333333; font-family: Arial; line-height: 26px; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; line-height: 26px; background-color: #ffffff;">　　dll.def:导出DLL函数&nbsp;</span><br style="color: #333333; font-family: Arial; line-height: 26px; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; line-height: 26px; background-color: #ffffff;">　　LIBRARY dllTest&nbsp;</span><br style="color: #333333; font-family: Arial; line-height: 26px; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; line-height: 26px; background-color: #ffffff;">　　DESCRIPTION "math"&nbsp;</span><br style="color: #333333; font-family: Arial; line-height: 26px; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; line-height: 26px; background-color: #ffffff;">　　EXPORTS&nbsp;</span><br style="color: #333333; font-family: Arial; line-height: 26px; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; line-height: 26px; background-color: #ffffff;">　　GlobleVar DATA&nbsp;</span><br style="color: #333333; font-family: Arial; line-height: 26px; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; line-height: 26px; background-color: #ffffff;">　　add @1&nbsp;</span><br style="color: #333333; font-family: Arial; line-height: 26px; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; line-height: 26px; background-color: #ffffff;">　　sub @2&nbsp;</span><br style="color: #333333; font-family: Arial; line-height: 26px; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; line-height: 26px; background-color: #ffffff;">　　.def文件的规则为：&nbsp;</span><br style="color: #333333; font-family: Arial; line-height: 26px; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; line-height: 26px; background-color: #ffffff;">　　（1）LIBRARY语句指出DLL的名字&nbsp;</span><br style="color: #333333; font-family: Arial; line-height: 26px; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; line-height: 26px; background-color: #ffffff;">　　（2）EXPORTS语句后列出一系列函数名称。可以在导出函数后加@n，表示函数序号。&nbsp;</span><br style="color: #333333; font-family: Arial; line-height: 26px; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; line-height: 26px; background-color: #ffffff;">　　（3）;表示注释，且注释不能和语句共享一行。&nbsp;</span><br style="color: #333333; font-family: Arial; line-height: 26px; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; line-height: 26px; background-color: #ffffff;">　　（4）可选部分&#8212;&#8212;DESCRIPTION语句，原来描述DLL的用途。&nbsp;</span><br style="color: #333333; font-family: Arial; line-height: 26px; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; line-height: 26px; background-color: #ffffff;">　　（5）变量名 DATA：导出全局变量&nbsp;</span><br style="color: #333333; font-family: Arial; line-height: 26px; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; line-height: 26px; background-color: #ffffff;">　　</span><strong style="color: #333333; font-family: Arial; line-height: 26px; background-color: #ffffff;">DLL的调用（加载）方式：</strong>&nbsp;<br style="color: #333333; font-family: Arial; line-height: 26px; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; line-height: 26px; background-color: #ffffff;">　　（1）动态调用（显式链接）&nbsp;</span><br style="color: #333333; font-family: Arial; line-height: 26px; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; line-height: 26px; background-color: #ffffff;">　　LoadLibrary()&nbsp;</span><br style="color: #333333; font-family: Arial; line-height: 26px; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; line-height: 26px; background-color: #ffffff;">　　GetProcAddress()&nbsp;</span><br style="color: #333333; font-family: Arial; line-height: 26px; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; line-height: 26px; background-color: #ffffff;">　　FreeLibrary()&nbsp;</span><br style="color: #333333; font-family: Arial; line-height: 26px; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; line-height: 26px; background-color: #ffffff;">　　（2）静态调用（隐式链接）&nbsp;</span><br style="color: #333333; font-family: Arial; line-height: 26px; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; line-height: 26px; background-color: #ffffff;">　　由编译系统完成对DLL的加载和应用程序结束时对DLL的卸载。需要做两个工作：&nbsp;</span><br style="color: #333333; font-family: Arial; line-height: 26px; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; line-height: 26px; background-color: #ffffff;">　　a：将编译dll工程所得的.lib和.dll文件放入调用dll工程所在的路径。&nbsp;</span><br style="color: #333333; font-family: Arial; line-height: 26px; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; line-height: 26px; background-color: #ffffff;">　　包含.lib文件：#pragma comment(lib,"dllTest.lib")&nbsp;</span><br style="color: #333333; font-family: Arial; line-height: 26px; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; line-height: 26px; background-color: #ffffff;">　　or project-&gt;setting-&gt;link-&gt;...&nbsp;</span><br style="color: #333333; font-family: Arial; line-height: 26px; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; line-height: 26px; background-color: #ffffff;">　　b:声明导入函数，extern "C" int _declspec(dllimport) add(int x,int y)中的_declspec(dllimport)//must add extern "C"&nbsp;</span><br style="color: #333333; font-family: Arial; line-height: 26px; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; line-height: 26px; background-color: #ffffff;">　　Trackback: http://tb.blog.csdn.net/TrackBack.aspx?PostId=1881088&nbsp;</span><br style="color: #333333; font-family: Arial; line-height: 26px; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; line-height: 26px; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; line-height: 26px; background-color: #ffffff;">本文转自&nbsp;</span><br style="color: #333333; font-family: Arial; line-height: 26px; background-color: #ffffff;" /><a href="http://blog.csdn.net/blueshelly/archive/2007/11/12/1881088.aspx" style="color: #336699; text-decoration: none; font-family: Arial; line-height: 26px; background-color: #ffffff;">http://blog.csdn.net/blueshelly/archive/2007/11/12/1881088.aspx</a><img src ="http://www.cppblog.com/Tongy0/aggbug/206401.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/Tongy0/" target="_blank">Jacc.Kim</a> 2014-03-31 09:40 <a href="http://www.cppblog.com/Tongy0/archive/2014/03/31/206401.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>用 std::stringstream 将数值型转 string 时有坑</title><link>http://www.cppblog.com/Tongy0/archive/2014/03/28/206374.html</link><dc:creator>Jacc.Kim</dc:creator><author>Jacc.Kim</author><pubDate>Fri, 28 Mar 2014 03:21:00 GMT</pubDate><guid>http://www.cppblog.com/Tongy0/archive/2014/03/28/206374.html</guid><wfw:comment>http://www.cppblog.com/Tongy0/comments/206374.html</wfw:comment><comments>http://www.cppblog.com/Tongy0/archive/2014/03/28/206374.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/Tongy0/comments/commentRss/206374.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/Tongy0/services/trackbacks/206374.html</trackback:ping><description><![CDATA[众所周知，用stringstream实现数值型与string进行互转是十分方便的。<br />但它不是万能的。有着许多限制。下面就列出几点让人比较郁闷的，也是问题比较大条的坑，大伙需警惕。<br />坑 1：<br />如果待转换的数值型为整型，且值为0时，则转换出来的字符串去并不是："0"。<br />调试跟踪后，发现最终结果是一个，类似：""(即：空字符串)，却并非空字符串的东西。<br />亦不是："\0"或"\n"或" "，到现在本人仍不清楚结果是什么东东。<br /><br />坑 2：<br />对于十六进制，无法正常转换。<br /><br />坑 3：<br />对于待转换的内容中，含有非[0..9]与[.]的内容，则转一般都会出错。（甚者，可能会蹦）<img src ="http://www.cppblog.com/Tongy0/aggbug/206374.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/Tongy0/" target="_blank">Jacc.Kim</a> 2014-03-28 11:21 <a href="http://www.cppblog.com/Tongy0/archive/2014/03/28/206374.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>