﻿<?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++博客-SearchDream</title><link>http://www.cppblog.com/SearchDream/</link><description>SearchDream</description><language>zh-cn</language><lastBuildDate>Tue, 14 Apr 2026 23:06:47 GMT</lastBuildDate><pubDate>Tue, 14 Apr 2026 23:06:47 GMT</pubDate><ttl>60</ttl><item><title>Struct Member Alignment</title><link>http://www.cppblog.com/SearchDream/archive/2010/11/25/134614.html</link><dc:creator>SearchDream</dc:creator><author>SearchDream</author><pubDate>Thu, 25 Nov 2010 05:32:00 GMT</pubDate><guid>http://www.cppblog.com/SearchDream/archive/2010/11/25/134614.html</guid><wfw:comment>http://www.cppblog.com/SearchDream/comments/134614.html</wfw:comment><comments>http://www.cppblog.com/SearchDream/archive/2010/11/25/134614.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/SearchDream/comments/commentRss/134614.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/SearchDream/services/trackbacks/134614.html</trackback:ping><description><![CDATA[
<p style="font-family: 'Segoe UI', Verdana, Arial; font-size: 13px; "></p><p>ontrols how the members of a structure are packed into memory and specifies the same packing for all structures in a module.</p><p>Copy</p><p>/Zp[1|2|4|8|16]</p><p><br></p><p>When you specify this option, each structure member after the first is stored on either the size of the member type or n-byte boundaries (where n is 1, 2, 4, 8, or 16), whichever is smaller.</p><p>The available values are described in the following table.</p><p>1 Packs structures on 1-byte boundaries. Same as /Zp.</p><p>2 Packs structures on 2-byte boundaries.</p><p>4 Packs structures on 4-byte boundaries.</p><p>8 Packs structures on 8-byte boundaries (default).</p><p>16 Packs structures on 16-byte boundaries.</p><p>You should not use this option unless you have specific alignment requirements.</p><p>&#160;</p><img src ="http://www.cppblog.com/SearchDream/aggbug/134614.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/SearchDream/" target="_blank">SearchDream</a> 2010-11-25 13:32 <a href="http://www.cppblog.com/SearchDream/archive/2010/11/25/134614.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>A surprise from C++</title><link>http://www.cppblog.com/SearchDream/archive/2010/07/29/121565.html</link><dc:creator>SearchDream</dc:creator><author>SearchDream</author><pubDate>Thu, 29 Jul 2010 04:18:00 GMT</pubDate><guid>http://www.cppblog.com/SearchDream/archive/2010/07/29/121565.html</guid><wfw:comment>http://www.cppblog.com/SearchDream/comments/121565.html</wfw:comment><comments>http://www.cppblog.com/SearchDream/archive/2010/07/29/121565.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/SearchDream/comments/commentRss/121565.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/SearchDream/services/trackbacks/121565.html</trackback:ping><description><![CDATA[

<div><a href="http://faqs.cs.uu.nl/na-dir/C++-faq/part08.html">http://faqs.cs.uu.nl/na-dir/C++-faq/part08.html</a></div><div><pre>[16.7] Do I need to check for NULL before delete p?

No!

The C++ language guarantees that delete p will do nothing if p is equal to
NULL.  Since you might get the test backwards, and since most testing
methodologies force you to explicitly test every branch point, you should not
put in the redundant if test.

Wrong:

 if (p != NULL)
   delete p;

Right:

 delete p;</pre></div><img src ="http://www.cppblog.com/SearchDream/aggbug/121565.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/SearchDream/" target="_blank">SearchDream</a> 2010-07-29 12:18 <a href="http://www.cppblog.com/SearchDream/archive/2010/07/29/121565.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>memory align of Visual Studio 2008 __int64 in struct</title><link>http://www.cppblog.com/SearchDream/archive/2010/07/02/119143.html</link><dc:creator>SearchDream</dc:creator><author>SearchDream</author><pubDate>Fri, 02 Jul 2010 01:48:00 GMT</pubDate><guid>http://www.cppblog.com/SearchDream/archive/2010/07/02/119143.html</guid><wfw:comment>http://www.cppblog.com/SearchDream/comments/119143.html</wfw:comment><comments>http://www.cppblog.com/SearchDream/archive/2010/07/02/119143.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/SearchDream/comments/commentRss/119143.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/SearchDream/services/trackbacks/119143.html</trackback:ping><description><![CDATA[Seems if struct contain __int64 or unsigned __int64 the compiler will force to use 8 byte if you not use pack to give explicit value.<img src ="http://www.cppblog.com/SearchDream/aggbug/119143.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/SearchDream/" target="_blank">SearchDream</a> 2010-07-02 09:48 <a href="http://www.cppblog.com/SearchDream/archive/2010/07/02/119143.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>[转]OpenSSL Compilation on Win32</title><link>http://www.cppblog.com/SearchDream/archive/2010/04/30/114072.html</link><dc:creator>SearchDream</dc:creator><author>SearchDream</author><pubDate>Fri, 30 Apr 2010 09:03:00 GMT</pubDate><guid>http://www.cppblog.com/SearchDream/archive/2010/04/30/114072.html</guid><wfw:comment>http://www.cppblog.com/SearchDream/comments/114072.html</wfw:comment><comments>http://www.cppblog.com/SearchDream/archive/2010/04/30/114072.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/SearchDream/comments/commentRss/114072.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/SearchDream/services/trackbacks/114072.html</trackback:ping><description><![CDATA[Original link:&nbsp;<a href="http://naughter.spaces.live.com/Blog/cns!7692E6D72E26EAC!209.entry">http://naughter.spaces.live.com/Blog/cns!7692E6D72E26EAC!209.entry</a><div><span  style="line-height: 17px; color: rgb(68, 68, 68); font-family: Tahoma, Verdana, Arial; font-size: 13px; "><p style="line-height: 17px; margin-top: 0px; margin-right: 0px; margin-bottom: 1.35em; margin-left: 0px; ">Following on from my "Common problems compiling my code" blog entry, another popular email question I get is related to my SMTP class is problems related to getting OpenSSL support compiled into the class. Here's a snippet from the OpenSSLMfc.h header file which provides a simple encapsulation of a socket connection using OpenSSL:</p><p style="line-height: 17px; margin-top: 0px; margin-right: 0px; margin-bottom: 1.35em; margin-left: 0px; ">#include &lt;openssl\ssl.h&gt; //If you get a compilation error about this missing header file, then you need to download OpenSSL from http://www.openssl.org and build a Win32 version and incorporate it into Visual C<br style="line-height: 17px; ">#include &lt;openssl\err.h&gt; //If you get a compilation error about this missing header file, then you need to download OpenSSL from http://www.openssl.org and build a Win32 version and incorporate it into Visual C<br style="line-height: 17px; ">#include "SocMFC.h"</p><p style="line-height: 17px; margin-top: 0px; margin-right: 0px; margin-bottom: 1.35em; margin-left: 0px; ">As you can see it references the OpenSSL header files "ssl.h" and "err.h". You can download&nbsp;OpenSSL directly as the code comments mention above from&nbsp;<a href="http://www.openssl.org/" style="line-height: 17px; font-weight: inherit; text-decoration: none; color: rgb(0, 102, 167); cursor: pointer; ">http://www.openssl.org</a>. As of 7th of July 2007, the latest version of OpenSSL is 0.9.8e. Once you have downloaded OpenSSL you should read and follow the build instructions in the file INSTALL.W32 included in the OpenSSL download. Basically the steps are:</p><ol style="line-height: 17px; "><li style="line-height: 17px; margin-top: 0px; margin-right: 0px; margin-bottom: 3px; margin-left: 0px; ">You will need to have Perl for Win32 installed. If you do not have it you can download ActiveState Perl from<a title="http://www.activestate.com/ActivePerl" href="http://www.activestate.com/ActivePerl" style="line-height: 17px; font-weight: inherit; text-decoration: none; color: rgb(0, 102, 167); cursor: pointer; ">http://www.activestate.com/ActivePerl</a></li><li style="line-height: 17px; margin-top: 0px; margin-right: 0px; margin-bottom: 3px; margin-left: 0px; ">Bring up a Visual Studio command prompt,&nbsp;navigate to the OpenSSL install directory (say c:\some\openssl)&nbsp;and run Configure as follows:&nbsp;<br style="line-height: 17px; ">perl Configure VC-WIN32 --prefix=c:/some/openssl/dir<br style="line-height: 17px; ">This assumes that you have setup perl to be in your search path</li><li style="line-height: 17px; margin-top: 0px; margin-right: 0px; margin-bottom: 3px; margin-left: 0px; ">Assuming you do not want to mess about with assembly language, type ms\do_ms from your command prompt. Examine the window for any errors.</li><li style="line-height: 17px; margin-top: 0px; margin-right: 0px; margin-bottom: 3px; margin-left: 0px; ">Then type nmake -f ms\ntdll.mak which will actually perform the compile and link of the OpenSSL code. This may take a while. When it finishes examine the out32dll directory which should contain the OpenSSL DLLs and executables. Note that by default this will only produce "release" mode binaries and you need to manually edit and rerun the make process if you want to create "debug" binaries. Also to avoid the "debug" binaries overwritting the already created "release" binaries, you need to edit the make file or backup the existing binary files. Basically this step is a bit of a mess to get right!</li><li style="line-height: 17px; margin-top: 0px; margin-right: 0px; margin-bottom: 3px; margin-left: 0px; ">Point your copy of VC to the appropriate Include and Lib directories. In our example this would be "c:\some\openssl\inc32"&nbsp;and "c:\some\openssl\out32dll"&nbsp;respectively. If you are using Visual Studio 2005, this would be using the menu item "Tools -&gt; Options -&gt; Projects and Solutions -&gt; VC++ Directories -&gt; "Include Files" &amp; "Library Files"</li><li style="line-height: 17px; margin-top: 0px; margin-right: 0px; margin-bottom: 3px; margin-left: 0px; ">Update your project linker settings to link to the correct OpenSSL libraries. This will normally be ssleay32.lib libeay32.lib for release mode builds.</li></ol><p style="line-height: 17px; margin-top: 0px; margin-right: 0px; margin-bottom: 1.35em; margin-left: 0px; ">If all of the steps above prove to be too much work, then a company called&nbsp;<a href="http://www.slproweb.com/" style="line-height: 17px; font-weight: inherit; text-decoration: none; color: rgb(0, 102, 167); cursor: pointer; ">Shining Light Productions</a>&nbsp;have very kindly packaged up the end results of all this work into a nice and simple&nbsp;installation package for us Windows developers.</p><ol style="line-height: 17px; "><li style="line-height: 17px; margin-top: 0px; margin-right: 0px; margin-bottom: 3px; margin-left: 0px; ">You can download the Win32 OpenSSL Installation Project from&nbsp;<a title="http://www.slproweb.com/products/Win32OpenSSL.html" href="http://www.slproweb.com/products/Win32OpenSSL.html" style="line-height: 17px; font-weight: inherit; text-decoration: none; color: rgb(0, 102, 167); cursor: pointer; ">http://www.slproweb.com/products/Win32OpenSSL.html</a>. As of 7th of July 2007,&nbsp;you can download either OpenSSL v0.9.8e and v0.9.7m.&nbsp;Both of these are the most recent builds from each stream of OpenSSL. When you install the download on your machine, you end up with the&nbsp;static import libraries in a "Lib\VC\static" directory below the install directory, the DLL import libraries in a "Lib\VC" directory and the main include files in a "include" directory (again both below the install directory).&nbsp;The download&nbsp;a new developer to OpenSSL should select is the "Win32 OpenSSL v0.9.8e download" link.</li><li style="line-height: 17px; margin-top: 0px; margin-right: 0px; margin-bottom: 3px; margin-left: 0px; ">To complete the integration with VC, setup the Include and Lib directories as in Step 5 above. Assuming you installed the Win32 OpenSSL project into C:\dev\openssl-0.9.8e, you would add "c:\dev\openssl-0.9.8e\include" to the Include setting and "C:\dev\openssl-0.9.8e\lib" to the Lib setting in VC.</li><li style="line-height: 17px; margin-top: 0px; margin-right: 0px; margin-bottom: 3px; margin-left: 0px; ">You&nbsp;need to link to the correct import library depending on how you build your code. 8 different DLL import lib files are provided in the Lib\VC directory and a further 8 in the Lib\VC\Static directory. The 2 OpenSSL libraries namely libeay and ssleay each come in 4 varieties with the Win32 OpenSSL Project, resulting in 8 DLL import libraries and 8 static import libraries. These are:<br style="line-height: 17px; "><br style="line-height: 17px; ">libeay32MD.lib<br style="line-height: 17px; ">libeay32MDd.lib<br style="line-height: 17px; ">libeay32MT.lib<br style="line-height: 17px; ">libeay32MTd.lib<br style="line-height: 17px; ">ssleay32MD.lib<br style="line-height: 17px; ">ssleay32MDd.lib<br style="line-height: 17px; ">ssleay32MT.lib<br style="line-height: 17px; ">ssleay32MTd.lib<br style="line-height: 17px; "><br style="line-height: 17px; ">Which ones you use depend on how you are building your client project and its use of the VC runtime. For more information see<a title="http://msdn2.microsoft.com/en-us/library/2kzt1wy3(VS.80).aspx" href="http://msdn2.microsoft.com/en-us/library/2kzt1wy3(VS.80).aspx" style="line-height: 17px; font-weight: inherit; text-decoration: none; color: rgb(0, 102, 167); cursor: pointer; ">http://msdn2.microsoft.com/en-us/library/2kzt1wy3(VS.80).aspx</a>. The differences basically correspond to whether you want to use the VC runtime DLL or statically embed the VC runtime in your application.</li></ol><p style="line-height: 17px; margin-top: 0px; margin-right: 0px; margin-bottom: 1.35em; margin-left: 0px; ">Hopefully this info will help you get up and running with OpenSSL and my SSL classes in your own code.</p><p style="line-height: 17px; margin-top: 0px; margin-right: 0px; margin-bottom: 1.35em; margin-left: 0px; ">Happy coding!</p></span></div><img src ="http://www.cppblog.com/SearchDream/aggbug/114072.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/SearchDream/" target="_blank">SearchDream</a> 2010-04-30 17:03 <a href="http://www.cppblog.com/SearchDream/archive/2010/04/30/114072.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>[转]Set up sqlite static lib and a C++ wrapper in 15 minutes</title><link>http://www.cppblog.com/SearchDream/archive/2010/04/30/114069.html</link><dc:creator>SearchDream</dc:creator><author>SearchDream</author><pubDate>Fri, 30 Apr 2010 08:39:00 GMT</pubDate><guid>http://www.cppblog.com/SearchDream/archive/2010/04/30/114069.html</guid><wfw:comment>http://www.cppblog.com/SearchDream/comments/114069.html</wfw:comment><comments>http://www.cppblog.com/SearchDream/archive/2010/04/30/114069.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/SearchDream/comments/commentRss/114069.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/SearchDream/services/trackbacks/114069.html</trackback:ping><description><![CDATA[<span  style="font-family: Verdana, Arial, Helvetica; font-size: 12px; line-height: 16px; "><p style="margin-top: 2px; margin-right: 0px; margin-bottom: 1.1em; margin-left: 0px; text-align: left; ">Original link:&nbsp;<a href="http://news.thedigitalmachine.com/2007/03/28/set-up-sqlite-static-lib-and-a-c-wrapper-in-15-minutes/">http://news.thedigitalmachine.com/2007/03/28/set-up-sqlite-static-lib-and-a-c-wrapper-in-15-minutes/</a></p><p style="margin-top: 2px; margin-right: 0px; margin-bottom: 1.1em; margin-left: 0px; text-align: left; "><a href="http://sqlite.org/" style="outline-style: none; outline-width: initial; outline-color: initial; color: rgb(48, 106, 163); text-decoration: none; ">sqlite</a>&nbsp;is a sweet little answer to database storage for stand-alone applications.&nbsp;<a href="http://www.codeproject.com/database/CppSQLite.asp" style="outline-style: none; outline-width: initial; outline-color: initial; color: rgb(48, 106, 163); text-decoration: none; ">CppSQLite</a>&nbsp;is the best C++ wrapper I found (NOTE: there are&nbsp;<a href="http://www.sqlite.org/cvstrac/wiki?p=SqliteWrappers" style="outline-style: none; outline-width: initial; outline-color: initial; color: rgb(48, 106, 163); text-decoration: none; ">many</a>). I didn&#8217;t find any quick instructions to get the C code statically linked into a Visual Studio 2005 C++ app, so here they are. At the end, I had all the code wrapped nicely into my application with a size increase of 132kb &#8211; and no dependencies! Whoop.<br><span id="more-154"></span></p><p style="margin-top: 2px; margin-right: 0px; margin-bottom: 1.1em; margin-left: 0px; text-align: left; ">You can just&nbsp;<a href="http://thedigitalmachine.com/files/sqlite_static_with_wrapper.zip" style="outline-style: none; outline-width: initial; outline-color: initial; color: rgb(48, 106, 163); text-decoration: none; ">grab the files here</a>&nbsp;if you don&#8217;t care about the gory details. Read the included Readme.txt file for quick setup instructions. Everything you need is included, including v3.3.13 of the sqlite source and v3.1 of the CppSQLite files.</p><p style="margin-top: 2px; margin-right: 0px; margin-bottom: 1.1em; margin-left: 0px; text-align: left; ">Now for the blow-by-blow setup of how to do the static library build yourself. It&#8217;s not brain surgery, but it&#8217;s good to know &#8211; for example, if you want to use a newer version of the source code (in case I get lazy and don&#8217;t update this).</p><ul style="list-style-position: outside; margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 3em; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><li style="list-style-position: outside; margin-top: 0.2em; margin-right: 0px; margin-bottom: 0.2em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">create a new Visual Studio 2005 Win32 console application</li><li style="list-style-position: outside; margin-top: 0.2em; margin-right: 0px; margin-bottom: 0.2em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">during creation, under advanced options&#8230;<br>- change build target type to &#8220;static library&#8221;<br>- uncheck &#8220;precompiled header&#8221;</li><li style="list-style-position: outside; margin-top: 0.2em; margin-right: 0px; margin-bottom: 0.2em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">add NO_TCL to preprocessor definitions<br>- Go here: Project-&gt;Properties-&gt;Configuration Properties-&gt;C/C++-&gt;Preprocessor-&gt;Preprocessor Definitions<br>- Add NO_TCL to the existing lists of all configurations, to bypass inclusion of TCL support</li><li style="list-style-position: outside; margin-top: 0.2em; margin-right: 0px; margin-bottom: 0.2em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">change the runtime library (to match whatever project that will be linking to the sqlite library you build)<br>- Found here: Project-&gt;Properties-&gt;Configuration Properties-&gt;C/C++-&gt;Code Generation-&gt;Runtime Library</li><li style="list-style-position: outside; margin-top: 0.2em; margin-right: 0px; margin-bottom: 0.2em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">download the&nbsp;<a href="http://sqlite.org/sqlite-source-3_3_13.zip" style="outline-style: none; outline-width: initial; outline-color: initial; color: rgb(48, 106, 163); text-decoration: none; ">preprocessed source code</a>&nbsp;and add it to the project</li><li style="list-style-position: outside; margin-top: 0.2em; margin-right: 0px; margin-bottom: 0.2em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">(optional) disable the more neurotic VS8 warnings (even though you can safely ignore them)&#8230;<br>- add _CRT_SECURE_NO_WARNINGS to preprocessor definitions:<br>- &#8211; Go here: Project-&gt;Properties-&gt;Configuration Properties-&gt;C/C++-&gt;Preprocessor-&gt;Preprocessor Definitions<br>- &#8211; Add _CRT_SECURE_NO_WARNINGS to the existing lists of all configurations</li><p style="margin-top: 2px; margin-right: 0px; margin-bottom: 1.1em; margin-left: 0px; text-align: left; ">- disable the following warnings (Project-&gt;Properties-&gt;C/C++-&gt;Advanced-&gt;Disable Specific Warnings):<br>- &#8211; 4267;4244;4018;4311;4996;4312;4311</p><li style="list-style-position: outside; margin-top: 0.2em; margin-right: 0px; margin-bottom: 0.2em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">compile!</li><li style="list-style-position: outside; margin-top: 0.2em; margin-right: 0px; margin-bottom: 0.2em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">include the resulting static library, along with the CppSQLite wrapper class, in your shiny new project</li><li style="list-style-position: outside; margin-top: 0.2em; margin-right: 0px; margin-bottom: 0.2em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><a href="http://www.codeproject.com/database/CppSQLite.asp" style="outline-style: none; outline-width: initial; outline-color: initial; color: rgb(48, 106, 163); text-decoration: none; ">read about CppSQLite</a>&nbsp;and write some code!</li></ul></span>
<img src ="http://www.cppblog.com/SearchDream/aggbug/114069.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/SearchDream/" target="_blank">SearchDream</a> 2010-04-30 16:39 <a href="http://www.cppblog.com/SearchDream/archive/2010/04/30/114069.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>[转]Dump just the table structure to a file in MySQL</title><link>http://www.cppblog.com/SearchDream/archive/2010/03/03/108782.html</link><dc:creator>SearchDream</dc:creator><author>SearchDream</author><pubDate>Wed, 03 Mar 2010 06:28:00 GMT</pubDate><guid>http://www.cppblog.com/SearchDream/archive/2010/03/03/108782.html</guid><wfw:comment>http://www.cppblog.com/SearchDream/comments/108782.html</wfw:comment><comments>http://www.cppblog.com/SearchDream/archive/2010/03/03/108782.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/SearchDream/comments/commentRss/108782.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/SearchDream/services/trackbacks/108782.html</trackback:ping><description><![CDATA[<p>For this exercise, we will use the mysqldump utility the same as if we were <a  href="http://www.howtogeek.com/howto/programming/mysql/backup-mysql-database-to-a-file/">backing up the entire database.</a></p>
<p>Syntax:</p>
<blockquote>
<p>mysqldump -d -h localhost -u root -pmypassword databasename &gt; dumpfile.sql</p>
</blockquote>
<p>The only option that is different than creating an entire backup is the -d switch, which tells mysqldump not to output the data.</p>
<p>Example:</p>
<blockquote>
<p>mysqldump -d&nbsp;-h localhost -u root -p2Uad7as9 database01 &gt; dumpfile.sql</p>
</blockquote><img src ="http://www.cppblog.com/SearchDream/aggbug/108782.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/SearchDream/" target="_blank">SearchDream</a> 2010-03-03 14:28 <a href="http://www.cppblog.com/SearchDream/archive/2010/03/03/108782.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>HexStringToBinary</title><link>http://www.cppblog.com/SearchDream/archive/2010/03/01/108673.html</link><dc:creator>SearchDream</dc:creator><author>SearchDream</author><pubDate>Mon, 01 Mar 2010 09:08:00 GMT</pubDate><guid>http://www.cppblog.com/SearchDream/archive/2010/03/01/108673.html</guid><wfw:comment>http://www.cppblog.com/SearchDream/comments/108673.html</wfw:comment><comments>http://www.cppblog.com/SearchDream/archive/2010/03/01/108673.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/SearchDream/comments/commentRss/108673.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/SearchDream/services/trackbacks/108673.html</trackback:ping><description><![CDATA[<div style="background-color: rgb(238, 238, 238); font-size: 13px; border-left-color: rgb(204, 204, 204); padding-right: 5px; padding-bottom: 4px; padding-left: 4px; padding-top: 4px; width: 98%; word-break: break-all; "><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><span style="color: #0000FF; ">void</span><span style="color: #000000; ">&nbsp;HexStringToBinary(</span><span style="color: #0000FF; ">char</span><span style="color: #000000; ">*</span><span style="color: #000000; ">&nbsp;szHex,&nbsp;vector</span><span style="color: #000000; ">&lt;</span><span style="color: #000000; ">unsigned&nbsp;</span><span style="color: #0000FF; ">char</span><span style="color: #000000; ">&gt;</span><span style="color: #000000; ">&nbsp;</span><span style="color: #000000; ">&amp;</span><span style="color: #000000; ">&nbsp;vBinary)<br>{<br>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000FF; ">const</span><span style="color: #000000; ">&nbsp;unsigned&nbsp;</span><span style="color: #0000FF; ">int</span><span style="color: #000000; ">&nbsp;size&nbsp;</span><span style="color: #000000; ">=</span><span style="color: #000000; ">&nbsp;</span><span style="color: #0000FF; ">sizeof</span><span style="color: #000000; ">(szHex)&nbsp;</span><span style="color: #000000; ">/</span><span style="color: #000000; ">&nbsp;</span><span style="color: #0000FF; ">sizeof</span><span style="color: #000000; ">(szHex[</span><span style="color: #000000; ">0</span><span style="color: #000000; ">])&nbsp;</span><span style="color: #000000; ">/</span><span style="color: #000000; ">&nbsp;</span><span style="color: #000000; ">2</span><span style="color: #000000; ">;<br><br>&nbsp;&nbsp;&nbsp;&nbsp;vBinary.resize(size);<br><br>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000FF; ">for</span><span style="color: #000000; ">&nbsp;(</span><span style="color: #0000FF; ">int</span><span style="color: #000000; ">&nbsp;i&nbsp;</span><span style="color: #000000; ">=</span><span style="color: #000000; ">&nbsp;</span><span style="color: #000000; ">0</span><span style="color: #000000; ">;&nbsp;i&nbsp;</span><span style="color: #000000; ">&lt;</span><span style="color: #000000; ">&nbsp;size;&nbsp;i</span><span style="color: #000000; ">++</span><span style="color: #000000; ">)<br>&nbsp;&nbsp;&nbsp;&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000FF; ">if</span><span style="color: #000000; ">&nbsp;(sscanf(szHex&nbsp;</span><span style="color: #000000; ">+</span><span style="color: #000000; ">&nbsp;</span><span style="color: #000000; ">2</span><span style="color: #000000; ">&nbsp;</span><span style="color: #000000; ">*</span><span style="color: #000000; ">&nbsp;i,&nbsp;</span><span style="color: #000000; ">"</span><span style="color: #000000; ">%2X</span><span style="color: #000000; ">"</span><span style="color: #000000; ">,&nbsp;</span><span style="color: #000000; ">&amp;</span><span style="color: #000000; ">vBinary[i])&nbsp;</span><span style="color: #000000; ">!=</span><span style="color: #000000; ">&nbsp;</span><span style="color: #000000; ">1</span><span style="color: #000000; ">)&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000FF; ">break</span><span style="color: #000000; ">;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>&nbsp;&nbsp;&nbsp;&nbsp;}<br>}</span></div><img src ="http://www.cppblog.com/SearchDream/aggbug/108673.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/SearchDream/" target="_blank">SearchDream</a> 2010-03-01 17:08 <a href="http://www.cppblog.com/SearchDream/archive/2010/03/01/108673.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>单个字符的十六进制输出</title><link>http://www.cppblog.com/SearchDream/archive/2009/12/29/104348.html</link><dc:creator>SearchDream</dc:creator><author>SearchDream</author><pubDate>Tue, 29 Dec 2009 03:09:00 GMT</pubDate><guid>http://www.cppblog.com/SearchDream/archive/2009/12/29/104348.html</guid><wfw:comment>http://www.cppblog.com/SearchDream/comments/104348.html</wfw:comment><comments>http://www.cppblog.com/SearchDream/archive/2009/12/29/104348.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/SearchDream/comments/commentRss/104348.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/SearchDream/services/trackbacks/104348.html</trackback:ping><description><![CDATA[代码如下:<br><br>
<div style="border: 1px solid #cccccc; padding: 4px 5px 4px 4px; background-color: #eeeeee; font-size: 13px; width: 98%;"><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><span style="color: #008080;">1</span>&nbsp;<span style="color: #000000;">printf(</span><span style="color: #000000;">"</span><span style="color: #000000;">%02x&nbsp;%02x&nbsp;%02x&nbsp;%02x</span><span style="color: #000000;">"</span><span style="color: #000000;">,<br></span><span style="color: #008080;">2</span>&nbsp;<span style="color: #000000;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(unsigned&nbsp;</span><span style="color: #0000ff;">char</span><span style="color: #000000;">)pData[</span><span style="color: #000000;">0</span><span style="color: #000000;">],&nbsp;(unsigned&nbsp;</span><span style="color: #0000ff;">char</span><span style="color: #000000;">)pData[</span><span style="color: #000000;">1</span><span style="color: #000000;">],<br></span><span style="color: #008080;">3</span>&nbsp;<span style="color: #000000;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(unsigned&nbsp;</span><span style="color: #0000ff;">char</span><span style="color: #000000;">)pData[</span><span style="color: #000000;">2</span><span style="color: #000000;">],&nbsp;(unsigned&nbsp;</span><span style="color: #0000ff;">char</span><span style="color: #000000;">)pData[</span><span style="color: #000000;">3</span><span style="color: #000000;">]);</span></div>
<br><br><img src ="http://www.cppblog.com/SearchDream/aggbug/104348.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/SearchDream/" target="_blank">SearchDream</a> 2009-12-29 11:09 <a href="http://www.cppblog.com/SearchDream/archive/2009/12/29/104348.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>CreateRemoteThread注入DLL到其他进程</title><link>http://www.cppblog.com/SearchDream/archive/2009/12/28/104306.html</link><dc:creator>SearchDream</dc:creator><author>SearchDream</author><pubDate>Mon, 28 Dec 2009 13:33:00 GMT</pubDate><guid>http://www.cppblog.com/SearchDream/archive/2009/12/28/104306.html</guid><wfw:comment>http://www.cppblog.com/SearchDream/comments/104306.html</wfw:comment><comments>http://www.cppblog.com/SearchDream/archive/2009/12/28/104306.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/SearchDream/comments/commentRss/104306.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/SearchDream/services/trackbacks/104306.html</trackback:ping><description><![CDATA[记录一点心得：Unicode的Version中需要注意，在传递DLL的路径时需要加两个字节的0x00作为结尾标志.<br>其他的可以参考下面两个文章：<br>http://www.codeproject.com/KB/threads/completeinject.aspx<br>http://www.codeproject.com/KB/threads/winspy.aspx<br><br><img src ="http://www.cppblog.com/SearchDream/aggbug/104306.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/SearchDream/" target="_blank">SearchDream</a> 2009-12-28 21:33 <a href="http://www.cppblog.com/SearchDream/archive/2009/12/28/104306.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Visual Studio Release Version Debugging</title><link>http://www.cppblog.com/SearchDream/archive/2009/12/23/103781.html</link><dc:creator>SearchDream</dc:creator><author>SearchDream</author><pubDate>Wed, 23 Dec 2009 04:52:00 GMT</pubDate><guid>http://www.cppblog.com/SearchDream/archive/2009/12/23/103781.html</guid><wfw:comment>http://www.cppblog.com/SearchDream/comments/103781.html</wfw:comment><comments>http://www.cppblog.com/SearchDream/archive/2009/12/23/103781.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/SearchDream/comments/commentRss/103781.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/SearchDream/services/trackbacks/103781.html</trackback:ping><description><![CDATA[我使用的是VS2005，使用WTL模板创建的工程, 开始一直不能在Release Version设置断点，<br>我已经在linker-&gt;Debugging-&gt;Generate Debug Info里选择了Yes (/Debug)。查了一下<br>其他option发现C/C++-&gt;General-&gt;Debug Information Format,选择Progam Database (/Zi)<br>就可以了，生成PDB也大20多M。<br><br><img src ="http://www.cppblog.com/SearchDream/aggbug/103781.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/SearchDream/" target="_blank">SearchDream</a> 2009-12-23 12:52 <a href="http://www.cppblog.com/SearchDream/archive/2009/12/23/103781.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>