Article ID: 115705
Article Last Modified on 7/5/2005
unsigned int tmp1, tmp2; tmp1 = WORD(timeVal); tmp2 = WORD(dateVal); m_dwVal = MAKELONG(tmp1, tmp2);-or-
m_dwVal = MAKELONG((WORD)timeVal, (WORD)dateVal);
/* Compile options needed: /c
*/
typedef unsigned short WORD;
typedef unsigned long DWORD;
#define LONG long
#define MAKELONG(low, high) ((LONG)(((WORD)(low)) | \
(((DWORD)((WORD)(high))) << 16)))
class CMyDate
{
public:
operator WORD()
{
return m_wVal;
}
private:
WORD m_wVal;
};
class CMyTime
{
public:
operator WORD()
{
return m_wVal;
}
private:
WORD m_wVal;
};
class CMyDateTime
{
CMyDateTime(CMyDate dateVal, CMyTime timeVal)
{
m_dwVal = MAKELONG(WORD(timeVal), WORD(dateVal));
// This call works in both, even though it is identical.
m_dwVal= MAKELONG(timeVal.operator WORD(), dateVal.operator
WORD());
}
private:
DWORD m_dwVal;
};
Additional query words: kbVC400bug 8.00 8.00c 9.00
Keywords: kbbug kbfix kbnoupdate kbcpponly kbcompiler KB115705