<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-3466898886974008005</id><updated>2012-02-16T19:48:06.337+08:00</updated><category term='Network'/><category term='SQL'/><category term='.Net'/><category term='Visual Studio 2005'/><category term='XML'/><category term='COM'/><category term='Windows API'/><category term='Wininet'/><category term='Windows Media Center'/><category term='Windows Media Format SDK'/><category term='XML Parser'/><category term='C#'/><category term='C++'/><category term='Windows Media Player'/><category term='DirectShow'/><category term='INI Files'/><category term='Visual Studio 2008'/><category term='MFC'/><category term='WCF'/><category term='Ruby'/><category term='STL'/><category term='Debug'/><category term='Visual Studio 2003 .NET'/><category term='X64'/><category term='Windows 7'/><title type='text'>No Geek Here!</title><subtitle type='html'>A blog about DirectShow, Network, and Windows Programming Techniques</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://nogeekhere.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3466898886974008005/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://nogeekhere.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Todd</name><uri>http://www.blogger.com/profile/12411203193548271265</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_ECROYFLGK00/SYvOU2pXoyI/AAAAAAAAMCc/A_MRu-m-z1g/s1600-R/484863889_086570a0a5_o.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>57</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-3466898886974008005.post-7696524232305743941</id><published>2009-10-21T08:46:00.000+08:00</published><updated>2009-10-21T08:48:01.903+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Windows API'/><title type='text'>DLL (Dynamic-Link Library) Search Order</title><content type='html'>&lt;i&gt;Are you sure that your program loads the DLLs expected? You may want to check the search order for loading the proper DLLs.&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Standard Search Order (SafeDllSearchMode is enabled)&lt;br /&gt;&lt;/b&gt;1. The directory from which the application loaded.&lt;br /&gt;2. The system directory. Use the GetSystemDirectory function to get the path of this directory.&lt;br /&gt;3. The 16-bit system directory. There is no function that obtains the path of this directory, but it is searched.&lt;br /&gt;4. The Windows directory. Use the GetWindowsDirectory function to get the path of this directory.&lt;br /&gt;5. The current directory.&lt;br /&gt;6. The directories that are listed in the PATH environment variable. Note that this does not include the per-application path specified by the App Paths registry key. The App Paths key is not used when computing the DLL search path.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;More Detail Information&lt;/b&gt;&lt;br /&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ms682586.aspx"&gt;Dynamic-Link Library Search Order&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3466898886974008005-7696524232305743941?l=nogeekhere.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nogeekhere.blogspot.com/feeds/7696524232305743941/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3466898886974008005&amp;postID=7696524232305743941' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3466898886974008005/posts/default/7696524232305743941'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3466898886974008005/posts/default/7696524232305743941'/><link rel='alternate' type='text/html' href='http://nogeekhere.blogspot.com/2009/10/dll-dynamic-link-library-search-order.html' title='DLL (Dynamic-Link Library) Search Order'/><author><name>Todd</name><uri>http://www.blogger.com/profile/12411203193548271265</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_ECROYFLGK00/SYvOU2pXoyI/AAAAAAAAMCc/A_MRu-m-z1g/s1600-R/484863889_086570a0a5_o.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3466898886974008005.post-4927438510587769861</id><published>2009-09-12T10:56:00.001+08:00</published><updated>2009-09-12T10:58:49.029+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='DirectShow'/><title type='text'>Mp4 Explorer</title><content type='html'>&lt;span style="font-weight:bold;"&gt;Brief Introdution&lt;/span&gt;&lt;br /&gt;This software is a very helpful tool to inspect and see in details a mp4 file and it is open source. In my case, I was trying to write a program to convert certain video to be compatible with iPhone, but I had no idea about it. Then, I found this useful utility and used it to inspect the video structure of some compatible mp4 files.&lt;br /&gt;&lt;div style="text-align:center;"&gt;&lt;br /&gt;&lt;a href="http://www.flickr.com/photos/taigc/3901819629/" title="Flickr 上 Tai-Guang Chen 的 Mp4 Explorer"&gt;&lt;img src="http://farm3.static.flickr.com/2421/3901819629_a10aa0d892_o.jpg" width="800" height="600" alt="Mp4 Explorer" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;You can download the program and its source code in the following web site:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Official Website - Mp4 Explorer&lt;/span&gt;&lt;br /&gt;&lt;a href="http://mp4explorer.codeplex.com/"&gt;http://mp4explorer.codeplex.com/&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3466898886974008005-4927438510587769861?l=nogeekhere.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nogeekhere.blogspot.com/feeds/4927438510587769861/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3466898886974008005&amp;postID=4927438510587769861' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3466898886974008005/posts/default/4927438510587769861'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3466898886974008005/posts/default/4927438510587769861'/><link rel='alternate' type='text/html' href='http://nogeekhere.blogspot.com/2009/09/mp4-explorer.html' title='Mp4 Explorer'/><author><name>Todd</name><uri>http://www.blogger.com/profile/12411203193548271265</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_ECROYFLGK00/SYvOU2pXoyI/AAAAAAAAMCc/A_MRu-m-z1g/s1600-R/484863889_086570a0a5_o.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3466898886974008005.post-3398871362275041607</id><published>2009-08-26T08:55:00.000+08:00</published><updated>2009-08-26T08:58:28.638+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Windows API'/><title type='text'>How To: Get the Content of Certain Environment Variable, ie: %ProgramFiles%</title><content type='html'>&lt;span style="font-weight:bold;"&gt;Code Snippet&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;#include &amp;lt;windows.h&amp;gt;&lt;br /&gt;#include &amp;lt;string&amp;gt;&lt;br /&gt;&lt;br /&gt;using namespace std;&lt;br /&gt;&lt;br /&gt;wstring GetContentFromEnvironmentVariable(const wstring&amp; wstrVariable)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;// Get the content of %ProgramFiles%&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;wstring wstrRtn;&lt;br /&gt;&amp;nbsp;&amp;nbsp;DWORD dwSize = ::GetEnvironmentVariableW(wstrVariable.c_str(), NULL, NULL);&lt;br /&gt;&amp;nbsp;&amp;nbsp;if(dwSize &gt; 0)&lt;br /&gt;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;wchar_t* wszContent = new wchar_t [dwSize];&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dwSize = ::GetEnvironmentVariableW(wstrVariable.c_str(), wszContent, dwSize);&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;wstrRtn =  wszContent;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;delete [] wszContent;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;wszContent = NULL;&lt;br /&gt;&amp;nbsp;}&lt;br /&gt;&lt;br /&gt;&amp;nbsp;return wstrRtn;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Reference on MSDN&lt;/span&gt;&lt;br /&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ms683188.aspx" target="_blank"&gt;GetEnvironmentVariable Function&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3466898886974008005-3398871362275041607?l=nogeekhere.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nogeekhere.blogspot.com/feeds/3398871362275041607/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3466898886974008005&amp;postID=3398871362275041607' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3466898886974008005/posts/default/3398871362275041607'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3466898886974008005/posts/default/3398871362275041607'/><link rel='alternate' type='text/html' href='http://nogeekhere.blogspot.com/2009/08/how-to-get-content-of-certain.html' title='How To: Get the Content of Certain Environment Variable, ie: %ProgramFiles%'/><author><name>Todd</name><uri>http://www.blogger.com/profile/12411203193548271265</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_ECROYFLGK00/SYvOU2pXoyI/AAAAAAAAMCc/A_MRu-m-z1g/s1600-R/484863889_086570a0a5_o.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3466898886974008005.post-1158651496475681718</id><published>2009-07-30T18:28:00.004+08:00</published><updated>2009-07-30T18:32:32.910+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Windows Media Player'/><title type='text'>How To: Get the Installation Directory of Windows Media Player</title><content type='html'>&lt;div&gt;&lt;b&gt;Code Snippet&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;bool GetWMPInstallDirectory(wstring&amp;amp; wstrDirectory)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;bool bOK = false;&lt;br /&gt;&amp;nbsp;&amp;nbsp;HKEY hkResult = NULL;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;LONG lRet = ::RegOpenKeyExW(HKEY_LOCAL_MACHINE,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;L"SOFTWARE\\Microsoft\\MediaPlayer", NULL, NULL, &amp;amp;hkResult);&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;if(lRet == ERROR_SUCCESS)&lt;br /&gt;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;wchar_t wszRet[_MAX_PATH] = {0};&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;DWORD type = REG_SZ;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;DWORD cbData = sizeof(wszRet);&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;lRet = ::RegQueryValueExW(hkResult, L"Installation Directory",&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;NULL, &amp;amp;type, (LPBYTE)wszRet, &amp;amp;cbData);&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if(lRet == ERROR_SUCCESS)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// We've got the installation directory of WMP&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;wstrDirectory = wszRet;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;bOK = true;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;::RegCloseKey(hkResult);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;hkResult = NULL;&lt;br /&gt;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;return bOK;&lt;br /&gt;}&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3466898886974008005-1158651496475681718?l=nogeekhere.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nogeekhere.blogspot.com/feeds/1158651496475681718/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3466898886974008005&amp;postID=1158651496475681718' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3466898886974008005/posts/default/1158651496475681718'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3466898886974008005/posts/default/1158651496475681718'/><link rel='alternate' type='text/html' href='http://nogeekhere.blogspot.com/2009/07/how-to-get-installation-directory-of.html' title='How To: Get the Installation Directory of Windows Media Player'/><author><name>Todd</name><uri>http://www.blogger.com/profile/12411203193548271265</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_ECROYFLGK00/SYvOU2pXoyI/AAAAAAAAMCc/A_MRu-m-z1g/s1600-R/484863889_086570a0a5_o.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3466898886974008005.post-8355313254732687767</id><published>2009-06-12T09:20:00.003+08:00</published><updated>2009-06-12T09:22:15.416+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Windows API'/><title type='text'>How To: Disable General Protection Fault Dialog for Your Program</title><content type='html'>&lt;div&gt;&lt;b&gt;Abstraction&lt;/b&gt;&lt;/div&gt;&lt;div&gt;Are you using any 3rd-party componet or ActiveX, which is not stable enough, in your program? You will get a GPF dialog if the componet in your program goes abnormal. That is not your problem totally, but actually your program crashed. There's a Windows API to prevent showing GPF dialog, you may adapt this solution if the crash can be ignored.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Code Snippet&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;UINT uPrevErrMode = SetErrorMode(SEM_NOGPFAULTERRORBOX);&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Do you not know what GPF is?&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://nogeekhere.blogspot.com/2008/02/general-protection-fault.html"&gt;General Protection Fault&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align:center;"&gt;&lt;img src="http://farm3.static.flickr.com/2459/3599870992_9374f0f248_o.jpg" width="532" height="283" alt="Windows Calendar Crash" /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Reference on MSDN&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ms680621.aspx" style="text-decoration: none;"&gt;SetErrorMode Function&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3466898886974008005-8355313254732687767?l=nogeekhere.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nogeekhere.blogspot.com/feeds/8355313254732687767/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3466898886974008005&amp;postID=8355313254732687767' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3466898886974008005/posts/default/8355313254732687767'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3466898886974008005/posts/default/8355313254732687767'/><link rel='alternate' type='text/html' href='http://nogeekhere.blogspot.com/2009/06/how-to-disable-general-protection-fault.html' title='How To: Disable General Protection Fault Dialog for Your Program'/><author><name>Todd</name><uri>http://www.blogger.com/profile/12411203193548271265</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_ECROYFLGK00/SYvOU2pXoyI/AAAAAAAAMCc/A_MRu-m-z1g/s1600-R/484863889_086570a0a5_o.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3466898886974008005.post-3899201844082406992</id><published>2009-06-06T09:03:00.004+08:00</published><updated>2009-06-06T09:11:36.019+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Windows Media Center'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows 7'/><category scheme='http://www.blogger.com/atom/ns#' term='X64'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows API'/><title type='text'>Read/Write Windows Registry on Windows 64-Bits Platforms (C# Version)</title><content type='html'>&lt;div&gt;&lt;b&gt;Abstraction&lt;/b&gt;&lt;/div&gt;&lt;i&gt;How does a 32-bits(x64) program running on Windows 64-bits(x64) access the 64-bits registry? In C#, you can use P/Invoke to call RegOpenKeyEx function with KEY_WOW64_KEY to access the 64-bits registry.&lt;br /&gt;&lt;/i&gt;&lt;br /&gt;&lt;div&gt;&lt;b&gt;Code Snippet&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;//&lt;br /&gt;// This is a C# example to get the version of Windows Media Center on Windows 7 64-bits.&lt;br /&gt;//&lt;/span&gt;&lt;br /&gt;class RegQueryValueDemo&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;[DllImport("advapi32.dll", CharSet = CharSet.Unicode, EntryPoint = "RegOpenKeyExW", SetLastError = true)]&lt;br /&gt;&amp;nbsp;&amp;nbsp;public static extern int RegOpenKeyEx(UIntPtr hKey, string subKey, uint options, int sam, out UIntPtr phkResult);&lt;br /&gt;&amp;nbsp;&amp;nbsp;public static UIntPtr HKEY_CURRENT_USER = (UIntPtr)0x80000001;&lt;br /&gt;&amp;nbsp;&amp;nbsp;public static UIntPtr HKEY_LOCAL_MACHINE = (UIntPtr)0x80000002;&lt;br /&gt;&amp;nbsp;&amp;nbsp;public static int KEY_QUERY_VALUE = 0x0001;&lt;br /&gt;&amp;nbsp;&amp;nbsp;public static int KEY_SET_VALUE = 0x0002;&lt;br /&gt;&amp;nbsp;&amp;nbsp;public static int KEY_CREATE_SUB_KEY = 0x0004;&lt;br /&gt;&amp;nbsp;&amp;nbsp;public static int KEY_ENUMERATE_SUB_KEYS = 0x0008;&lt;br /&gt;&amp;nbsp;&amp;nbsp;public static int KEY_WOW64_64KEY = 0x0100;&lt;br /&gt;&amp;nbsp;&amp;nbsp;public static int KEY_WOW64_32KEY = 0x0200;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;[DllImport("advapi32.dll", CharSet = CharSet.Unicode, EntryPoint = "RegQueryValueExW", SetLastError = true)]&lt;br /&gt;&amp;nbsp;&amp;nbsp;public static extern int RegQueryValueEx(UIntPtr hKey, string lpValueName, int lpReserved, out uint lpType,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;StringBuilder lpData, ref int lpcbData);&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;public string GetMCEIdent()&lt;br /&gt;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;UIntPtr regKeyHandle;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if (RegOpenKeyEx(&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;HKEY_LOCAL_MACHINE,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Media Center",&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;0, KEY_QUERY_VALUE | KEY_WOW64_64KEY, out regKeyHandle) == 0)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;uint type;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;StringBuilder stringBuilder = new StringBuilder(2048);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;int cbData = stringBuilder.Capacity;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if (RegQueryValueEx(regKeyHandle, "Ident", 0, out type, stringBuilder, ref cbData) == 0)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return stringBuilder.ToString();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return string.Empty;&lt;br /&gt;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Find a C++ version?&lt;/b&gt;&lt;br /&gt;&lt;a href="http://nogeekhere.blogspot.com/2009/04/readwrite-windows-registry-on-windows.html"&gt;Read/Write Windows Registry on Windows 64-Bits Platforms&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Reference on MSDN:&lt;/b&gt;&lt;br /&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ms724897.aspx"&gt;RegOpenKeyEx Function&lt;/a&gt;&lt;br /&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ms724072.aspx"&gt;32-bit and 64-bit Application Data in the Registry&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3466898886974008005-3899201844082406992?l=nogeekhere.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nogeekhere.blogspot.com/feeds/3899201844082406992/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3466898886974008005&amp;postID=3899201844082406992' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3466898886974008005/posts/default/3899201844082406992'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3466898886974008005/posts/default/3899201844082406992'/><link rel='alternate' type='text/html' href='http://nogeekhere.blogspot.com/2009/06/readwrite-windows-registry-on-windows.html' title='Read/Write Windows Registry on Windows 64-Bits Platforms (C# Version)'/><author><name>Todd</name><uri>http://www.blogger.com/profile/12411203193548271265</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_ECROYFLGK00/SYvOU2pXoyI/AAAAAAAAMCc/A_MRu-m-z1g/s1600-R/484863889_086570a0a5_o.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3466898886974008005.post-9104557778325549967</id><published>2009-05-24T23:22:00.001+08:00</published><updated>2009-05-24T23:23:55.293+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='.Net'/><title type='text'>How To: A Web Page Interacts with a Embedded Web Browser Control</title><content type='html'>&lt;div&gt;&lt;i&gt;If your application contains a web browser control to show certain web page, can the web page interact with your application by script language? Yes, it can. &lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;There's a sample on MSDN, it's very short but clear, please refer to the following link:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Reference on MSDN&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.webbrowser.objectforscripting.aspx" target="_blank"&gt;WebBrowser.ObjectForScripting Property&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3466898886974008005-9104557778325549967?l=nogeekhere.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nogeekhere.blogspot.com/feeds/9104557778325549967/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3466898886974008005&amp;postID=9104557778325549967' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3466898886974008005/posts/default/9104557778325549967'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3466898886974008005/posts/default/9104557778325549967'/><link rel='alternate' type='text/html' href='http://nogeekhere.blogspot.com/2009/05/how-to-web-page-interacts-with-embedded.html' title='How To: A Web Page Interacts with a Embedded Web Browser Control'/><author><name>Todd</name><uri>http://www.blogger.com/profile/12411203193548271265</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_ECROYFLGK00/SYvOU2pXoyI/AAAAAAAAMCc/A_MRu-m-z1g/s1600-R/484863889_086570a0a5_o.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3466898886974008005.post-6257338320531467497</id><published>2009-05-20T19:06:00.001+08:00</published><updated>2009-05-24T23:16:43.807+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Windows Media Format SDK'/><category scheme='http://www.blogger.com/atom/ns#' term='DirectShow'/><title type='text'>Windows Media ASF Viewer</title><content type='html'>&lt;span class="Apple-style-span" style="font-style: italic;"&gt;Windows Media® ASF Viewer 9 Series is a tool for inspecting the contents of files (such as .asf. .wma, and .wmv file) to make sure they meet the requirements of the Advanced Systems Format (ASF) specification. -- Microsoft&lt;/span&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div style="text-align:center;"&gt;&lt;img src="http://farm4.static.flickr.com/3415/3547499083_c3e86db524_o.jpg" style="align:center" /&gt;&lt;/div&gt;&lt;div style="text-align:center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;Brief Introduction&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;This tool is very helpful for analyzing the contents of ASF files, it helps us to know the media structure and content easily. I was trying to encode WMV using Windows Media Format SDK, and this tool really helped me to verify the output content.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;Download from Microsoft&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://www.microsoft.com/windows/windowsmedia/forpros/format/asfviewer.aspx"&gt;Windows Media ASF Viewer 9 Series&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3466898886974008005-6257338320531467497?l=nogeekhere.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nogeekhere.blogspot.com/feeds/6257338320531467497/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3466898886974008005&amp;postID=6257338320531467497' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3466898886974008005/posts/default/6257338320531467497'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3466898886974008005/posts/default/6257338320531467497'/><link rel='alternate' type='text/html' href='http://nogeekhere.blogspot.com/2009/05/windows-media-asf-viewer.html' title='Windows Media ASF Viewer'/><author><name>Todd</name><uri>http://www.blogger.com/profile/12411203193548271265</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_ECROYFLGK00/SYvOU2pXoyI/AAAAAAAAMCc/A_MRu-m-z1g/s1600-R/484863889_086570a0a5_o.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3466898886974008005.post-5362622456375444831</id><published>2009-05-14T23:15:00.003+08:00</published><updated>2009-05-14T23:22:04.311+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Windows Media Format SDK'/><category scheme='http://www.blogger.com/atom/ns#' term='C++'/><title type='text'>How To: Extracting the embedded album art from a MP3 / WMA</title><content type='html'>&lt;span style="font-style:italic;"&gt;I'm using Windows Media Sync Reader in Windows Media Format SDK to get the album art from id3 tag of a MP3, it can also get from a WMA.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Code Snippet:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;#include &amp;lt;windows.h&amp;gt;&lt;br /&gt;#include &amp;lt;wmsdk.h&amp;gt;&lt;br /&gt;#include &amp;lt;atlbase.h&amp;gt;&lt;br /&gt;&lt;br /&gt;#pragma comment(lib, &amp;quot;wmvcore.lib&amp;quot;)&lt;br /&gt;&lt;br /&gt;bool ExtractEmbeddedAlbumArt(LPCWSTR wszAudioFile)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;bool bOK = false;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;WM_PICTURE* pPicture = NULL;;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;do {&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;CComPtr&amp;lt;IWMSyncReader&amp;gt; pIWMSyncReader;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if(FAILED(WMCreateSyncReader(NULL, 0, &amp;amp;pIWMSyncReader))) break;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if(FAILED(pIWMSyncReader-&amp;gt;Open(wszAudioFile))) break;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;CComPtr&amp;lt;IWMHeaderInfo3&amp;gt; pIWMHeaderInfo3;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if(FAILED(pIWMSyncReader-&amp;gt;QueryInterface(&amp;amp;pIWMHeaderInfo3))) break;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;WMT_ATTR_DATATYPE wmtDataType = WMT_TYPE_BINARY;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;WORD wStreamNum = 0;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;WORD wLength = 0;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if(FAILED(pIWMHeaderInfo3-&amp;gt;GetAttributeByName(&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;amp;wStreamNum, g_wszWMPicture, &amp;amp;wmtDataType, NULL, &amp;amp;wLength))) break;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;pPicture = (WM_PICTURE*)new BYTE[wLength];&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if(FAILED(pIWMHeaderInfo3-&amp;gt;GetAttributeByName(&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;amp;wStreamNum, g_wszWMPicture, &amp;amp;wmtDataType, (BYTE*)pPicture, &amp;amp;wLength))) break;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;bOK = true;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;} while(false);&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;if(pPicture)&lt;br /&gt;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// TODO: Save the picture or do something with it&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;delete [] (BYTE*)pPicture;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;pPicture = NULL;&lt;br /&gt;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;return bOK;&lt;br /&gt;}&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3466898886974008005-5362622456375444831?l=nogeekhere.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nogeekhere.blogspot.com/feeds/5362622456375444831/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3466898886974008005&amp;postID=5362622456375444831' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3466898886974008005/posts/default/5362622456375444831'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3466898886974008005/posts/default/5362622456375444831'/><link rel='alternate' type='text/html' href='http://nogeekhere.blogspot.com/2009/05/how-to-extracting-embedded-album-art.html' title='How To: Extracting the embedded album art from a MP3 / WMA'/><author><name>Todd</name><uri>http://www.blogger.com/profile/12411203193548271265</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_ECROYFLGK00/SYvOU2pXoyI/AAAAAAAAMCc/A_MRu-m-z1g/s1600-R/484863889_086570a0a5_o.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3466898886974008005.post-754903025661000614</id><published>2009-04-28T21:27:00.002+08:00</published><updated>2009-04-28T21:33:54.738+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='DirectShow'/><title type='text'>How To: Handle dynamic format change in ReceiveConnection function on a renderer filter.</title><content type='html'>&lt;span class="Apple-style-span" style="font-style: italic;"&gt;I was trying to correctly handle dynamic format change on my video null renderer and had fought against it for several days.&lt;br /&gt;&lt;br /&gt;The following code snippet is my final work for handling dynamic format change, it seems to work fine, I hope so :p&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;STDMETHODIMP CNullRendererInputPin::ReceiveConnection(IPin * pConnector, const AM_MEDIA_TYPE *pmt)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;CAutoLock lock(m_pLock);&lt;br /&gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;CMediaType newMediaType(*pmt);&lt;br /&gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;HRESULT hr = E_FAIL;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;if(m_Connected &amp;amp;&amp;amp; m_Connected == pConnector &amp;amp;&amp;amp; newMediaType != m_mt)&lt;br /&gt;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;do {&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;hr = CheckMediaType(&amp;amp;newMediaType);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if(FAILED(hr)) break;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;BITMAPINFO bmpinfo = {0};&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if(FORMAT_VideoInfo == pmt-&amp;gt;formattype &amp;amp;&amp;amp; 1 == pmt-&amp;gt;bFixedSizeSamples)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;VIDEOINFOHEADER* t = (VIDEOINFOHEADER*)(pmt-&amp;gt;pbFormat);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;bmpinfo.bmiHeader = t-&amp;gt;bmiHeader;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;else if(FORMAT_VideoInfo2 == pmt-&amp;gt;formattype &amp;amp;&amp;amp; 1 == pmt-&amp;gt;bFixedSizeSamples)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;VIDEOINFOHEADER2* t = (VIDEOINFOHEADER2*)(pmt-&amp;gt;pbFormat);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;bmpinfo.bmiHeader = t-&amp;gt;bmiHeader;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;else&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;hr = E_UNEXPECTED;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;break;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ALLOCATOR_PROPERTIES allocProperties = {0};&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;hr = m_pAllocator-&amp;gt;GetProperties(&amp;amp;allocProperties);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if(FAILED(hr)) break;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;allocProperties.cbBuffer = bmpinfo.bmiHeader.biSizeImage;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;hr = SetMediaType(&amp;amp;newMediaType);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if(FAILED(hr)) break;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;hr = m_pAllocator-&amp;gt;Decommit();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if(FAILED(hr)) break;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ALLOCATOR_PROPERTIES newAllocProperties = {0};&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;hr = m_pAllocator-&amp;gt;SetProperties(&amp;amp;allocProperties, &amp;amp;newAllocProperties);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if(FAILED(hr)) break;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;hr = m_pAllocator-&amp;gt;Commit();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if(FAILED(hr)) break;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;hr = S_OK;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;} while(false);&lt;br /&gt;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;else&lt;br /&gt;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;hr = CBasePin::ReceiveConnection(pConnector, pmt);&lt;br /&gt;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;  &lt;br /&gt;&amp;nbsp;&amp;nbsp;return hr;&lt;br /&gt;}&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3466898886974008005-754903025661000614?l=nogeekhere.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nogeekhere.blogspot.com/feeds/754903025661000614/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3466898886974008005&amp;postID=754903025661000614' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3466898886974008005/posts/default/754903025661000614'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3466898886974008005/posts/default/754903025661000614'/><link rel='alternate' type='text/html' href='http://nogeekhere.blogspot.com/2009/04/how-to-handle-dynamic-format-change-in.html' title='How To: Handle dynamic format change in ReceiveConnection function on a renderer filter.'/><author><name>Todd</name><uri>http://www.blogger.com/profile/12411203193548271265</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_ECROYFLGK00/SYvOU2pXoyI/AAAAAAAAMCc/A_MRu-m-z1g/s1600-R/484863889_086570a0a5_o.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3466898886974008005.post-8103614712320759299</id><published>2009-04-15T22:25:00.003+08:00</published><updated>2009-04-15T22:31:06.585+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='.Net'/><category scheme='http://www.blogger.com/atom/ns#' term='WCF'/><title type='text'>Why will WCF client be disconnected after the connection idles for a long time?</title><content type='html'>&lt;i&gt;The default receive timeout is 10 minutes, so WCF client will be disconnected after the idle time exceeded that limitation. What can I do if the connection needs to be kept alive?&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Solution #1&lt;/b&gt; - Server provides a dummy operation for client calls it regularly to let it not idle.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Solution #2&lt;/b&gt; - Enable reliableSession and set receiveTimeout and inactivityTimeout to "infinite" in both the client and server.&lt;br /&gt;&lt;br /&gt;The configuration snippet may like the following:&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&amp;lt;system.serviceModel&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;lt;bindings&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;wsHttpBinding&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;binding name=&amp;quot;WSHttpBinding&amp;quot; receiveTimeout=&amp;quot;infinite&amp;quot;&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;reliableSession inactivityTimeout=&amp;quot;infinite&amp;quot; enabled=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/binding&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/wsHttpBinding&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;lt;/bindings&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;lt;services&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;...&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;lt;/services&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;...&lt;br /&gt;&amp;lt;/system.serviceModel&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;You can get more detail explanation in the following reference link.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Reference in MSDN:&lt;/b&gt;&lt;br /&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.servicemodel.channels.binding.receivetimeout.aspx"&gt;Binding.ReceiveTimeout Property&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Reference in Paulo Reichert's Blog&lt;/b&gt;&lt;br /&gt;&lt;a href="http://blogs.conchango.com/pauloreichert/archive/2007/02/22/WCF-Reliable-Sessions-Puzzle.aspx"&gt;WCF Reliable Sessions Puzzle&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3466898886974008005-8103614712320759299?l=nogeekhere.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nogeekhere.blogspot.com/feeds/8103614712320759299/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3466898886974008005&amp;postID=8103614712320759299' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3466898886974008005/posts/default/8103614712320759299'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3466898886974008005/posts/default/8103614712320759299'/><link rel='alternate' type='text/html' href='http://nogeekhere.blogspot.com/2009/04/why-will-wcf-client-be-disconnected.html' title='Why will WCF client be disconnected after the connection idles for a long time?'/><author><name>Todd</name><uri>http://www.blogger.com/profile/12411203193548271265</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_ECROYFLGK00/SYvOU2pXoyI/AAAAAAAAMCc/A_MRu-m-z1g/s1600-R/484863889_086570a0a5_o.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3466898886974008005.post-8124075350386641982</id><published>2009-04-10T08:34:00.007+08:00</published><updated>2009-04-10T08:59:16.069+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Windows Media Center'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows 7'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows API'/><category scheme='http://www.blogger.com/atom/ns#' term='C++'/><title type='text'>How To: Detect Windows Media Center Version</title><content type='html'>&lt;i&gt;If your program is depending on a specified version of Windows Media Center, just try the following code to identify Windows Media Center versions.&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Sample Code:&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="color:#006600;font-weight:bold;"&gt;//&lt;br /&gt;// Get Windows Media Center version from registry&lt;br /&gt;// Function return false if no media center is installed on your windows&lt;br /&gt;//&lt;br /&gt;// Key: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Media Center&lt;br /&gt;// Registry value name: Ident&lt;br /&gt;// Registry value data type: REG_SZ&lt;br /&gt;//&lt;/span&gt;&lt;br /&gt;bool GetMediaCenterIdent(wstring&amp;amp; wstrIdent)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;bool bRtn = false;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;HKEY hkResult = NULL;&lt;br /&gt;&amp;nbsp;&amp;nbsp;LONG lRetOpen = ::RegOpenKeyExW(&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;HKEY_LOCAL_MACHINE,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Media Center",&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;NULL, KEY_READ, &amp;amp;hkResult);&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;if(lRetOpen == ERROR_SUCCESS)&lt;br /&gt;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;WCHAR wszRet[2048] = {0};&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;DWORD type_1 = REG_SZ;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;DWORD cbData = sizeof(wszRet);&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;LONG lRetQuery = ::RegQueryValueExW(hkResult, L"Ident", NULL,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;amp;type_1, (unsigned char *)wszRet, &amp;amp;cbData);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if(lRetQuery == ERROR_SUCCESS)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;wstrIdent = wszRet;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;bRtn = true;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;if(hkResult)&lt;br /&gt;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;::RegCloseKey(hkResult);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;hkResult = NULL;&lt;br /&gt;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;return bRtn;&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;b&gt;Ident value v.s Windows Media Center version&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt; 2.7 = Windows XP Media Center Edition 2002&lt;br /&gt;2.7 or 2.8 = Windows XP Media Center Edition 2004&lt;br /&gt;3.0 = Windows XP Media Center Edition 2005&lt;br /&gt;3.1 = Windows XP Media Center Edition 2005 with Update Rollup 1&lt;br /&gt;4.0 = Windows XP Media Center Edition 2005 with Update Rollup 2&lt;br /&gt;5.0 = Windows Vista&lt;br /&gt;5.1 = Windows Vista with Media Center TV Pack 2008&lt;br /&gt;6.0 = Windows 7 &lt;br /&gt;&lt;span&gt;&lt;br /&gt;&lt;b&gt;Reference on MSDN:&lt;/b&gt;&lt;br /&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ms815274.aspx" target="_blank"&gt;Identifying Windows Media Center Versions&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3466898886974008005-8124075350386641982?l=nogeekhere.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nogeekhere.blogspot.com/feeds/8124075350386641982/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3466898886974008005&amp;postID=8124075350386641982' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3466898886974008005/posts/default/8124075350386641982'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3466898886974008005/posts/default/8124075350386641982'/><link rel='alternate' type='text/html' href='http://nogeekhere.blogspot.com/2009/04/how-to-detect-windows-media-center.html' title='How To: Detect Windows Media Center Version'/><author><name>Todd</name><uri>http://www.blogger.com/profile/12411203193548271265</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_ECROYFLGK00/SYvOU2pXoyI/AAAAAAAAMCc/A_MRu-m-z1g/s1600-R/484863889_086570a0a5_o.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3466898886974008005.post-6943098523343345593</id><published>2009-04-06T19:04:00.008+08:00</published><updated>2009-04-06T19:14:37.812+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Windows API'/><title type='text'>How To: Determine whether a 32-bits application is running on Windows 64-bits platform</title><content type='html'>WOW64 is the x86 emulator that allows 32-bit Windows-based applications to run seamlessly on 64-bit Windows.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Sample Code:&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;br /&gt;bool&amp;nbsp;IsRunningOnWow64()&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;BOOL&amp;nbsp;bIsWow64&amp;nbsp;=&amp;nbsp;FALSE;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;BOOL&amp;nbsp;(WINAPI&amp;nbsp;*fnIsWow64Process)(HANDLE,&amp;nbsp;PBOOL);&lt;br /&gt;&amp;nbsp;&amp;nbsp;fnIsWow64Process&amp;nbsp;=&amp;nbsp;(BOOL(WINAPI*)(HANDLE, PBOOL))::GetProcAddress(&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;::GetModuleHandleW(L"kernel32"),&amp;nbsp;"IsWow64Process");&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;if(NULL&amp;nbsp;!=&amp;nbsp;fnIsWow64Process)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;fnIsWow64Process(GetCurrentProcess(),&amp;nbsp;&amp;amp;bIsWow64);&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;return&amp;nbsp;bIsWow64&amp;nbsp;?&amp;nbsp;true&amp;nbsp;:&amp;nbsp;false;&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Reference on MSDN:&lt;/span&gt;&lt;br /&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ms684139.aspx" target="_blank"&gt;IsWow64Process Function&lt;/a&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3466898886974008005-6943098523343345593?l=nogeekhere.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nogeekhere.blogspot.com/feeds/6943098523343345593/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3466898886974008005&amp;postID=6943098523343345593' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3466898886974008005/posts/default/6943098523343345593'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3466898886974008005/posts/default/6943098523343345593'/><link rel='alternate' type='text/html' href='http://nogeekhere.blogspot.com/2009/04/how-to-determine-whether-32-bits.html' title='How To: Determine whether a 32-bits application is running on Windows 64-bits platform'/><author><name>Todd</name><uri>http://www.blogger.com/profile/12411203193548271265</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_ECROYFLGK00/SYvOU2pXoyI/AAAAAAAAMCc/A_MRu-m-z1g/s1600-R/484863889_086570a0a5_o.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3466898886974008005.post-6009617426009069467</id><published>2009-04-02T19:18:00.004+08:00</published><updated>2009-06-05T08:11:17.686+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='X64'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows API'/><category scheme='http://www.blogger.com/atom/ns#' term='C++'/><title type='text'>Read/Write Windows Registry on Windows 64-Bits Platforms</title><content type='html'>On Windows Vista 64-bits, there's a 32-bits emulator called WOW64 for 32-bits applications. A 32-bits application running on WOW64 uses the registry redirector, because the 64-bit version of an application may use different registry keys and values than the 32-bit version.&lt;br /&gt;&lt;br /&gt;For 32-bits application:&lt;br /&gt;On 64-bit platforms, it runs on WOW64 and accesses 32-bit registry (inside Wow6432Node).&lt;br /&gt;&lt;br /&gt;For 64-bits application:&lt;br /&gt;On 64-bit platforms, it runs natively and accesses 64-bit registry (not inside Wow6432Node).&lt;br /&gt;&lt;br /&gt;Whatever, you can explicitly indicate which version of registry you want to access, just use RegOpenKeyEx function with KEY_WOW64_32KEY or KEY_WOW64_64KEY in the desired access rights parameter.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Example: A 32-bit application running on WOW64 accesses the 64-bit registry&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;HKEY hkResult = NULL;&lt;br /&gt;REGSAM samDesired = KEY_READ | KEY_WOW64_64KEY;&lt;br /&gt;LONG lRetOpen = ::RegOpenKeyExW(&lt;br /&gt;&amp;nbsp;&amp;nbsp;HKEY_LOCAL_MACHINE,&lt;br /&gt;&amp;nbsp;&amp;nbsp;L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Media Center",&lt;br /&gt;&amp;nbsp;&amp;nbsp;NULL, samDesired, &amp;amp;hkResult);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Reference on MSDN:&lt;/b&gt;&lt;br /&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ms724072.aspx" target="_blank"&gt;32-bit and 64-bit Application Data in the Registry&lt;/a&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3466898886974008005-6009617426009069467?l=nogeekhere.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nogeekhere.blogspot.com/feeds/6009617426009069467/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3466898886974008005&amp;postID=6009617426009069467' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3466898886974008005/posts/default/6009617426009069467'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3466898886974008005/posts/default/6009617426009069467'/><link rel='alternate' type='text/html' href='http://nogeekhere.blogspot.com/2009/04/readwrite-windows-registry-on-windows.html' title='Read/Write Windows Registry on Windows 64-Bits Platforms'/><author><name>Todd</name><uri>http://www.blogger.com/profile/12411203193548271265</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_ECROYFLGK00/SYvOU2pXoyI/AAAAAAAAMCc/A_MRu-m-z1g/s1600-R/484863889_086570a0a5_o.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3466898886974008005.post-3499408453347927976</id><published>2009-03-10T22:15:00.002+08:00</published><updated>2009-03-10T22:18:04.374+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='DirectShow'/><title type='text'>Where can I find the list of installed ACM codecs on Vista?</title><content type='html'>&lt;div&gt;It has moved to a strange place on Vista. Do the following steps to see the list:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;1. Click on Windows Media Player 11 -&amp;gt; Help -&amp;gt; About -&amp;gt; Technical Support Information&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;2. It will generate &amp;quot;Support Information for Windows Media Player&amp;quot; and look under &amp;quot;Audio Codecs&amp;quot;.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;You can also see the information about windows media player binaries and the list of video codecs.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Reference:&lt;/div&gt;&lt;div&gt;&lt;a href="http://www.sagebrush.com/vista2.htm"&gt;Moving to Vista-- Part D'oh&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3466898886974008005-3499408453347927976?l=nogeekhere.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nogeekhere.blogspot.com/feeds/3499408453347927976/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3466898886974008005&amp;postID=3499408453347927976' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3466898886974008005/posts/default/3499408453347927976'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3466898886974008005/posts/default/3499408453347927976'/><link rel='alternate' type='text/html' href='http://nogeekhere.blogspot.com/2009/03/where-can-i-find-list-of-installed-acm.html' title='Where can I find the list of installed ACM codecs on Vista?'/><author><name>Todd</name><uri>http://www.blogger.com/profile/12411203193548271265</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_ECROYFLGK00/SYvOU2pXoyI/AAAAAAAAMCc/A_MRu-m-z1g/s1600-R/484863889_086570a0a5_o.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3466898886974008005.post-632120686630199832</id><published>2009-03-04T22:31:00.002+08:00</published><updated>2009-03-04T22:36:57.131+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='COM'/><category scheme='http://www.blogger.com/atom/ns#' term='DirectShow'/><title type='text'>error C3861: 'CoInitializeEx': identifier not found, even with argument-dependent lookup</title><content type='html'>&lt;div&gt;You may get the following errors when trying to call CoInitializeEx(NULL, COINIT_MULTITHREADED).&lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;error C2065: 'COINIT_MULTITHREADED' : undeclared identifier&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;error C3861: 'CoInitializeEx': identifier not found, even with argument-dependent lookup&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The article in MSDN says "You must include the #define _WIN32_DCOM preprocessor directive at the beginning of your code to be able to use CoInitializeEx."&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Look at the code snap in ObjBase.h:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;#if (_WIN32_WINNT &amp;gt;= 0x0400 ) || defined(_WIN32_DCOM) // DCOM&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;WINOLEAPI  CoInitializeEx(IN LPVOID pvReserved, IN DWORD dwCoInit);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;WINOLEAPI  CoGetCallerTID( LPDWORD lpdwTID );&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;#endif // DCOM&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;So, you need to follow the above rule if you want to call CoInitializeEx, of course you also need to include &amp;lt;objbase.h&amp;gt;.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;Reference in MSDN:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ms695279.aspx" target="_blank"&gt;CoInitializeEx&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3466898886974008005-632120686630199832?l=nogeekhere.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nogeekhere.blogspot.com/feeds/632120686630199832/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3466898886974008005&amp;postID=632120686630199832' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3466898886974008005/posts/default/632120686630199832'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3466898886974008005/posts/default/632120686630199832'/><link rel='alternate' type='text/html' href='http://nogeekhere.blogspot.com/2009/03/error-c3861-coinitializeex-identifier.html' title='error C3861: &apos;CoInitializeEx&apos;: identifier not found, even with argument-dependent lookup'/><author><name>Todd</name><uri>http://www.blogger.com/profile/12411203193548271265</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_ECROYFLGK00/SYvOU2pXoyI/AAAAAAAAMCc/A_MRu-m-z1g/s1600-R/484863889_086570a0a5_o.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3466898886974008005.post-957691164507911354</id><published>2009-03-01T14:08:00.002+08:00</published><updated>2009-03-01T14:11:21.451+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='DirectShow'/><title type='text'>Why is the media sample upside down after convert its buffer data from YUV to RGB?</title><content type='html'>&lt;div&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;Question&lt;/span&gt;&lt;/div&gt;&lt;div&gt;I converted the buffer of a media sample from YUY2 to RGB24 pixel by pixel, and then I got a upside-down image. What's wrong with it?&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;Answer&lt;/span&gt;&lt;/div&gt;&lt;div&gt;The definition of the biHeight field of BITMAPINFOHEADER depends the the biCompression field of BITMAPINFOHEADER.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;If the bitmap is uncompressed RGB format, the positive biHeight value means the image is bottom-up image; if the bitmap is one of YUV formats such as YUY2, UYVY, and YV12, the image is top-down oriented and the sign of biHeight value must be ignored.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;So, I need to do a vertical flip to get a correct image after convert buffer data from YUY2 to RGB24.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;You can get more detail information in FOURCC.org: &lt;a href="http://www.fourcc.org/fccbihgt.php" target="_blank"&gt;Bitmap Orientation and biHeight&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3466898886974008005-957691164507911354?l=nogeekhere.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nogeekhere.blogspot.com/feeds/957691164507911354/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3466898886974008005&amp;postID=957691164507911354' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3466898886974008005/posts/default/957691164507911354'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3466898886974008005/posts/default/957691164507911354'/><link rel='alternate' type='text/html' href='http://nogeekhere.blogspot.com/2009/03/why-is-media-sample-upside-down-after.html' title='Why is the media sample upside down after convert its buffer data from YUV to RGB?'/><author><name>Todd</name><uri>http://www.blogger.com/profile/12411203193548271265</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_ECROYFLGK00/SYvOU2pXoyI/AAAAAAAAMCc/A_MRu-m-z1g/s1600-R/484863889_086570a0a5_o.jpg'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3466898886974008005.post-191795320575122361</id><published>2009-02-21T00:05:00.004+08:00</published><updated>2009-02-21T00:25:46.580+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='DirectShow'/><title type='text'>FORMAT_VideoInfo v.s. FORMAT_VideoInfo2</title><content type='html'>&lt;div&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;If the media type is FORMAT_VideoInfo, it means the format buffer is a VIDEOINFOHEADER struct; if the media type is FORMAT_VideoInfo2, it means the format buffer is a VIDEOINFOHEADER2 struct. So, what's different between VIDEOINFOHEADER and VIDEOINFOHEADER2?&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;VIDEOINFOHEADER and VIDEOINFOHEADER2 are very different, VIDEOINFOHEADER2 is not just an entended struct of VIDEOINFOHEADER. This means you cannot cast a pointer of VIDEOINFOHEADER2 to a pointer of VIDEOINFOHEADER.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;INCORRECT:&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;if(pmt-&gt;formattype == FORMAT_VideoInfo || pmt-&gt;formattype == FORMAT_VideoInfo2)&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;    VIDEOINFOHEADER *pVIH = (VIDEOINFOHEADER*)pmt-&gt;pbFormat;&lt;/div&gt;&lt;div&gt;    &lt;span class="Apple-style-span" style="color: rgb(0, 102, 0);"&gt;// *** Wrong! ***&lt;/span&gt;&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;CORRECT:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;if(pmt-&gt;formattype == FORMAT_VideoInfo)&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;    VIDEOINFOHEADER *pVIH = (VIDEOINFOHEADER*)pmt-&gt;pbFormat;&lt;/div&gt;&lt;div&gt;    &lt;span class="Apple-style-span" style="color: rgb(0, 102, 0);"&gt;// Now you can use pVIH.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;else if(pmt-&gt;formattype == FORMAT_VideoInfo2)&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;    VIDEOINFOHEADER2 *pVIH = (VIDEOINFOHEADER2*)pmt-&gt;pbFormat;&lt;/div&gt;&lt;div&gt;    &lt;span class="Apple-style-span" style="color: rgb(0, 102, 0);"&gt;// Now you can use pVIH.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Reference in MSDN:&lt;/div&gt;&lt;div&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/dd407325.aspx" target="_blank"&gt;VIDEOINFOHEADER Structure&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/dd407326.aspx" target="_blank"&gt;VIDEOINFOHEADER2 Structure&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3466898886974008005-191795320575122361?l=nogeekhere.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nogeekhere.blogspot.com/feeds/191795320575122361/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3466898886974008005&amp;postID=191795320575122361' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3466898886974008005/posts/default/191795320575122361'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3466898886974008005/posts/default/191795320575122361'/><link rel='alternate' type='text/html' href='http://nogeekhere.blogspot.com/2009/02/formatvideoinfo-vs-formatvideoinfo2.html' title='FORMAT_VideoInfo v.s. FORMAT_VideoInfo2'/><author><name>Todd</name><uri>http://www.blogger.com/profile/12411203193548271265</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_ECROYFLGK00/SYvOU2pXoyI/AAAAAAAAMCc/A_MRu-m-z1g/s1600-R/484863889_086570a0a5_o.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3466898886974008005.post-588646927475822914</id><published>2009-02-17T23:12:00.004+08:00</published><updated>2009-02-17T23:33:48.585+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio 2005'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio 2003 .NET'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio 2008'/><title type='text'>How To: Toggle / Next Bookmark in Visual C++</title><content type='html'>&lt;span class="Apple-style-span" style="font-style: italic;"&gt;Bookmarking is a very useful feature of Visual C++ when you are coding, but the keyboard short cuts of this function is hard to remember. In the menu, you can find the short cuts of toggle and next bookmark are "Ctrl + K Ctrl +K" and "Ctrl + K Ctrl + N" respectively, but why do I need to press so many keys  just for toggle or next bookmark?&lt;/span&gt;&lt;div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;You can do it more easily, just use the following short cuts:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;Toggle Bookmark - Ctrl + F2&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;Next Bookmark - F2&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Wow! It is very easy to use, isn't it? Enjoy bookmarking feature during your coding time.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I have tried it on Visual C++ 6 / 2003 / 2005 / 2008, it works fine.&lt;/div&gt;&lt;div&gt;(Note: The key mapping of Visual Studio is set to default "Visual C++".)&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;Reference in This Site:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://nogeekhere.blogspot.com/2008/09/easiest-way-to-toggle-next-bookmark-in.html" targer="_blank"&gt;The easiest way to toggle / next bookmark in Visual Studio&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3466898886974008005-588646927475822914?l=nogeekhere.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nogeekhere.blogspot.com/feeds/588646927475822914/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3466898886974008005&amp;postID=588646927475822914' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3466898886974008005/posts/default/588646927475822914'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3466898886974008005/posts/default/588646927475822914'/><link rel='alternate' type='text/html' href='http://nogeekhere.blogspot.com/2009/02/how-to-toggle-next-bookmark-in-visual-c.html' title='How To: Toggle / Next Bookmark in Visual C++'/><author><name>Todd</name><uri>http://www.blogger.com/profile/12411203193548271265</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_ECROYFLGK00/SYvOU2pXoyI/AAAAAAAAMCc/A_MRu-m-z1g/s1600-R/484863889_086570a0a5_o.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3466898886974008005.post-3992928444843750928</id><published>2009-02-12T08:49:00.015+08:00</published><updated>2009-02-12T13:15:38.255+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='STL'/><category scheme='http://www.blogger.com/atom/ns#' term='C++'/><title type='text'>How To: STL String Case-insensitive Compare</title><content type='html'>&lt;span class="Apple-style-span" style="font-style: italic;"&gt;This article is talking about how to do a case-insensitive compare for STL string and wstring, there're 2 ways to reach the goal.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;Method #1: C Run-time Library - _stricmp() and _wcsicmp()&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;#include &amp;lt;string&amp;gt;&lt;br /&gt;&lt;br /&gt;using namespace std;&lt;br /&gt;&lt;br /&gt;string strUpperCase = "ABC";&lt;br /&gt;string strLowerCase = "abc";&lt;br /&gt;if(_stricmp(strUpperCase.c_str(), strLowerCase.c_str()) == 0)&lt;br /&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 102, 0);"&gt;// For wstring, use _wcsicmp() instead.&lt;/span&gt;&lt;br /&gt;{&lt;br /&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 102, 0);"&gt;  // Do something you need&lt;/span&gt;&lt;br /&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;Method #2: STL Algorithm - transform()&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;#include &amp;lt;cctype&amp;gt;&lt;br /&gt;#include &amp;lt;string&amp;gt;&lt;br /&gt;#include &amp;lt;algorithm&amp;gt;&lt;br /&gt;&lt;br /&gt;using namespace std;&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 102, 0);"&gt;// I make a helper function to compare string&lt;/span&gt;&lt;br /&gt;bool CompareCaseInsensitive(string strFirst, string strSecond)&lt;br /&gt;{&lt;br /&gt;  &lt;span class="Apple-style-span" style="color: rgb(0, 102, 0);"&gt;// Convert both strings to upper case by transfrom() before compare.&lt;/span&gt;&lt;br /&gt;  transform(strFirst.begin(), strFirst.end(), strFirst.begin(), toupper);&lt;br /&gt;  transform(strSecond.begin(), strSecond.end(), strSecond.begin(), toupper);&lt;br /&gt;  if(strFirst == strSecond) return true; else return false;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;string strUpperCase = "ABC";&lt;br /&gt;string strLowerCase = "abc";&lt;br /&gt;if(CompareCaseInsensitive(strUpperCase, strLowerCase))&lt;br /&gt;{&lt;br /&gt;  &lt;span class="Apple-style-span" style=""&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 102, 0);"&gt;// Do something you need&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;Reference in This Site:&lt;/span&gt;&lt;br /&gt;&lt;a href="http://nogeekhere.blogspot.com/2008/10/how-to-convert-stl-string-wstring-to.html" target="_blank"&gt;How to convert STL string / wstring to upper / lower case?&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;Reference in MSDN:&lt;/span&gt;&lt;br /&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/k59z8dwe.aspx" target="_blank"&gt;_stricmp, _wcsicmp, _mbsicmp, _stricmp_l, _wcsicmp_l, _mbsicmp_l&lt;/a&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3466898886974008005-3992928444843750928?l=nogeekhere.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nogeekhere.blogspot.com/feeds/3992928444843750928/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3466898886974008005&amp;postID=3992928444843750928' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3466898886974008005/posts/default/3992928444843750928'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3466898886974008005/posts/default/3992928444843750928'/><link rel='alternate' type='text/html' href='http://nogeekhere.blogspot.com/2009/02/how-to-stl-string-case-insensitive.html' title='How To: STL String Case-insensitive Compare'/><author><name>Todd</name><uri>http://www.blogger.com/profile/12411203193548271265</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_ECROYFLGK00/SYvOU2pXoyI/AAAAAAAAMCc/A_MRu-m-z1g/s1600-R/484863889_086570a0a5_o.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3466898886974008005.post-42393032321807853</id><published>2009-01-19T19:53:00.002+08:00</published><updated>2009-01-19T19:55:44.225+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='COM'/><category scheme='http://www.blogger.com/atom/ns#' term='DirectShow'/><title type='text'>More explanation of CoInitialize() and CoUninitialize()</title><content type='html'>&lt;div&gt;In this article, I'll not talk about how it works about the COM's apartment model, but the coding practice.&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;CoInitializeEx() provides the same functionality as CoInitialize() except it provides a parameter to specify the thread's apartment model. So, MSDN recommands us to call CoInitializeEx() instead of CoInitialize().&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;For using CoInitializeEx(), we also need to follow the same rules as CoInitialize(), I mentioned in the previous article.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The following examples explain how to use CoInitializeEx() and CoUninitialize():&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;Example #1: CoInitializeEx() will return S_FALSE if the COM library was loaded.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;void main()&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;  HRESULT hr = E_FAIL;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;  // The first call&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;  hr = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED); // hr = S_OK&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;  // The second call&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;  hr = CoInitialize(NULL); // hr = S_FALSE, CoInitialize(NULL) = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;  // ... skip ...&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;  // For the second call&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;  CoUninitialize();&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;  // For the first call&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;  CoUninitialize(); // COM library will be unloaded&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;Example #2: CoInitializeEx() will return RPC_E_CHANGED_MODE if a previous call to CoInitializeEx() specified a different apartment model&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;void main()&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;  HRESULT hr = E_FAIL;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;  // The first call&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;  hr = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED); // hr = S_OK&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;  // The second call&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;  hr = CoInitializeEx(NULL, COINIT_MULTITHREADED); // hr = RPC_E_CHANGED_MODE, the thread's apartment model is still the single thread apartment.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;  // ... skip ...&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;  // NOTE: We do not need to call CoUninitialize() if the corresponding call made by CoInitializeEx() returns error.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;  // For the first call&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;  CoUninitialize(); // COM library will be unloaded&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3466898886974008005-42393032321807853?l=nogeekhere.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nogeekhere.blogspot.com/feeds/42393032321807853/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3466898886974008005&amp;postID=42393032321807853' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3466898886974008005/posts/default/42393032321807853'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3466898886974008005/posts/default/42393032321807853'/><link rel='alternate' type='text/html' href='http://nogeekhere.blogspot.com/2009/01/more-explanation-of-coinitialize-and.html' title='More explanation of CoInitialize() and CoUninitialize()'/><author><name>Todd</name><uri>http://www.blogger.com/profile/12411203193548271265</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_ECROYFLGK00/SYvOU2pXoyI/AAAAAAAAMCc/A_MRu-m-z1g/s1600-R/484863889_086570a0a5_o.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3466898886974008005.post-8474703924755529619</id><published>2009-01-18T22:25:00.003+08:00</published><updated>2009-01-18T22:34:51.051+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='COM'/><category scheme='http://www.blogger.com/atom/ns#' term='DirectShow'/><title type='text'>A clear explanation of CoInitialize() and CoUninitialize()</title><content type='html'>As you know, when you are using DirectShow or the other COM-based components, the first thing you have to do is calling CoInitialize() to initialize the COM library.&lt;br /&gt;&lt;br /&gt;Furthermore, there are several rules you should follow. Now, I will give you a clear explanation here.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Rule #1:&lt;/span&gt; For each thread, you have to call CoInitialize() before you call any of the COM library funtions except CoGetMalloc() and the memory allocation functions.&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;Rule #2:&lt;/span&gt; For each successful call made by CoInitialize(), you have to call CoUninitialize() to free the COM library.&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;Rule #3:&lt;/span&gt; Do not call CoInitialize() or CoUninitialize() from the DllMain() function.&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;Rule #4: &lt;/span&gt;The first thread in the application that calls CoInitialize() must be the last thread to call CoUninitialize().&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;Reference in MSDN:&lt;/span&gt;&lt;br /&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ms678543.aspx" target="_blank"&gt;CoInitialize&lt;/a&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3466898886974008005-8474703924755529619?l=nogeekhere.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nogeekhere.blogspot.com/feeds/8474703924755529619/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3466898886974008005&amp;postID=8474703924755529619' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3466898886974008005/posts/default/8474703924755529619'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3466898886974008005/posts/default/8474703924755529619'/><link rel='alternate' type='text/html' href='http://nogeekhere.blogspot.com/2009/01/clear-explanation-of-coinitialize-and.html' title='A clear explanation of CoInitialize() and CoUninitialize()'/><author><name>Todd</name><uri>http://www.blogger.com/profile/12411203193548271265</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_ECROYFLGK00/SYvOU2pXoyI/AAAAAAAAMCc/A_MRu-m-z1g/s1600-R/484863889_086570a0a5_o.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3466898886974008005.post-757972717305860683</id><published>2009-01-15T08:46:00.002+08:00</published><updated>2009-01-15T08:50:09.367+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='DirectShow'/><title type='text'>fatal error RC1015: cannot open include file 'activex.ver'.</title><content type='html'>&lt;div&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;Error Message:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;fatal error RC1015: cannot open include file 'activex.ver'.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;When compile the DirectShow filter sample in DXSDK, you may get the above error message.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;Root Cause:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The resource file(.rc) includes &amp;lt;activex.ver&amp;gt; and &amp;lt;activex.rcv&amp;gt;, but compiler cannot find them.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;Solution:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;activex.ver and activex.rcv are in %DXSDK%\Samples\C++\DirectShow\BaseClasses&lt;/div&gt;&lt;div&gt;(%DXSDK% is your dx sdk installed directory.)&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Add the above path to "VC++ Directories" of your VC++ setting,&lt;/div&gt;&lt;div&gt;or add it to "Additional Include Directories" of your project setting.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3466898886974008005-757972717305860683?l=nogeekhere.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nogeekhere.blogspot.com/feeds/757972717305860683/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3466898886974008005&amp;postID=757972717305860683' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3466898886974008005/posts/default/757972717305860683'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3466898886974008005/posts/default/757972717305860683'/><link rel='alternate' type='text/html' href='http://nogeekhere.blogspot.com/2009/01/fatal-error-rc1015-cannot-open-include.html' title='fatal error RC1015: cannot open include file &apos;activex.ver&apos;.'/><author><name>Todd</name><uri>http://www.blogger.com/profile/12411203193548271265</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_ECROYFLGK00/SYvOU2pXoyI/AAAAAAAAMCc/A_MRu-m-z1g/s1600-R/484863889_086570a0a5_o.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3466898886974008005.post-8455780843811284214</id><published>2009-01-10T20:41:00.012+08:00</published><updated>2009-01-10T21:01:51.407+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Wininet'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows API'/><category scheme='http://www.blogger.com/atom/ns#' term='C++'/><title type='text'>How to correctly call HttpOpenRequest() with specified accept types?</title><content type='html'>&lt;div&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;Windows API: (Wininet)&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;HINTERNET HttpOpenRequest(&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;  __in  HINTERNET hConnect,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;  __in  LPCTSTR lpszVerb,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;  __in  LPCTSTR lpszObjectName,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;  __in  LPCTSTR lpszVersion,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;  __in  LPCTSTR lpszReferer,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;  __in  LPCTSTR *lplpszAcceptTypes,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;  __in  DWORD dwFlags,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;  __in  DWORD_PTR dwContext&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;Tips:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;lplpszAcceptTypes is not a pointer to a null-terminated string, it is a pointer to a null-terminated array of strings. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;Sample Code:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;// A null-terminated array of null-terminated strings&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;const char* lplpszAcceptTypes[] = {"text/*", NULL}; // Accept only text documents&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;HINTERNET  hHttpFile = HttpOpenRequestA(&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;  hConnect,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;  "GET",&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;  "/TextDocument",&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;  HTTP_VERSION,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;  NULL,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;  lplpszAcceptTypes,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;  INTERNET_FLAG_DONT_CACHE, 1);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;Reference in MSDN:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/aa384233.aspx" target="_blank"&gt;HttpOpenRequest Function&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3466898886974008005-8455780843811284214?l=nogeekhere.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nogeekhere.blogspot.com/feeds/8455780843811284214/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3466898886974008005&amp;postID=8455780843811284214' title='10 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3466898886974008005/posts/default/8455780843811284214'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3466898886974008005/posts/default/8455780843811284214'/><link rel='alternate' type='text/html' href='http://nogeekhere.blogspot.com/2009/01/how-to-correctly-call-httpopenrequest.html' title='How to correctly call HttpOpenRequest() with specified accept types?'/><author><name>Todd</name><uri>http://www.blogger.com/profile/12411203193548271265</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_ECROYFLGK00/SYvOU2pXoyI/AAAAAAAAMCc/A_MRu-m-z1g/s1600-R/484863889_086570a0a5_o.jpg'/></author><thr:total>10</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3466898886974008005.post-4261153274674229244</id><published>2009-01-01T18:16:00.013+08:00</published><updated>2009-01-10T14:45:22.041+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Windows API'/><category scheme='http://www.blogger.com/atom/ns#' term='C++'/><title type='text'>How to get the last modified date of a file in C++?</title><content type='html'>On Win32 platform, you can get the attribute information of a file easily by just calling GetFileAttributesEx().&lt;div&gt;The information you got includes creation time, last access time, and last write time (last modified date).&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;Windows API:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;BOOL WINAPI GetFileAttributesEx(&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;  __in   LPCTSTR lpFileName,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;  __in   GET_FILEEX_INFO_LEVELS fInfoLevelId,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;  __out  LPVOID lpFileInformation&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;Sample Code:&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;WIN32_FILE_ATTRIBUTE_DATA fileAttrData = {0};&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style=" ;font-family:'courier new';"&gt;GetFileAttributesExW(L"C:\\abc.txt, &lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;GetFileExInfoStandard, &amp;amp;fileAttrData);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;// &lt;/span&gt;&lt;span class="Apple-style-span"  style=" ;font-family:'courier new';"&gt;GetFileAttributesExA for non-unicode&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;FILETIME ftLastModifiedDate = fileAttrData.ftLastWriteTime;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;Reference in This Site:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://nogeekhere.blogspot.com/2007/12/systemtime-filetime-and-largeinteger.html"&gt;SYSTEMTIME, FILETIME, and LARGE_INTEGER&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://nogeekhere.blogspot.com/2008/11/what-happened-in-localfiletimetofiletim.html"&gt;What happened to LocalFileTimeToFileTime() / FileTimeToLocalFileTime()?&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;Reference in MSDN:&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/aa364946.aspx" target="_blank"&gt;GetFileAttributesEx Function&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3466898886974008005-4261153274674229244?l=nogeekhere.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nogeekhere.blogspot.com/feeds/4261153274674229244/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3466898886974008005&amp;postID=4261153274674229244' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3466898886974008005/posts/default/4261153274674229244'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3466898886974008005/posts/default/4261153274674229244'/><link rel='alternate' type='text/html' href='http://nogeekhere.blogspot.com/2009/01/how-to-get-last-modified-date-of-file.html' title='How to get the last modified date of a file in C++?'/><author><name>Todd</name><uri>http://www.blogger.com/profile/12411203193548271265</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_ECROYFLGK00/SYvOU2pXoyI/AAAAAAAAMCc/A_MRu-m-z1g/s1600-R/484863889_086570a0a5_o.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3466898886974008005.post-6961613227863478987</id><published>2008-12-19T15:12:00.007+08:00</published><updated>2009-01-10T21:04:14.476+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Windows API'/><category scheme='http://www.blogger.com/atom/ns#' term='C++'/><title type='text'>How to create a file that will be deleted automatically after close its handle?</title><content type='html'>Use CreateFile() API with the flag: FILE_FLAG_DELETE_ON_CLOSE&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;If we want to create a file when the process starts and delete it when the process exits, CreateFile() is convenient to you.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;FILE_FLAG_DELETE_ON_CLOSE means the file will be deleted automatically after close hanlde. Even if the process was crashed, it would also be deleted.&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;Reference in MSDN:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/aa363858.aspx" target="_blank"&gt;CreateFile Function&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3466898886974008005-6961613227863478987?l=nogeekhere.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nogeekhere.blogspot.com/feeds/6961613227863478987/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3466898886974008005&amp;postID=6961613227863478987' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3466898886974008005/posts/default/6961613227863478987'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3466898886974008005/posts/default/6961613227863478987'/><link rel='alternate' type='text/html' href='http://nogeekhere.blogspot.com/2008/12/how-to-create-file-that-will-be-deleted.html' title='How to create a file that will be deleted automatically after close its handle?'/><author><name>Todd</name><uri>http://www.blogger.com/profile/12411203193548271265</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_ECROYFLGK00/SYvOU2pXoyI/AAAAAAAAMCc/A_MRu-m-z1g/s1600-R/484863889_086570a0a5_o.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3466898886974008005.post-337978018360354806</id><published>2008-11-08T14:00:00.007+08:00</published><updated>2009-01-10T21:13:44.791+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Windows API'/><category scheme='http://www.blogger.com/atom/ns#' term='C++'/><title type='text'>What happened to LocalFileTimeToFileTime() / FileTimeToLocalFileTime()?</title><content type='html'>When you want to convert a time between UTC and local, you may choose the API LocalFileTimeToFileTime() or FileTimeToLocalFileTime() for this job.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;Do you know you may get an unexpected result if it is daylight saving time?&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;LocalFileTimeToFileTime() and FileTimeToLocalFileTime() use the current settings for the time zone and daylight saving time. &lt;span class="Apple-style-span" style="font-weight: bold;"&gt;Therefore, if it is daylight saving time, these functions will take daylight saving time into account, even if the time you are converting is in standard time.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;Solution:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;You can use SystemTimeToTzSpecificLocalTime() and TzSpecificLocalTimeToSystemTime() instead.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;Reference in This Site:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://nogeekhere.blogspot.com/2007/12/systemtime-filetime-and-largeinteger.html"&gt;SYSTEMTIME, FILETIME, and LARGE_INTEGER&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;Reference in MSDN:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ms724949.aspx" target="_blank"&gt;SystemTimeToTzSpecificLocalTime Function&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3466898886974008005-337978018360354806?l=nogeekhere.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nogeekhere.blogspot.com/feeds/337978018360354806/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3466898886974008005&amp;postID=337978018360354806' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3466898886974008005/posts/default/337978018360354806'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3466898886974008005/posts/default/337978018360354806'/><link rel='alternate' type='text/html' href='http://nogeekhere.blogspot.com/2008/11/what-happened-in-localfiletimetofiletim.html' title='What happened to LocalFileTimeToFileTime() / FileTimeToLocalFileTime()?'/><author><name>Todd</name><uri>http://www.blogger.com/profile/12411203193548271265</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_ECROYFLGK00/SYvOU2pXoyI/AAAAAAAAMCc/A_MRu-m-z1g/s1600-R/484863889_086570a0a5_o.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3466898886974008005.post-723429544243229470</id><published>2008-11-03T23:27:00.007+08:00</published><updated>2009-01-10T10:32:17.688+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL'/><title type='text'>Why is INSERT / UPDATE command very bad performance on SQLite?</title><content type='html'>When you do a lot of INSERT / UPDATE on a table, it is a good time to contain them within a transaction,&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;begin;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;insert into table values (..);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;insert into table values (..);&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;insert into table values (..);&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;....&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;commit;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This will make SQLite save all changes to the disk at once.&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;Reference in SQLite:&lt;/span&gt;&lt;br /&gt;&lt;a href="http://www.sqlite.org/cvstrac/wiki?p=PerformanceConsiderations"&gt;http://www.sqlite.org/cvstrac/wiki?p=PerformanceConsiderations&lt;/a&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3466898886974008005-723429544243229470?l=nogeekhere.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nogeekhere.blogspot.com/feeds/723429544243229470/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3466898886974008005&amp;postID=723429544243229470' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3466898886974008005/posts/default/723429544243229470'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3466898886974008005/posts/default/723429544243229470'/><link rel='alternate' type='text/html' href='http://nogeekhere.blogspot.com/2008/11/why-is-insert-update-command-very-bad.html' title='Why is INSERT / UPDATE command very bad performance on SQLite?'/><author><name>Todd</name><uri>http://www.blogger.com/profile/12411203193548271265</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_ECROYFLGK00/SYvOU2pXoyI/AAAAAAAAMCc/A_MRu-m-z1g/s1600-R/484863889_086570a0a5_o.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3466898886974008005.post-497668379954274608</id><published>2008-10-12T17:07:00.008+08:00</published><updated>2009-01-10T10:32:52.113+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Debug'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows API'/><title type='text'>How to raise an user break exception (int 3) dynamically in my code?</title><content type='html'>The embedded assembly code way:&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;_asm int 3&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The Windows API way:&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;DebugBreak()&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;After raised an user break exception in your code, the program can be attached to a debugger. For some situation, this is a good way to debug your buggy problem.&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;Reference in MSDN:&lt;/span&gt;&lt;br /&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ms679297.aspx"&gt;http://msdn.microsoft.com/en-us/library/ms679297.aspx&lt;/a&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3466898886974008005-497668379954274608?l=nogeekhere.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nogeekhere.blogspot.com/feeds/497668379954274608/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3466898886974008005&amp;postID=497668379954274608' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3466898886974008005/posts/default/497668379954274608'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3466898886974008005/posts/default/497668379954274608'/><link rel='alternate' type='text/html' href='http://nogeekhere.blogspot.com/2008/10/how-to-raise-user-break-exception-int-3.html' title='How to raise an user break exception (int 3) dynamically in my code?'/><author><name>Todd</name><uri>http://www.blogger.com/profile/12411203193548271265</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_ECROYFLGK00/SYvOU2pXoyI/AAAAAAAAMCc/A_MRu-m-z1g/s1600-R/484863889_086570a0a5_o.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3466898886974008005.post-4385196810721276717</id><published>2008-10-04T10:40:00.011+08:00</published><updated>2009-01-10T14:21:16.600+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='STL'/><category scheme='http://www.blogger.com/atom/ns#' term='C++'/><title type='text'>How to convert STL string / wstring to upper / lower case?</title><content type='html'>This is the STL algorithm way, I think it is better than the itoa() way.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;Sample Code:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&lt;span class="Apple-style-span" style="font-family: Georgia; "&gt;&lt;div&gt;&lt;span style="font-family:courier new;"&gt;#include &amp;lt;cctype&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;#include &amp;lt;string&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;#include &amp;lt;algorithm&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;using namespace std;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;// Convert string to lower case&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;string strTest = "I am a STL string";&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;transform(&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  strTest.begin(), strTest.end(),&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  strTest.begin(),&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  tolower); // toupper for upper case&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;// Convert wstring to upper case&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;wstring wstrTest = L"I am a STL wstring";&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-family:courier new;"&gt;transform(&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  wstrTest.begin(), wstrTest.end(),&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  wstrTest.begin(),&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  towupper); // towlower for lower case&lt;/span&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style=" font-weight: bold;"&gt;Reference in MSDN:&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/391xya49.aspx" target="_blank"&gt;transfom&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3466898886974008005-4385196810721276717?l=nogeekhere.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nogeekhere.blogspot.com/feeds/4385196810721276717/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3466898886974008005&amp;postID=4385196810721276717' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3466898886974008005/posts/default/4385196810721276717'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3466898886974008005/posts/default/4385196810721276717'/><link rel='alternate' type='text/html' href='http://nogeekhere.blogspot.com/2008/10/how-to-convert-stl-string-wstring-to.html' title='How to convert STL string / wstring to upper / lower case?'/><author><name>Todd</name><uri>http://www.blogger.com/profile/12411203193548271265</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_ECROYFLGK00/SYvOU2pXoyI/AAAAAAAAMCc/A_MRu-m-z1g/s1600-R/484863889_086570a0a5_o.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3466898886974008005.post-2535900109115218289</id><published>2008-09-28T16:19:00.007+08:00</published><updated>2009-01-10T10:31:42.878+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='DirectShow'/><title type='text'>How to mute an Audio Capture Filter of webcam in DirectShow?</title><content type='html'>If you want to mute an audio capture of webcam, you have to query IAMAudioInputMixer interface on its &lt;span style="font-weight: bold;"&gt;INPUT PIN&lt;/span&gt;, and then use put_Enable method to disable it.&lt;br /&gt;&lt;br /&gt;Both the audio capture filter itself and its input pin have IAMAudioInputMixer interface, but the put_Enable / get_Enable methods are implemented on input pin only.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Reference in MSDN:&lt;/span&gt;&lt;br /&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ms783820.aspx"&gt;http://msdn.microsoft.com/en-us/library/ms783820.aspx&lt;/a&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3466898886974008005-2535900109115218289?l=nogeekhere.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nogeekhere.blogspot.com/feeds/2535900109115218289/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3466898886974008005&amp;postID=2535900109115218289' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3466898886974008005/posts/default/2535900109115218289'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3466898886974008005/posts/default/2535900109115218289'/><link rel='alternate' type='text/html' href='http://nogeekhere.blogspot.com/2008/09/how-to-mute-audio-capture-filter-of.html' title='How to mute an Audio Capture Filter of webcam in DirectShow?'/><author><name>Todd</name><uri>http://www.blogger.com/profile/12411203193548271265</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_ECROYFLGK00/SYvOU2pXoyI/AAAAAAAAMCc/A_MRu-m-z1g/s1600-R/484863889_086570a0a5_o.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3466898886974008005.post-6746005563101962346</id><published>2008-09-07T14:25:00.002+08:00</published><updated>2008-09-07T14:37:01.670+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Debug'/><category scheme='http://www.blogger.com/atom/ns#' term='DirectShow'/><category scheme='http://www.blogger.com/atom/ns#' term='C++'/><title type='text'>How to get the string from GUID in DirectShow?</title><content type='html'>There is a very useful global array that contains strings representing the GUIDs defined in Uuids.h&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;char* GuidNames[guid]&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Example:&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;const char* GetMajorTypeString(CMediaType* pMediaType)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&amp;nbsp;&amp;nbsp;return GuidNames[*(pMediaType-&amp;gt;Type())];&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Reference:&lt;/span&gt;&lt;br /&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ms783758.aspx"&gt;http://msdn.microsoft.com/en-us/library/ms783758.aspx&lt;br /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3466898886974008005-6746005563101962346?l=nogeekhere.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nogeekhere.blogspot.com/feeds/6746005563101962346/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3466898886974008005&amp;postID=6746005563101962346' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3466898886974008005/posts/default/6746005563101962346'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3466898886974008005/posts/default/6746005563101962346'/><link rel='alternate' type='text/html' href='http://nogeekhere.blogspot.com/2008/09/how-to-get-string-from-guid-in.html' title='How to get the string from GUID in DirectShow?'/><author><name>Todd</name><uri>http://www.blogger.com/profile/12411203193548271265</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_ECROYFLGK00/SYvOU2pXoyI/AAAAAAAAMCc/A_MRu-m-z1g/s1600-R/484863889_086570a0a5_o.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3466898886974008005.post-5099799328565869455</id><published>2008-09-06T12:59:00.004+08:00</published><updated>2009-01-10T10:25:47.653+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio 2005'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio 2003 .NET'/><category scheme='http://www.blogger.com/atom/ns#' term='XML Parser'/><category scheme='http://www.blogger.com/atom/ns#' term='XML'/><category scheme='http://www.blogger.com/atom/ns#' term='C++'/><title type='text'>Small, simple, cross-platform, free and fast  C++ XML Parser</title><content type='html'>&lt;div&gt;I prefer using this one of XML Parser. It is really simple and convenience. And it contains ONLY TWO files, including "xmlparser.cpp" and "xmlparser.h"&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I can compile it without error on VC++ (Visual C++) 2003 and 2005, and it works very well.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;You can get more detail information on author's web site.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;Small, simple, cross-platform, free and fast  C++ XML Parser&lt;br /&gt;&lt;a href="http://www.applied-mathematics.net/tools/xmlParser.html"&gt;http://www.applied-mathematics.net/tools/xmlParser.html&lt;/a&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3466898886974008005-5099799328565869455?l=nogeekhere.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nogeekhere.blogspot.com/feeds/5099799328565869455/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3466898886974008005&amp;postID=5099799328565869455' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3466898886974008005/posts/default/5099799328565869455'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3466898886974008005/posts/default/5099799328565869455'/><link rel='alternate' type='text/html' href='http://nogeekhere.blogspot.com/2008/09/small-simple-cross-platform-free-and.html' title='Small, simple, cross-platform, free and fast  C++ XML Parser'/><author><name>Todd</name><uri>http://www.blogger.com/profile/12411203193548271265</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_ECROYFLGK00/SYvOU2pXoyI/AAAAAAAAMCc/A_MRu-m-z1g/s1600-R/484863889_086570a0a5_o.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3466898886974008005.post-7204486553274017641</id><published>2008-09-05T21:39:00.005+08:00</published><updated>2009-01-10T10:26:38.886+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio 2005'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio 2003 .NET'/><title type='text'>The easiest way to toggle / next bookmark in Visual Studio</title><content type='html'>&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;Shortcuts:&lt;/span&gt;&lt;br /&gt;Toggle Bookmark: Ctrl + K Ctrl +K&lt;br /&gt;Next Bookmark: Ctrl + K Ctrl + N&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;Tips:&lt;/span&gt;&lt;br /&gt;You can find the above shortcuts on the bookmark menu, but it is NOT the easiest way to do that.&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;The other Shortcuts:&lt;/span&gt;&lt;br /&gt;Toggle Bookmark: &lt;span style="font-weight: bold;"&gt;Ctrl + F2&lt;/span&gt;&lt;br /&gt;Next Bookmark: &lt;span style="font-weight: bold;"&gt;F2&lt;/span&gt;&lt;br /&gt;(The key mapping is "Visual C++")&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3466898886974008005-7204486553274017641?l=nogeekhere.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nogeekhere.blogspot.com/feeds/7204486553274017641/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3466898886974008005&amp;postID=7204486553274017641' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3466898886974008005/posts/default/7204486553274017641'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3466898886974008005/posts/default/7204486553274017641'/><link rel='alternate' type='text/html' href='http://nogeekhere.blogspot.com/2008/09/easiest-way-to-toggle-next-bookmark-in.html' title='The easiest way to toggle / next bookmark in Visual Studio'/><author><name>Todd</name><uri>http://www.blogger.com/profile/12411203193548271265</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_ECROYFLGK00/SYvOU2pXoyI/AAAAAAAAMCc/A_MRu-m-z1g/s1600-R/484863889_086570a0a5_o.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3466898886974008005.post-1540645795509239834</id><published>2008-08-29T09:41:00.007+08:00</published><updated>2009-01-10T14:45:02.883+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Windows API'/><category scheme='http://www.blogger.com/atom/ns#' term='C++'/><title type='text'>Why did the RegQueryValueEx() return ERROR_MORE_DATA?</title><content type='html'>&lt;span style="FONT-WEIGHT: bold"&gt;Q:&lt;/span&gt; Why does the RegQueryValueEx() always return ERROR_MORE_DATA?&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold"&gt;A:&lt;/span&gt; If the lpData buffer is too small to receive the data, the function returns ERROR_MORE_DATA.&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;Windows API:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;LONG WINAPI RegQueryValueEx(&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  __in HKEY hKey,&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  __in_opt LPCTSTR lpValueName,&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  __reserved LPDWORD lpReserved,&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  __out_opt LPDWORD lpType,&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  __out_opt LPBYTE lpData,&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  __inout_opt LPDWORD lpcbData&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=""&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;Tips:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;When you are using RegQueryValueExW(), the parameter of lpcbData&lt;br /&gt;SHOULD be the array size in BYTES, not in characters.&lt;br /&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold"&gt;MSDN Reference:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ms724911.aspx" target="_blank"&gt;RegQueryValueEx Function&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3466898886974008005-1540645795509239834?l=nogeekhere.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nogeekhere.blogspot.com/feeds/1540645795509239834/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3466898886974008005&amp;postID=1540645795509239834' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3466898886974008005/posts/default/1540645795509239834'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3466898886974008005/posts/default/1540645795509239834'/><link rel='alternate' type='text/html' href='http://nogeekhere.blogspot.com/2008/08/why-did-regqueryvalueex-return.html' title='Why did the RegQueryValueEx() return ERROR_MORE_DATA?'/><author><name>Todd</name><uri>http://www.blogger.com/profile/12411203193548271265</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_ECROYFLGK00/SYvOU2pXoyI/AAAAAAAAMCc/A_MRu-m-z1g/s1600-R/484863889_086570a0a5_o.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3466898886974008005.post-4159671017604345704</id><published>2008-08-21T23:03:00.002+08:00</published><updated>2008-08-21T23:12:08.620+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Debug'/><category scheme='http://www.blogger.com/atom/ns#' term='C++'/><title type='text'>How to use Application Verifier for a service on Vista?</title><content type='html'>&lt;strong&gt;Q:&lt;/strong&gt; After added the execution file of a service to Application Verifier(AV), I still can not find any log reported by AV.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;A:&lt;/strong&gt; You can find the logs here "c:\windows\system32\config\systemprofile\appverifierlogs". You can also copy it to the current user  profile, then view logs from AV.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3466898886974008005-4159671017604345704?l=nogeekhere.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nogeekhere.blogspot.com/feeds/4159671017604345704/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3466898886974008005&amp;postID=4159671017604345704' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3466898886974008005/posts/default/4159671017604345704'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3466898886974008005/posts/default/4159671017604345704'/><link rel='alternate' type='text/html' href='http://nogeekhere.blogspot.com/2008/08/how-to-use-application-verifier-for.html' title='How to use Application Verifier for a service on Vista?'/><author><name>Todd</name><uri>http://www.blogger.com/profile/12411203193548271265</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_ECROYFLGK00/SYvOU2pXoyI/AAAAAAAAMCc/A_MRu-m-z1g/s1600-R/484863889_086570a0a5_o.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3466898886974008005.post-3256648976745930797</id><published>2008-07-18T19:48:00.006+08:00</published><updated>2009-01-17T12:00:19.399+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Windows API'/><category scheme='http://www.blogger.com/atom/ns#' term='C++'/><title type='text'>How to generate UUID (GUID) in C++?</title><content type='html'>&lt;strong&gt;Sample Code:&lt;/strong&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;#include &amp;lt;Rpc.h&amp;gt;&lt;br /&gt;#pragma comment(lib, "Rpcrt4.lib")&lt;br /&gt;&lt;br /&gt;UUID uuid;&lt;br /&gt;::ZeroMemory(&amp;amp;uuid, sizeof(UUID));&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;// Create uuid or load from a string by UuidFromString() function&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-family:courier new;"&gt;::UuidCreate(&amp;amp;uuid);&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new'; "&gt;// If you want to convert uuid to string, use UuidToString() function&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-family:courier new;"&gt;WCHAR* wszUuid = NULL;&lt;br /&gt;::UuidToStringW(&amp;amp;uuid, &amp;amp;wszUuid);&lt;br /&gt;if(wszUuid != NULL)&lt;br /&gt;{&lt;br /&gt;  ::RpcStringFree(&amp;amp;wszUuid);&lt;br /&gt;  wszUuid = NULL;&lt;br /&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Reference in MSDN:&lt;/strong&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/aa379205.aspx" target="_blank"&gt;UuidCreate Function&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(85, 26, 139); text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/aa379336.aspx" target="_blank"&gt;UuidFromString Function&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/aa379352.aspx" target="_blank"&gt;UuidToString Function&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3466898886974008005-3256648976745930797?l=nogeekhere.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nogeekhere.blogspot.com/feeds/3256648976745930797/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3466898886974008005&amp;postID=3256648976745930797' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3466898886974008005/posts/default/3256648976745930797'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3466898886974008005/posts/default/3256648976745930797'/><link rel='alternate' type='text/html' href='http://nogeekhere.blogspot.com/2008/07/how-to-generate-uuid-guid-in-c.html' title='How to generate UUID (GUID) in C++?'/><author><name>Todd</name><uri>http://www.blogger.com/profile/12411203193548271265</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_ECROYFLGK00/SYvOU2pXoyI/AAAAAAAAMCc/A_MRu-m-z1g/s1600-R/484863889_086570a0a5_o.jpg'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3466898886974008005.post-6534193718086543737</id><published>2008-07-17T09:10:00.005+08:00</published><updated>2008-07-17T09:44:06.645+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows API'/><title type='text'>How to use named system events (global events) in C#?</title><content type='html'>There are three classes relating to windows events, EventWaitHandle, AutoResetEvent, and ManualResetEvent.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;EventWaitHandle&lt;/strong&gt;&lt;br /&gt;The EventWaitHandle class can represent either automatic or manual reset events and either local events or named system events.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;AutoResetEvent&lt;/strong&gt;&lt;br /&gt;The AutoResetEvent class derives from EventWaitHandle and represents a local event that resets automatically.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;ManualResetEvent&lt;/strong&gt;&lt;br /&gt;The ManualResetEvent class derives from EventWaitHandle and represents a local event that must be reset manually.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Tips:&lt;/strong&gt;&lt;br /&gt;According to above description, you should use EventWaitHanlde class to represent named system events, of course it can be either automatic or manual reset events.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;MSDN reference:&lt;/strong&gt;&lt;br /&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ksb7zs2x.aspx"&gt;http://msdn.microsoft.com/en-us/library/ksb7zs2x.aspx&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3466898886974008005-6534193718086543737?l=nogeekhere.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nogeekhere.blogspot.com/feeds/6534193718086543737/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3466898886974008005&amp;postID=6534193718086543737' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3466898886974008005/posts/default/6534193718086543737'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3466898886974008005/posts/default/6534193718086543737'/><link rel='alternate' type='text/html' href='http://nogeekhere.blogspot.com/2008/07/how-to-use-named-system-events-global.html' title='How to use named system events (global events) in C#?'/><author><name>Todd</name><uri>http://www.blogger.com/profile/12411203193548271265</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_ECROYFLGK00/SYvOU2pXoyI/AAAAAAAAMCc/A_MRu-m-z1g/s1600-R/484863889_086570a0a5_o.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3466898886974008005.post-2946690318819013555</id><published>2008-04-26T16:53:00.005+08:00</published><updated>2008-07-17T09:35:54.267+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Ruby'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows API'/><title type='text'>Call Windows API in Ruby</title><content type='html'>&lt;span&gt;&lt;strong&gt;Sample Code:&lt;/strong&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;# Close WMP by Window Message&lt;br /&gt;require 'Win32API'&lt;br /&gt;&lt;br /&gt;FindWindow = Win32API.new('user32', 'FindWindow', ["P", "P"], "L")&lt;br /&gt;SendMessage = Win32API.new('user32', 'SendMessage', ["L", "L", "P", "P"], "L")&lt;br /&gt;WM_CLOSE = 0x0010&lt;br /&gt;&lt;br /&gt;def CloseWMP()&lt;br /&gt;&amp;nbsp;&amp;nbsp;hwnd = FindWindow.call(nil, "Windows Media Player")&lt;br /&gt;&amp;nbsp;&amp;nbsp;if hwnd != 0 then&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;id = SendMessage.call(hwnd, WM_CLOSE, nil, nil)&lt;br /&gt;&amp;nbsp;&amp;nbsp;end&lt;br /&gt;end&lt;br /&gt;# End of Close WMP by Window Message&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Reference:&lt;br /&gt;&lt;/strong&gt;&lt;a href="http://www.rubycentral.com/pickaxe/lib_windows.html"&gt;http://www.rubycentral.com/pickaxe/lib_windows.html&lt;/a&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3466898886974008005-2946690318819013555?l=nogeekhere.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nogeekhere.blogspot.com/feeds/2946690318819013555/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3466898886974008005&amp;postID=2946690318819013555' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3466898886974008005/posts/default/2946690318819013555'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3466898886974008005/posts/default/2946690318819013555'/><link rel='alternate' type='text/html' href='http://nogeekhere.blogspot.com/2008/04/call-windows-api-in-ruby.html' title='Call Windows API in Ruby'/><author><name>Todd</name><uri>http://www.blogger.com/profile/12411203193548271265</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_ECROYFLGK00/SYvOU2pXoyI/AAAAAAAAMCc/A_MRu-m-z1g/s1600-R/484863889_086570a0a5_o.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3466898886974008005.post-4330620718396598647</id><published>2008-02-24T20:56:00.004+08:00</published><updated>2008-08-29T19:09:57.452+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C++'/><title type='text'>0.0F vs 0.0 vs 0.0L and 0 vs 0L</title><content type='html'>There are different types in C++.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;0.0F is a float, 0.0 is a double, and 0.0L is a long double.&lt;br /&gt;&lt;br /&gt;0 is a int and 0L is a long.&lt;br /&gt;&lt;br /&gt;"ABC" is a ansi string and L"ABC" is a wide string.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3466898886974008005-4330620718396598647?l=nogeekhere.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nogeekhere.blogspot.com/feeds/4330620718396598647/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3466898886974008005&amp;postID=4330620718396598647' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3466898886974008005/posts/default/4330620718396598647'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3466898886974008005/posts/default/4330620718396598647'/><link rel='alternate' type='text/html' href='http://nogeekhere.blogspot.com/2008/02/00f-vs-00-vs-00l-and-0-vs-0l.html' title='0.0F vs 0.0 vs 0.0L and 0 vs 0L'/><author><name>Todd</name><uri>http://www.blogger.com/profile/12411203193548271265</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_ECROYFLGK00/SYvOU2pXoyI/AAAAAAAAMCc/A_MRu-m-z1g/s1600-R/484863889_086570a0a5_o.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3466898886974008005.post-5948072795379541581</id><published>2008-02-23T15:54:00.002+08:00</published><updated>2008-02-23T16:06:59.569+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C++'/><title type='text'>General Protection Fault</title><content type='html'>General Protection Fault = GP Fault = GPF&lt;br /&gt;&lt;br /&gt;You received this kind of error when the program is attempting accessing a read-only memory.&lt;br /&gt;&lt;br /&gt;For example:&lt;br /&gt;&lt;br /&gt;class Object&lt;br /&gt;{&lt;br /&gt;public:&lt;br /&gt;&amp;nbsp;&amp;nbsp;int nValue;&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;Object* pObject = NULL;&lt;br /&gt;int nValueOfObject = pObject-&amp;gt;nValue; // Accessing a memory which should not be accessed&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3466898886974008005-5948072795379541581?l=nogeekhere.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nogeekhere.blogspot.com/feeds/5948072795379541581/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3466898886974008005&amp;postID=5948072795379541581' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3466898886974008005/posts/default/5948072795379541581'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3466898886974008005/posts/default/5948072795379541581'/><link rel='alternate' type='text/html' href='http://nogeekhere.blogspot.com/2008/02/general-protection-fault.html' title='General Protection Fault'/><author><name>Todd</name><uri>http://www.blogger.com/profile/12411203193548271265</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_ECROYFLGK00/SYvOU2pXoyI/AAAAAAAAMCc/A_MRu-m-z1g/s1600-R/484863889_086570a0a5_o.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3466898886974008005.post-5570722325306121283</id><published>2008-02-23T11:05:00.002+08:00</published><updated>2008-02-23T11:10:47.070+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Windows Media Format SDK'/><title type='text'>Sample code for IWMMediaProps::GetMediaType()</title><content type='html'>// Get the required buffer size&lt;br /&gt;DWORD cbType = 0;&lt;br /&gt;pWMMediaProps-&amp;gt;GetMediaType(NULL, &amp;amp;cbType);&lt;br /&gt;&lt;br /&gt;// Get media type&lt;br /&gt;WM_MEDIA_TYPE* pType = (WM_MEDIA_TYPE*)new BYTE[cbType];&lt;br /&gt;if(SUCCEEDED(pWMMediaProps-&amp;gt;GetMediaType(pType, &amp;amp;cbType)))&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;// Use media type here&lt;br /&gt;&amp;nbsp;&amp;nbsp;// ...&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;// Free buffer&lt;br /&gt;// Should not use &amp;quot;delete [] pType&amp;quot;, we have to cast it to (BYTE*) before delete it.&lt;br /&gt;delete [] (BYTE*)pType;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3466898886974008005-5570722325306121283?l=nogeekhere.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nogeekhere.blogspot.com/feeds/5570722325306121283/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3466898886974008005&amp;postID=5570722325306121283' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3466898886974008005/posts/default/5570722325306121283'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3466898886974008005/posts/default/5570722325306121283'/><link rel='alternate' type='text/html' href='http://nogeekhere.blogspot.com/2008/02/sample-code-for-iwmmediapropsgetmediaty.html' title='Sample code for IWMMediaProps::GetMediaType()'/><author><name>Todd</name><uri>http://www.blogger.com/profile/12411203193548271265</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_ECROYFLGK00/SYvOU2pXoyI/AAAAAAAAMCc/A_MRu-m-z1g/s1600-R/484863889_086570a0a5_o.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3466898886974008005.post-3635247861353378068</id><published>2008-01-25T23:31:00.000+08:00</published><updated>2008-01-25T23:33:30.760+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C++'/><title type='text'>How to initialize static member variable?</title><content type='html'>class X&lt;br /&gt;{&lt;br /&gt;public:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;static int i;&lt;br /&gt;};&lt;br /&gt;int X::i = 0; // definition outside class declaration&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3466898886974008005-3635247861353378068?l=nogeekhere.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nogeekhere.blogspot.com/feeds/3635247861353378068/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3466898886974008005&amp;postID=3635247861353378068' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3466898886974008005/posts/default/3635247861353378068'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3466898886974008005/posts/default/3635247861353378068'/><link rel='alternate' type='text/html' href='http://nogeekhere.blogspot.com/2008/01/how-to-initialize-static-member.html' title='How to initialize static member variable?'/><author><name>Todd</name><uri>http://www.blogger.com/profile/12411203193548271265</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_ECROYFLGK00/SYvOU2pXoyI/AAAAAAAAMCc/A_MRu-m-z1g/s1600-R/484863889_086570a0a5_o.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3466898886974008005.post-6231682549334165101</id><published>2008-01-24T23:35:00.000+08:00</published><updated>2008-01-24T23:42:33.673+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='DirectShow'/><title type='text'>Notes for QueryFilterInfo()</title><content type='html'>FILTER_INFO Info = {0};&lt;br /&gt;pFilter-&amp;gt;QueryFilterInfo(&amp;amp;Info);&lt;br /&gt;if(Info.pGraph != NULL)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Info.pGraph-&amp;gt;Release(); // You MUST release here&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3466898886974008005-6231682549334165101?l=nogeekhere.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nogeekhere.blogspot.com/feeds/6231682549334165101/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3466898886974008005&amp;postID=6231682549334165101' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3466898886974008005/posts/default/6231682549334165101'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3466898886974008005/posts/default/6231682549334165101'/><link rel='alternate' type='text/html' href='http://nogeekhere.blogspot.com/2008/01/notes-for-queryfilterinfo.html' title='Notes for QueryFilterInfo()'/><author><name>Todd</name><uri>http://www.blogger.com/profile/12411203193548271265</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_ECROYFLGK00/SYvOU2pXoyI/AAAAAAAAMCc/A_MRu-m-z1g/s1600-R/484863889_086570a0a5_o.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3466898886974008005.post-7309774936861513592</id><published>2008-01-19T22:55:00.000+08:00</published><updated>2008-01-19T22:59:00.878+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows API'/><title type='text'>Microsoft Win32 to Microsoft .NET Framework API Map</title><content type='html'>Microsoft Win32 to Microsoft .NET Framework API Map&lt;br /&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/aa302340.aspx"&gt;http://msdn2.microsoft.com/en-us/library/aa302340.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;This is a very useful article for C# programmer.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3466898886974008005-7309774936861513592?l=nogeekhere.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nogeekhere.blogspot.com/feeds/7309774936861513592/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3466898886974008005&amp;postID=7309774936861513592' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3466898886974008005/posts/default/7309774936861513592'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3466898886974008005/posts/default/7309774936861513592'/><link rel='alternate' type='text/html' href='http://nogeekhere.blogspot.com/2008/01/microsoft-win32-to-microsoft-net.html' title='Microsoft Win32 to Microsoft .NET Framework API Map'/><author><name>Todd</name><uri>http://www.blogger.com/profile/12411203193548271265</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_ECROYFLGK00/SYvOU2pXoyI/AAAAAAAAMCc/A_MRu-m-z1g/s1600-R/484863889_086570a0a5_o.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3466898886974008005.post-730228456767710662</id><published>2008-01-17T23:04:00.001+08:00</published><updated>2008-12-15T13:39:17.121+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='STL'/><category scheme='http://www.blogger.com/atom/ns#' term='C++'/><title type='text'>Notes for writing DLL in which use STL objects</title><content type='html'>&lt;div&gt;You may experience an access violation when you access an STL object through a pointer or reference in a different DLL or EXE.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;Root Cause:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;Since the static data members in the executable images are not in sync, this action could result in an access violation or data may appear to be lost or corrupted.&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;Suggestion:&lt;/span&gt;&lt;br /&gt;Avoid using STL object as the parameter or the return value of an exported DLL function.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;MSDN Reference:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://support.microsoft.com/kb/172396/en-us"&gt;http://support.microsoft.com/kb/172396/en-us&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3466898886974008005-730228456767710662?l=nogeekhere.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nogeekhere.blogspot.com/feeds/730228456767710662/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3466898886974008005&amp;postID=730228456767710662' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3466898886974008005/posts/default/730228456767710662'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3466898886974008005/posts/default/730228456767710662'/><link rel='alternate' type='text/html' href='http://nogeekhere.blogspot.com/2008/01/stl-notes.html' title='Notes for writing DLL in which use STL objects'/><author><name>Todd</name><uri>http://www.blogger.com/profile/12411203193548271265</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_ECROYFLGK00/SYvOU2pXoyI/AAAAAAAAMCc/A_MRu-m-z1g/s1600-R/484863889_086570a0a5_o.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3466898886974008005.post-2373029813252213287</id><published>2008-01-10T22:33:00.000+08:00</published><updated>2008-01-10T22:40:53.481+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Network'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Notes for HttpWebResponse class</title><content type='html'>You MUST call Close method to close the response and release the connection.&lt;br /&gt;&lt;br /&gt;HttpWebRequest HttpWReq = (HttpWebRequest)WebRequest.Create("http://www.google.com");&lt;br /&gt;&lt;br /&gt;HttpWebResponse HttpWResp = (HttpWebResponse)HttpWReq.GetResponse();&lt;br /&gt;// Insert code that uses the response object.&lt;br /&gt;HttpWResp.Close();&lt;br /&gt;&lt;br /&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/system.net.httpwebresponse.aspx"&gt;http://msdn2.microsoft.com/en-us/library/system.net.httpwebresponse.aspx&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3466898886974008005-2373029813252213287?l=nogeekhere.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nogeekhere.blogspot.com/feeds/2373029813252213287/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3466898886974008005&amp;postID=2373029813252213287' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3466898886974008005/posts/default/2373029813252213287'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3466898886974008005/posts/default/2373029813252213287'/><link rel='alternate' type='text/html' href='http://nogeekhere.blogspot.com/2008/01/notes-for-httpwebresponse-class.html' title='Notes for HttpWebResponse class'/><author><name>Todd</name><uri>http://www.blogger.com/profile/12411203193548271265</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_ECROYFLGK00/SYvOU2pXoyI/AAAAAAAAMCc/A_MRu-m-z1g/s1600-R/484863889_086570a0a5_o.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3466898886974008005.post-7307338483964781852</id><published>2008-01-01T21:12:00.000+08:00</published><updated>2008-01-01T21:16:53.052+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='DirectShow'/><title type='text'>Notes for to remove certain filter from a graph</title><content type='html'>You should check that the graph is stopped or it will fail to remove any filter.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3466898886974008005-7307338483964781852?l=nogeekhere.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nogeekhere.blogspot.com/feeds/7307338483964781852/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3466898886974008005&amp;postID=7307338483964781852' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3466898886974008005/posts/default/7307338483964781852'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3466898886974008005/posts/default/7307338483964781852'/><link rel='alternate' type='text/html' href='http://nogeekhere.blogspot.com/2008/01/notes-for-to-remove-certain-filter-from.html' title='Notes for to remove certain filter from a graph'/><author><name>Todd</name><uri>http://www.blogger.com/profile/12411203193548271265</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_ECROYFLGK00/SYvOU2pXoyI/AAAAAAAAMCc/A_MRu-m-z1g/s1600-R/484863889_086570a0a5_o.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3466898886974008005.post-6345055925746066514</id><published>2007-12-26T22:46:00.000+08:00</published><updated>2007-12-26T23:22:47.149+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Windows API'/><title type='text'>How to get the maximum length of full path in windows?</title><content type='html'>&lt;p&gt;_MAX_DIR = Maximum length of directory component&lt;br /&gt;_MAX_DRIVE = Maximum length of drive component&lt;br /&gt;_MAX_EXT = Maximum length of extension component&lt;br /&gt;_MAX_FNAME = Maximum length of filename component&lt;br /&gt;_MAX_PATH = Maximum length of full path.&lt;/p&gt;&lt;p&gt;The sum of the fields should not exceed _MAX_PATH.&lt;br /&gt;(The sizes include space for 0-terminator.)&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3466898886974008005-6345055925746066514?l=nogeekhere.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nogeekhere.blogspot.com/feeds/6345055925746066514/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3466898886974008005&amp;postID=6345055925746066514' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3466898886974008005/posts/default/6345055925746066514'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3466898886974008005/posts/default/6345055925746066514'/><link rel='alternate' type='text/html' href='http://nogeekhere.blogspot.com/2007/12/how-to-get-maximum-length-of-full-path.html' title='How to get the maximum length of full path in windows?'/><author><name>Todd</name><uri>http://www.blogger.com/profile/12411203193548271265</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_ECROYFLGK00/SYvOU2pXoyI/AAAAAAAAMCc/A_MRu-m-z1g/s1600-R/484863889_086570a0a5_o.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3466898886974008005.post-357701101565250383</id><published>2007-12-25T23:14:00.000+08:00</published><updated>2007-12-25T23:21:01.314+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Windows API'/><category scheme='http://www.blogger.com/atom/ns#' term='C++'/><title type='text'>How to get the special folders of windows?</title><content type='html'>(For Windows XP)&lt;br /&gt;SHGetFolderPath Function&lt;br /&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/bb762181.aspx"&gt;http://msdn2.microsoft.com/en-us/library/bb762181.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;(For Windows Vista and later)&lt;br /&gt;SHGetKnownFolderPath Function&lt;br /&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/bb762188.aspx"&gt;http://msdn2.microsoft.com/en-us/library/bb762188.aspx&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3466898886974008005-357701101565250383?l=nogeekhere.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nogeekhere.blogspot.com/feeds/357701101565250383/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3466898886974008005&amp;postID=357701101565250383' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3466898886974008005/posts/default/357701101565250383'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3466898886974008005/posts/default/357701101565250383'/><link rel='alternate' type='text/html' href='http://nogeekhere.blogspot.com/2007/12/how-to-get-special-folders-of-windows.html' title='How to get the special folders of windows?'/><author><name>Todd</name><uri>http://www.blogger.com/profile/12411203193548271265</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_ECROYFLGK00/SYvOU2pXoyI/AAAAAAAAMCc/A_MRu-m-z1g/s1600-R/484863889_086570a0a5_o.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3466898886974008005.post-6447163402484346755</id><published>2007-12-09T18:23:00.000+08:00</published><updated>2007-12-09T18:34:40.512+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Windows API'/><category scheme='http://www.blogger.com/atom/ns#' term='C++'/><title type='text'>How to use critical section?</title><content type='html'>// Declaration&lt;br /&gt;CRITICAL_SECTION CriticalSection;&lt;br /&gt;&lt;br /&gt;// Initialize&lt;br /&gt;::InitializeCriticalSection(&amp;CriticalSection);&lt;br /&gt;&lt;br /&gt;// Implementation&lt;br /&gt;::EnterCriticalSection(&amp;CriticalSection);&lt;br /&gt;/* Code block */&lt;br /&gt;::LeaveCriticalSection(&amp;CriticalSection);&lt;br /&gt;&lt;br /&gt;// Uninitialize&lt;br /&gt;::DeleteCriticalSection(&amp;CriticalSection);&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3466898886974008005-6447163402484346755?l=nogeekhere.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nogeekhere.blogspot.com/feeds/6447163402484346755/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3466898886974008005&amp;postID=6447163402484346755' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3466898886974008005/posts/default/6447163402484346755'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3466898886974008005/posts/default/6447163402484346755'/><link rel='alternate' type='text/html' href='http://nogeekhere.blogspot.com/2007/12/how-to-use-critical-section.html' title='How to use critical section?'/><author><name>Todd</name><uri>http://www.blogger.com/profile/12411203193548271265</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_ECROYFLGK00/SYvOU2pXoyI/AAAAAAAAMCc/A_MRu-m-z1g/s1600-R/484863889_086570a0a5_o.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3466898886974008005.post-4188653699665850954</id><published>2007-12-06T23:59:00.000+08:00</published><updated>2007-12-09T18:37:57.143+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='STL'/><category scheme='http://www.blogger.com/atom/ns#' term='C++'/><title type='text'>Convert Any Value Type to STL String by Stringstream</title><content type='html'>&lt;p&gt;#include &amp;lt;sstream&amp;gt;&lt;/p&gt;&lt;p&gt;using namespace std;&lt;/p&gt;&lt;p&gt;int a = 1;&lt;br /&gt;double b = 2.0;&lt;br /&gt;float c = 3.0;&lt;br /&gt;unsigned int d = 4;&lt;br /&gt;long long f = 5;&lt;br /&gt;__int64 g = 6;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;wstringstream stream; (use stringstream for string)&lt;br /&gt;wstring str;&lt;br /&gt;stream &amp;lt;&amp;lt; g; (this can be replaced by any value type)&lt;br /&gt;stream &amp;gt;&amp;gt; str;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3466898886974008005-4188653699665850954?l=nogeekhere.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nogeekhere.blogspot.com/feeds/4188653699665850954/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3466898886974008005&amp;postID=4188653699665850954' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3466898886974008005/posts/default/4188653699665850954'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3466898886974008005/posts/default/4188653699665850954'/><link rel='alternate' type='text/html' href='http://nogeekhere.blogspot.com/2007/12/convert-any-value-type-to-stl-string-by.html' title='Convert Any Value Type to STL String by Stringstream'/><author><name>Todd</name><uri>http://www.blogger.com/profile/12411203193548271265</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_ECROYFLGK00/SYvOU2pXoyI/AAAAAAAAMCc/A_MRu-m-z1g/s1600-R/484863889_086570a0a5_o.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3466898886974008005.post-3281160289332491673</id><published>2007-12-06T08:19:00.000+08:00</published><updated>2007-12-06T08:26:46.460+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='INI Files'/><title type='text'>Read/Write INI Files in C#</title><content type='html'>A Complete Win32 INI File Utility Class&lt;br /&gt;&lt;a href="http://www.codeproject.com/KB/files/win32fileutilityclass.aspx"&gt;http://www.codeproject.com/KB/files/win32fileutilityclass.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;C# wrap for calling windows api. Easy to use!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3466898886974008005-3281160289332491673?l=nogeekhere.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nogeekhere.blogspot.com/feeds/3281160289332491673/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3466898886974008005&amp;postID=3281160289332491673' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3466898886974008005/posts/default/3281160289332491673'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3466898886974008005/posts/default/3281160289332491673'/><link rel='alternate' type='text/html' href='http://nogeekhere.blogspot.com/2007/12/readwrite-ini-files-in-c.html' title='Read/Write INI Files in C#'/><author><name>Todd</name><uri>http://www.blogger.com/profile/12411203193548271265</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_ECROYFLGK00/SYvOU2pXoyI/AAAAAAAAMCc/A_MRu-m-z1g/s1600-R/484863889_086570a0a5_o.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3466898886974008005.post-3497643383186210179</id><published>2007-12-05T00:02:00.000+08:00</published><updated>2007-12-05T00:12:59.172+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Windows API'/><category scheme='http://www.blogger.com/atom/ns#' term='C++'/><title type='text'>SYSTEMTIME, FILETIME, and LARGE_INTEGER</title><content type='html'>SYSTEMTIME to FILETIME&lt;br /&gt;SystemTimeToFileTime Function&lt;br /&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/ms724948.aspx"&gt;http://msdn2.microsoft.com/en-us/library/ms724948.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;FILETIME to SYSTEMTIME&lt;br /&gt;FileTimeToSystemTime Function&lt;br /&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/ms724277.aspx"&gt;http://msdn2.microsoft.com/en-us/library/ms724277.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Copy FILETIME to LARGE_INTEGER&lt;br /&gt;LARGE_INTEGER.LowPart = FILETIME.dwLowDateTime&lt;br /&gt;LARGE_INTEGER.HighPart = FILETIME.dwHighDateTime&lt;br /&gt;&lt;br /&gt;Copy LARGE_INTEGER to FILETIME&lt;br /&gt;FILETIME.dwLowDateTime = LARGE_INTEGER.LowPart&lt;br /&gt;FILETIME.dwHighDateTime = LARGE_INTEGER.HighPart&lt;br /&gt;&lt;br /&gt;LARGE_INTEGER&lt;br /&gt;Perform 64-bit arthimetic on LARGE_INTEGER.QuardPart member&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3466898886974008005-3497643383186210179?l=nogeekhere.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nogeekhere.blogspot.com/feeds/3497643383186210179/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3466898886974008005&amp;postID=3497643383186210179' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3466898886974008005/posts/default/3497643383186210179'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3466898886974008005/posts/default/3497643383186210179'/><link rel='alternate' type='text/html' href='http://nogeekhere.blogspot.com/2007/12/systemtime-filetime-and-largeinteger.html' title='SYSTEMTIME, FILETIME, and LARGE_INTEGER'/><author><name>Todd</name><uri>http://www.blogger.com/profile/12411203193548271265</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_ECROYFLGK00/SYvOU2pXoyI/AAAAAAAAMCc/A_MRu-m-z1g/s1600-R/484863889_086570a0a5_o.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3466898886974008005.post-6915178955543909027</id><published>2007-12-01T22:52:00.001+08:00</published><updated>2009-01-10T14:47:05.806+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MFC'/><category scheme='http://www.blogger.com/atom/ns#' term='C++'/><title type='text'>How to change the tab order in a MFC dialog?</title><content type='html'>&lt;div&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;Step 1.&lt;/span&gt;&lt;/div&gt;In resource view of the dialog, select menu [Format] -&gt; [Tab Order] or just press Ctrl +D.&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;Step 2.&lt;/span&gt;&lt;br /&gt;Then you can select item in specified order.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3466898886974008005-6915178955543909027?l=nogeekhere.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nogeekhere.blogspot.com/feeds/6915178955543909027/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3466898886974008005&amp;postID=6915178955543909027' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3466898886974008005/posts/default/6915178955543909027'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3466898886974008005/posts/default/6915178955543909027'/><link rel='alternate' type='text/html' href='http://nogeekhere.blogspot.com/2007/12/how-to-change-tab-order-in-mfc-dialog.html' title='How to change the tab order in a MFC dialog?'/><author><name>Todd</name><uri>http://www.blogger.com/profile/12411203193548271265</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_ECROYFLGK00/SYvOU2pXoyI/AAAAAAAAMCc/A_MRu-m-z1g/s1600-R/484863889_086570a0a5_o.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3466898886974008005.post-4950322182279938310</id><published>2007-11-29T23:43:00.001+08:00</published><updated>2009-01-10T14:49:27.139+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio 2003 .NET'/><category scheme='http://www.blogger.com/atom/ns#' term='MFC'/><category scheme='http://www.blogger.com/atom/ns#' term='C++'/><title type='text'>Fatal error C1010: unexpected end of file while looking for precompiled header directive</title><content type='html'>&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;Root Cause:&lt;/span&gt;&lt;br /&gt;Cpp files in a MFC project have to include "stdafx.h" for creating precompiled headers.&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;Solution:&lt;/span&gt;&lt;br /&gt;#include "stdafx.h" or turn off using precompiled headers.&lt;br /&gt;&lt;br /&gt;Visual Studio 2003 .NET&lt;br /&gt;[Properties] of that *.cpp file -&gt; [C/C++] -&gt; [Precompiled Headers]&lt;br /&gt;Set [Create/Use Precompiled Header] to "Not Using Precompiled Headers"&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3466898886974008005-4950322182279938310?l=nogeekhere.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nogeekhere.blogspot.com/feeds/4950322182279938310/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3466898886974008005&amp;postID=4950322182279938310' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3466898886974008005/posts/default/4950322182279938310'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3466898886974008005/posts/default/4950322182279938310'/><link rel='alternate' type='text/html' href='http://nogeekhere.blogspot.com/2007/11/fatal-error-c1010-unexpected-end-of.html' title='Fatal error C1010: unexpected end of file while looking for precompiled header directive'/><author><name>Todd</name><uri>http://www.blogger.com/profile/12411203193548271265</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_ECROYFLGK00/SYvOU2pXoyI/AAAAAAAAMCc/A_MRu-m-z1g/s1600-R/484863889_086570a0a5_o.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3466898886974008005.post-6378401277378852571</id><published>2007-11-27T23:33:00.000+08:00</published><updated>2007-11-27T23:51:06.415+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Windows API'/><category scheme='http://www.blogger.com/atom/ns#' term='C++'/><category scheme='http://www.blogger.com/atom/ns#' term='INI Files'/><title type='text'>Read/Write INI Files</title><content type='html'>Windows API&lt;br /&gt;&lt;br /&gt;GetPrivateProfileString&lt;br /&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/ms724353.aspx"&gt;http://msdn2.microsoft.com/en-us/library/ms724353.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;WritePrivateProfileString&lt;br /&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/ms725501.aspx"&gt;http://msdn2.microsoft.com/en-us/library/ms725501.aspx&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3466898886974008005-6378401277378852571?l=nogeekhere.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nogeekhere.blogspot.com/feeds/6378401277378852571/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3466898886974008005&amp;postID=6378401277378852571' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3466898886974008005/posts/default/6378401277378852571'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3466898886974008005/posts/default/6378401277378852571'/><link rel='alternate' type='text/html' href='http://nogeekhere.blogspot.com/2007/11/readwrite-ini-files.html' title='Read/Write INI Files'/><author><name>Todd</name><uri>http://www.blogger.com/profile/12411203193548271265</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_ECROYFLGK00/SYvOU2pXoyI/AAAAAAAAMCc/A_MRu-m-z1g/s1600-R/484863889_086570a0a5_o.jpg'/></author><thr:total>0</thr:total></entry></feed>
