Tuesday, August 31, 2010

CArray Members

http://msdn.microsoft.com/en-us/library/7y7b8fx3.aspx

GetCount, GetSize, GetUpperBound seem to be all the same.

CString Methods at MSDN

http://msdn.microsoft.com/ja-jp/library/ms908314.aspx

Can use 'Find' to find a sub string in another string.


Copying a BSTR to a CString.

Note that the BSTR must be converted to a _bstr_t first.  If this is not done you only get the first character of the BSTR in the new CString.

 BSTR GetBSTR() {     _bstr_t bstr1(_T("This is the test string."));          BSTR bstr;      bstr = bstr1.copy();      return bstr; }     CComBSTR GetComBSTR() {     CComBSTR bstr("This is the test string.");      return bstr; }   void CVbsDlg::ShowBSTR(BSTR bstr) {     _bstr_t bstrStart(bstr);           CString s;      s.Format(_T("%s"), (LPCTSTR)bstrStart);      AfxMessageBox(s);  } 

COleDateTime:: Format

http://msdn.microsoft.com/en-us/library/bab3feb1(VS.80).aspx

The lowest resolution of the formating is in seconds.


DATE Description and Use


This is a 8-byte floating-point number.  Days are represented by whole number increments starting with 30 December 1899.

0.00 is 20 Dec 1899, midnight
-1.00 is 29 December 1899, midnight
5.50 is 4 January 1900, noon.



For comparing two dates:

if ((date2 - date1)  < FLT_EPSILON)
{
      printf("same date");
}

FLT_EPSILON is defined in the LIMITS.H include file for .NET. 

Defined in FLOAT.H for unmanaged code.



Wednesday, August 18, 2010

Server Message Block (SMB)

http://en.wikipedia.org/wiki/Server_Message_Block

An application network protocol known as "Microsoft Windows Network" in Windows systems.

Implemented by Samba on Linux systems and other Unix like systems.

Also called Common Internet File System (CIFS).