<CDialogBar ¸¦ CDialog ó·³ »ç¿ëÇϱâ>

 

CCalBar classÀÇ .h/.cpp ¾È¿¡ ÁÖ¼®À» ´Þ¾Ò½À´Ï´Ù.

----------------------------------------------------------------------------------
// calbar.h
 
#if !defined(AFX_CALBAR_H__1E82E2C9_D3C4_11D1_A4FF_00AA00C0AFD5__INCLUDED_)
#define AFX_CALBAR_H__1E82E2C9_D3C4_11D1_A4FF_00AA00C0AFD5__INCLUDED_

#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
// CalBar.h : header file
//

/* CDialogBar ¸¦ CDialog ó·³ »ç¿ëÇϱâ
 
1.    ¸®¼Ò½º ¿¡µðÆ®·Î ´ÙÀ̾ó·Î±× ÅÛÇø´À» ¸¸µç´Ù.
    toolbaró·³ º¸ÀÌ°Ô ¸¸µç´Ù(titleÀ» ¾ø¾Ö°í, thinÀ¸·Î, ...)
    styleÀ» popup¿¡¼­ child·Î ¹Ù²Û´Ù.
 
2.    new class·Î »õ·Î¿î Ŭ·¡½º¸¦ ¸¸µç´Ù.
    wizard°¡ CDialogBar¸¦ Áö¿øÇÏÁö ¾ÊÀ¸¹Ç·Î base class¸¦ generic CWnd·Î ¼±ÅÃÇÑ´Ù.
    »ý¼ºÈÄ .h/.cpp¿¡ ÀÖ´Â CWnd¸¦ CDialogBar·Î ¸ðµÎ ´ëüÇÑ´Ù.
    (public CWnd -> public CDialogBar, BEGIN_MESSAGE_MAP(..., CWnd -> CDialogBar))
 
3.    class wizard°¡ »ç¿ëÇÏ´Â .clw ÆÄÀÏÀ» ÆíÁýÇÑ´Ù.
    .clwÆÄÀÏÀ» ¿­¾î »ý¼ºÇÑ Å¬·¡½ºÀÇ À̸§ Ç׸ñ¿¡
    BaseClass=CWnd -> CDialogBar·Î º¯°æÇÏ°í,
    Filter=W ¸¦ Filter=D·Ñ ¹Ù²Û´Ù.
    ±×·³ class wizird·Î CDialog ÇÔ¼ö¸¦ Ãß°¡ÇÒ¼ö ÀÖ´Ù.
 
4.    DDX/DDV¸¦ »ç¿ëÇϱâ À§ÇØ
     ¸Þ¼¼Áö ó¸®ÇÔ¼ö afx_msg LRESULT HandleInitDialog(WPARAM, LPARAM)¸¦ Ãß°¡ÇÏ°í
    ¸Þ¼¼Áö ¸Ê¿¡¼­ WM_INITDIALOG¿Í ¸ÅÇνÃŲ´Ù. - ON_MESSAGE(WM_INITDIALOG, HandleInitDialog)
    HandleInitDialog ¾È¿¡¼­ OninitDialog()¸¦ È£ÃâÇÏ°í,
    baseÀÎ CDialogBar::HandleInitDialog(wParam, lParam)¸¦ È£ÃâÇÑ´Ù.
    DoDataExchange(...)¸¦ ¿À¹ö·ÎµùÇÑ´Ù.
    OnInitDialog()¸¦ ¿À¹ö·ÎµùÇÏ°í ¾È¿¡¼­ ÄÁÆ®·Î ÃʱâÀÛ¾÷°ú UpdateData(FALSE)¸¦
    È£ÃâÇÑ´Ù.
 
5.    //{{AFX_DATA(...)        //}}AFX_DATA        .h
    //{{AFX_DATA_INIT(...)    //}}AFX_DATA_INIT    .cpp - ctor
    //{{AFX_DATA_MAP(...)    //}}AFX_DATA_MAP    .cpp - DoDataExchage
    ¸¦ Ãß°¡Çϸé class wizard ·Î member vairlabeÀ» Ãß°¡ÇÒ¼ö ÀÖ´Ù.
 
6.  CMainFrame::OnCreate() ¾È¿¡¼­ toolbar ó·¯ »ý¼ºÇÑ´Ù.
 
7.    ³¡À¸·Î À§ÀÇ ±â´ÉÀº CDialogÀÇ ¸¹Àº ºÎºÐÀÌ CWnd ¾È¿¡ ±¸ÇöµÇ¾î Àֱ⠶§¹®¿¡
    °¡´ÉÇÑ°ÍÀÌ´Ù. ÀÌ·¸°Ô ¸¸µé¸é Á÷Á¢ÄÚµùÇÏ´Â ¹ø°Å·¯¿òÀ» ¸¹ÀÌ ÁÙÀϼö ÀÖ´Ù.
    Åø¹Ù¿¡ ¹öÆ°¿Ü¿¡ ´Ù¸¥ ÄÁÆ®·ÑÀ» »ðÀÔÇϴ°ÍÀº resourc editÀÇ µµ¿òÀ» ¹ÞÀ»¼ö ¾øÀ½¹Ç·Î
    Á÷Á¢ ÄÚµùÇØ¾ß µÇ°í, ¹öÆ°ÀÌ Çϳª¶óµµ ÀÖ¾î¾ß Á¦´ë·Î Ãâ·ÂµÈ´Ù.(Å©±â ¹®Á¦)
*/
 
#include "yearedit.h"
 
/////////////////////////////////////////////////////////////////////////////
// CCalBar window
 
class CCalBar : public CDialogBar
{
// Construction
public:
    CCalBar();
 
// Attributes
public:
    //{{AFX_DATA(CCalBar)
    enum { IDD = IDD_CALBAR };
    int m_nMonth;
    int m_nYear;
    CYearEdit    m_edit;
    CComboBox    m_cbox;
    CSpinButtonCtrl    m_spin;
    //}}AFX_DATA
 
// Operations
public:
 
// Overrides
    // ClassWizard generated virtual function overrides
    //{{AFX_VIRTUAL(CCalBar)
    //}}AFX_VIRTUAL
 
// Implementation
protected:
    virtual void DoDataExchange( CDataExchange* pDX );

public:
    bool InitInstance(CWnd* pParentWnd);
    void GetDay(int& nYear, int& nMonth);
    void SetDay(int nYear, int nMonth);
    virtual ~CCalBar();
 
    // Generated message map functions
protected:
    //{{AFX_MSG(CCalBar)
    afx_msg LRESULT HandleInitDialog(WPARAM, LPARAM);
    virtual BOOL OnInitDialog();
    //}}AFX_MSG
    DECLARE_MESSAGE_MAP()

};

/////////////////////////////////////////////////////////////////////////////
 
//{{AFX_INSERT_LOCATION}}
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_CALBAR_H__1E82E2C9_D3C4_11D1_A4FF_00AA00C0AFD5__INCLUDED_)

 
------------------------------------------------------------------------------
 
// CalBar.cpp : implementation file
//
 
#include "stdafx.h"
#include "cal.h"
#include "CalBar.h"
 
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE

static char THIS_FILE[] = __FILE__;
#endif
 
/////////////////////////////////////////////////////////////////////////////
// CCalBar
 
CCalBar::CCalBar()
{
    //{{AFX_DATA_INIT(CCalBar)
    m_nYear = 1;
    m_nMonth = 0;

    //}}AFX_DATA_INIT
}
 
CCalBar::~CCalBar()
{
}
 
BEGIN_MESSAGE_MAP(CCalBar, CDialogBar)

    //{{AFX_MSG_MAP(CCalBar)
    ON_MESSAGE(WM_INITDIALOG, HandleInitDialog)
    //}}AFX_MSG_MAP
END_MESSAGE_MAP()
 
/////////////////////////////////////////////////////////////////////////////
// CCalBar message handlers
 
// CDialogBar ¸¦ CDialog ó·³ »ç¿ëÇϱâ À§ÇØ OnInitDialog¸¦ È£ÃâÇÑ´Ù.
// CDialog ¿ª½Ã ÀÌ·±½ÄÀ¸·Î ±¸¼ºµÇ¾î ÀÖ´Ù.
LRESULT CCalBar::HandleInitDialog(WPARAM wParam, LPARAM lParam)
{
    OnInitDialog();
 
    return CDialogBar::HandleInitDialog(wParam, lParam);
}
 
void CCalBar::DoDataExchange( CDataExchange* pDX )
{
    //{{AFX_DATA_MAP(CCalBar)
    DDX_Control(pDX, IDW_MONTH, m_cbox);
    DDX_Control(pDX, IDW_YEAR,  m_edit);
    DDX_Control(pDX, IDW_YEAR_SELECT, m_spin);
    DDX_Text(pDX, IDW_YEAR, m_nYear);
    DDX_CBIndex(pDX, IDW_MONTH, m_nMonth);
    //}}AFX_DATA_MAP
}

void CCalBar::SetDay(int nYear, int nMonth)
{
    /*
    CString string;
    string.Format("%d", nYear);
    
    m_edit.SetWindowText(string);
    m_cbox.SetCurSel(nMonth - 1);
    */

    m_nYear = nYear;
    m_nMonth = nMonth - 1;
    UpdateData(FALSE);
}

BOOL CCalBar::OnInitDialog()
{
    // TODO: Add extra initialization here
    UpdateData(FALSE);
 
    m_spin.SetRange(1, 3000);
    m_cbox.SetCurSel(0);
    
    return TRUE;  
}

void CCalBar::GetDay(int & nYear, int & nMonth)
{
    UpdateData();
    nYear = m_nYear;
    nMonth = m_nMonth + 1;
}

 

<´ÙÀ̾ó·Î±×¹ÙÀÇ ÃʱâÈ­>

´ÙÀ̾ó·Î±×¹Ù´Â Åø¹Ù¿Í ´Þ¸® ÄÞº¸ ¹Ú½º ¿¡µðÆ® ¹Ú½ºµî ´ÙÀ̾ó·Î±×¿¡¼­ »ç¿ëÇÒ ¼ö ÀÖ´Â ÄÁÆ®·ÑµéÀ» ¸ðµÎ »ç¿ëÇÒ ¼ö ÀÖ½À´Ï´Ù. ±×·¡¼­ Á»´õ À¯¿ëÇÏ´Ù°í º¼¼ö ÀÖÁÒ.

Çѵ¥ ´ÙÀ̾ó·Î±×´Â OnInitDialog¿¡¼­ ÃʱâÈ­ÇØÁÙ ¼ö ÀÖÁö¸¸ ´ÙÀ̾ó·Î±×¹Ù´Â ±× ºÎºÐÀÌ ¾ø½À´Ï´Ù. ±× ºÎºÐÀ» Á÷Á¢ ¸¸µé¾î ÁÖ½Ã¸é ´ÙÀ̾ó·Î±×¿Í ¶È°°ÀÌ »ç¿ëÇÒ ¼ö ÀÖ½À´Ï´Ù. ÄÚµå´Â ´ÙÀ½°ú °°½À´Ï´Ù.

 1. Çì´õ ÆÄÀÏ¿¡ ´ÙÀ½°ú °°ÀÌ Ãß°¡ÇÕ´Ï´Ù. 

    afx_msg LRESULT InitDialog(WPARAM, LPARAM);
    afx_msg BOOL OnInitDialog(); 

2. cpp ÆÄÀÏ ¸Þ¼¼Áö ¸Ê ºÎºÐ¿¡ ´ÙÀ½À» Ãß°¡ÇÕ´Ï´Ù.

     ON_MESSAGE(WM_INITDIALOG, InitDialog) 

3. ´ÙÀ½°ú °°ÀÌ ÄÚµùÇÕ´Ï´Ù.

 LRESULT CMyBar::InitDialog(WPARAM, LPARAM)
{
    UpdateData(FALSE);
    OnInitDialog();
 
    return 0L;
}

BOOL CMyBar::OnInitDialog()
{
    // ¿©±â¿¡´Ù°¡ ÃʱâÈ­ Äڵ带 Àû½À´Ï´Ù.
 
    return TRUE;  // return TRUE unless you set the focus to a control
                        // EXCEPTION: OCX Property Pages should return FALSE
}

 

½ÇÁ¦·Î ´ÙÀ̾ó·Î±×¹Ù´Â OnInitDialog°¡ ¾øÁö¸¸ WM_INITDIALOG ¸Þ¼¼Áö´Â ¹Þ½À´Ï´Ù.

±×°É ÀÌ¿ëÇÑ °ÍÀÔ´Ï´Ù.

 

==========

´ÙÀ½°ú °°ÀÌ ¹Ù²Ù¸é Äڵ尡 ¿ÏÀüÇÏ°Ú½À´Ï´Ù.

 

1. Çì´õ ÆÄÀÏ¿¡ ´ÙÀ½°ú °°ÀÌ Ãß°¡ÇÕ´Ï´Ù.

    afx_msg LRESULT InitDialog(WPARAM wParam, LPARAM lParam);
    afx_msg BOOL OnInitDialog();

2. cpp ÆÄÀÏ ¸Þ¼¼Áö ¸Ê ºÎºÐ¿¡ ´ÙÀ½À» Ãß°¡ÇÕ´Ï´Ù.

    ON_MESSAGE(WM_INITDIALOG, InitDialog)

3. ´ÙÀ½°ú °°ÀÌ ÄÚµùÇÕ´Ï´Ù.

LRESULT CMyBar::InitDialog(WPARAM wParam, LPARAM lParam)
{
    if ( !HandleInitDialog(wParam, lParam) || !UpdateData(FALSE))
    {
        TRACE0("Warning: UpdateData failed during dialog init.\n");
        return FALSE;
    }
    return OnInitDialog();
}

BOOL CMyBar::OnInitDialog()
{
         // ¿©±â´Ù°¡ ÃʱâÈ­ Äڵ带 Àû½À´Ï´Ù.
 
    return TRUE;  // return TRUE unless you set the focus to a control
                        // EXCEPTION: OCX Property Pages should return FALSE

=========

±×·¸°Ô Â¥½Ã¸é OnInitDialog¿¡¼­ÀÇ ¸®ÅÏ°ªÀÌ Àǹ̰¡ ¾ø°Ô µÇ´Âµ¥¿ä.

¸®ÅÏ °ª¿¡ µû¶ó¼­ óÀ½¿¡ Æ÷Ä¿½º°¡ °¡´Â Â÷Àϵå ÄÁÆ®·ÑÀ» Á÷Á¢ ÁöÁ¤ÇÑ°Í¿¡ µû¸£´À³Ä, ¾Æ´Ï¸é ¸®¼Ò½º¿¡¼­ ¼±¾ðÇÑ Ã¹¹ø° ÄÁÆ®·Ñ·Î °¡´À³Ä°¡ ´Þ¶óÁö°Ô µË´Ï´Ù. 

Àû¾îµµ InitDialog¿¡¼­ OnInitDialogÀÇ ¸®ÅÏ°ªÀ» ¸®ÅÏÇØ¾ß ÇÕ´Ï´Ù.

 ±×¸®°í ¾Æ·¡ÀÇ ¿µ¾î(¼Ø¾¾´Â ¾ÈµÇÁö¸¸ ȨÁÖÀÎÀÌ ¸¶À½´ë·Î ¹ø¿ªÇØ ºÃ½À´Ï´Ù...)´Â MS¿¡¼­ Á¦½ÃÇÏ´Â ´ÙÀ̾ó·Î±×¹Ù »ç¿ëÇÏ´Â ¹ýÀÔ´Ï´Ù. Á» º¹ÀâÇϱä Çصµ È®½ÇÈ÷ µ¹¾Æ°¡Áö¿ä.

 HandleInitDialog´Â OLE ÄÁÆ®·ÑÀ» ÃʱâÈ­ÇØÁÖ´Â ÀÏÀ» ÇÏ´Â CDialogBarÀÇ ÇÔ¼öÀÔ´Ï´Ù. ¾ÈºÒ·¯Á൵ µÇ´Â »óȲÀÌ ¸¹°ÚÁö¸¸, ¾ÈÀüÇÏ°Ô ÇÏÀÚ¸é ºÒ·¯ÁÖ´Â°Ô ÁÁ°ÚÁÒ.

 

MFCÀÇ "¹Ì¸®º¸±â"ó·³ ´Ü¼øÈ÷ CButtons¸¸À» »ç¿ëÇÑ ´Ü¼øÇÑ CDialogBar¸¦ »ý¼ºÇÒ ¶§, CDialogBar¿¡¼­ ÆÄ»ý½Ãų ÇÊ¿ä´Â ¾ø½À´Ï´Ù. CControlBarÀÇ parent´Â Â÷Àϵå ÄÁÆ®·Ñ·ÎºÎÅÍ ÅëÁö ¸Þ½ÃÁö¸¦ ¹Þ±â ¶§¹®ÀÌÁÒ.

When creating a simple CDialogBar, such as one with only CButtons similar to MFC's print preview, it is not necessary to derive from CDialogBar because the parent of CControlBar receives the notification messages from any child controls.

 ±×·¯³ª, drop-down ÄÞº¸¹Ú½º, Æ®¸®ºä, ActiveX ÄÁÆ®·Ñ °°Àº °ÍÀ» Æ÷ÇÔÇÑ Á»´õ º¹ÀâÇÑ CDialogBarÀÇ °æ¿ì¿¡´Â, Â÷Àϵå ÄÁÆ®·ÑÀÇ ÃʱâÈ­¸¦ ÇϱâÀ§Çؼ­ CDialogBar¿¡¼­ ÆÄ»ý½ÃÅ°´Â °ÍÀÌ À¯¿ëÇÒ °Ì´Ï´Ù.

However, in the case of a more complex CDialogBar, which might have a drop-down combo box, a treeview, or ActiveX control, it might be useful to derive from CDialogBar to provide initialization for the child controls.

  Å¬·¡½º À§Àúµå¿¡¼­ CDialogBar´Â º£À̽º Ŭ·¡½º·Î ³ªÅ¸³ªÁö ¾Ê±â ¶§¹®¿¡, ´ÙÀ½ ±ÛÀº CDialog¿¡¼­ ÆÄ»ýµÈ Ŭ·¡½º¸¦ CDialogBar¿¡¼­ ÆÄ»ýµÈ Ŭ·¡½º·Î ¹Ù²Ù´Â ¹æ¹ýÀ» º¸¿©ÁÝ´Ï´Ù.

Because ClassWizard does not support deriving a class from CDialogBar, this article shows the steps necessary to create a class from CDialog and then "convert" the class to CDialogBar.

 

MORE INFORMATION

================

 ¿ì¼±, °¢Á¾ Â÷Àϵå ÄÁÆ®·ÑµéÀ» Æ÷ÇÔÇÑ CDialog Ŭ·¡½º¸¦ ¸¸µì´Ï´Ù. ´ÙÀ½ ¾ÆÈ©°¡Áö ¼ø¼­¸¦ °ÅÃÄ CDialog Ŭ·¡½º¸¦ CDialogBar Ŭ·¡½º·Î º¯°æ½Ãų ¼ö ÀÖ½À´Ï´Ù.

To start out, create a CDialog class with the child controls you want to use. You can transform the CDialog class into a CDialogBar class using the following nine steps:

 

1. Change the base class from CDialog to CDialogBar in the class declaration. Don't forget to also change the base class in BEGIN_MESSAGE_MAP in the .cpp file.

2. Change the constructor in both the .h and the .cpp files. Also make the change to the DoDataExchange(). Below are three items to change.

  Change the following from

 

      CMyDlgBar (CWnd* pParent = NULL);   // standard constructor

      CMyDlgBar:: CMyDlgBar (CWnd* pParent /*=NULL*/)
         : CDialog(CMyDlgBar::IDD, pParent)
      {
         ...

      void CMyDlgBar::DoDataExchange(CDataExchange* pDX)
      {
         CDialog::DoDataExchange(pDX);
         ...

 

   to the following:

 

      CMyDlgBar ();   // standard constructor

      CMyDlgBar:: CMyDlgBar ()
      {
         ...

      void CMyDlgBar::DoDataExchange(CDataExchange* pDX)
      {
         CDialogBar::DoDataExchange(pDX);
         ...

 

   The key to the transformation is the conversion of the virtual OnInitDialog() member function to the WM_INITDIALOG message mapped method by changing the OnInitDialog method and by adding the ON_MESSAGE() handler. You may not have an override of OnInitDialog(). If not, add one before proceeding.

 

3. Remove "virtual BOOL OnInitDialog();" from the class header and add "afx_msg LONG OnInitDialog ( UINT, LONG );" in its place. For example:

 

      class CMyDlgBar : public CMyDlgBar
      {
         ...
      // Implementation
      protected:

         // Generated message map functions
         //{{AFX_MSG(CMyDlgBar)
         virtual BOOL OnInitDialog();                // <-Remove this line.
         //}}AFX_MSG

         afx_msg LONG OnInitDialog ( UINT, LONG );   // <-Add this line.
         DECLARE_MESSAGE_MAP()
      };

 

   Now, in the class implementation section, make the corresponding changes.

 

4. Add "ON_MESSAGE(WM_INITDIALOG, OnInitDialog );" to the message map in the .CPP implementation file. For example:

 

      BEGIN_MESSAGE_MAP(CMyDlgBar, CDialogBar)
         //{{AFX_MSG_MAP(CMyDlgBar)
         ...
         //}}AFX_MSG_MAP
         ON_MESSAGE(WM_INITDIALOG, OnInitDialog )    // <-- Add this line.
      END_MESSAGE_MAP()

 

   Now, convert the virtual OnInitDialog() to the message-mapped OnInitDialog().

 

5. Make the OnInitDialog() conversion as follows:

    Change the following:

 

      BOOL CMyDlgBar::OnInitDialog()
      {
         CDialog::OnInitDialog();   // <-- Replace this line:
            ...
 

   to the following:

 

      LONG CMyDlgBar::OnInitDialog ( UINT wParam, LONG lParam)
      {
                       // <-- with these lines. -->

         if ( !HandleInitDialog(wParam, lParam) || !UpdateData(FALSE))
         {
            TRACE0("Warning: UpdateData failed during dialog init.\n");
            return FALSE;
         }
         ...

 

   The CDialogBar class doesn't have a virtual OnInitDialog(), and therefore calling one does not work. UpdateData is called to subclass or initialize any child controls.

 

6. Make sure the dialog box resource styles to the following:

      Style: Child
      Boarder: None
      Visible: Unchecked 

   At this point, everything has been reconnected to make the transformation from a CDialog class to a CDialogBar class work correctly. Now, create and use it.

 

7. Add an instance of the derived CDialogBar to the CframeWnd-derived class (normally called CMainFrame). For example:

 

      class CMainFrame : public CFrameWnd
      {
          ...
          CMyDlgBar m_myDlgBar;
          ...
      };

 

8. Call the create method for the m_myDlgBar variable in the CFrameWnd::OnCreate() method similar to the following:

       int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
      {
         ...
         if (!m_myDlgBar.Create(this, IDD_DLGBAR1, CBRS_LEFT, IDD_DLGBAR1))
         {
            TRACE0("Failed to create dialog bar\n");
            return -1;      // fail to create
         }
         ...
      }

 

9. Finally, if you want to support dynamic docking and resizing of the CDialogBar, add the following lines to the end of CMainFrame::OnCreate():

 

      int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
      {
         ...
         m_myDlgBar.SetBarStyle(m_wndToolBar.GetBarStyle() |
            CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);
         m_myDlgBar.EnableDocking(CBRS_ALIGN_ANY);
         DockControlBar(&m_myDlgBar);

         return 0;
      }

 

REFERENCES

==========

 

For additional information, please see the following article in the Microsoft Knowledge Base:

   ARTICLE-ID: Q99161
   TITLE     : HOWTO: Derive From Classes not Listed in ClassWizard

 

Additional query words: kbDSupport kbdsd

======================================================================

Keywords          : MfcUI
Version           : WINNT:5.0
Platform          : winnt
Issue type        : kbhowto

=============================================================================

 

THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND.  MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL,

CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.  SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.