FILETIME, SYSTEMTIME, COleDateTime和UTC的关系以及如何相互转换(一)

FILETIME和SYSTEMTIME是Windows API提供给我们的两个存储文件时间和系统时间的重要数据结构, COleDateTime则是在OLE Automation中使用的对时间数据的封装, 因其方便性也经常被混合使用. 然而三者的混合使用却在UTC这个概念上很容易出错. 笔者希望通过这篇文章对FILETIME, SYSTEMTIME, COleDateTime三者在UTC这个点上的联系与区分进行整理总结, 并给出两句容易记忆的总结语概括之.
Read More

How to Access Windows Clipboard by Windows API (With CString, ANSI, Unicode Issue Explained)

We discuss how to write text data into windows system clipboard in this article by trying out three different versions of code (incorrect ones and correct ones). The issue about CString (dynamic array of TCHAR), ANSI and Unicode would be raised from these experimental code too. We will also distinguish CString related stuff in Visual C++ of (LPSTR, LPCSTR); (LPWSTR, LPCWSTR) ; (LPTSTR, LPCTSTR); and BSTR.
Read More