home *** CD-ROM | disk | FTP | other *** search
- //-----------------------------------------------------------------------------
- // MFCBeeGrid.h - part of the BeeGrid samples
- // Copyright ⌐ 2000,2001 Stinga
- //
- // The MFCBeeGrid class encapsulates code needed to use BeeGrid in MFC dialogs.
- // To use it, derive your dialog class from the MFCBeeGrid class or use it as
- // a member variable.
- //
- // Too add BeeGrid to your dialog follow these steps:
- //
- // 1. Copy MFCBeeGrid.h file into your application folder or
- // add it into the include path.
- // 2. Open dialog in a Dialog Editor and right click on it.
- // 3. Choose 'Insert ActiveX control' command.
- // 4. Scroll down to the 'Stinga BeeGrid Control', select it and press OK.
- // 5. In dialog's .h file add this include statement:
- //
- // #include "MFCBeeGrid.h"
- //
- // 6. Add the MFCBeeGrid member variable to your dialog:
- //
- // CMyDialog : public CDialog
- // {
- // ....
- //
- // MFCBeeGrid m_grid;
- //
- // ....
- // };
- //
- // 7. Add DDX_BeeGrid statement to the dialog's implementation file.
- // To avoid problems with ClassWizard, add it outside of the
- // AFX_DATA_MAP block.
- //
- // CMyDialog::DoDataExchange(CDataExchange* pDX)
- // {
- // CDialog::DoDataExchange(pDX);
- // //{{AFX_DATA_MAP(CMyDialog)
- // ....
- // //}}AFX_DATA_MAP
- //
- // // Add DDX routine here to avoid problems with ClassWizard
- // DDX_BeeGrid(pDX, IDC_GRID1, m_grid);
- // }
- //
- // 8. That's it. Now you can use BeeGrid like this:
- //
- // m_grid.intf->DataRowCount = 123;
- // m_grid.intf->RowNumbering = VARIANT_TRUE;
- //
- //-----------------------------------------------------------------------------
-
-
- #ifndef Simple_BeeGrid_H
- #define Simple_BeeGrid_H
-
- #include "BeeGridSinkIntfs.h"
-
- // Import ADO typelibs. Needed because few OLEDB interfaces are
- // used by the BeeGrid type library.
- #import "msdatsrc.tlb"
-
- // Import BeeGrid typelibs.
- // If BeeGrid OCX is not in your path, please enter full path here.
- #import "beegdo10.ocx" rename("EOF","PropEOF"), rename("BOF","PropBOF"), named_guids, exclude("IsgConditionTest","IsgGridCustomDraw","IsgGridDataSource","sgGridCustomDraw")
- using namespace BeeGridOLEDB10;
-
-
- class MFCBeeGrid : public CWnd {
- public:
- IsgGridPtr intf; // Smart pointer that points to the IsgGrid interface
-
- void Init()
- {
- intf = GetControlUnknown();
- }
- };
-
- inline void DDX_BeeGrid(CDataExchange* pDX, int nIDC, MFCBeeGrid& rGrid)
- {
- DDX_Control(pDX, nIDC, rGrid);
- rGrid.Init();
- }
-
-
- #endif // Simple_BeeGrid_H