• Welcome to Jose's Read Only Forum 2023.
 

Microsoft Hierarchical Grid Control

Started by José Roca, December 17, 2008, 09:00:47 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

José Roca

 
The Hierarchical FlexGrid control displays tabular data. Unlike the DataGrid, it is strictly read-only. However, it can sort, merge, and format tables containing strings and pictures. Additionally, the Hierarchical FlexGrid differs from its predecessor, the FlexGrid, in that it can display both summary data and detail data.

A hierarchical rowset is required to display summary-detail information in the Hierarchical FlexGrid control. To create a hierarchical rowset for this control, the Microsoft Data Shape Provider is required in combination with the ADO data control.

The attached file includes several examples that demonstrate how to create a registration-free instance of the control using my OLE Container (OLECON.INC) to host it, how to fill rows and columns using an ADO recordset, how to connect to the events fired by the control, how to set the default font for all the cells, how to use it in combination with the ADODC control, and how to use it with the Microsoft Data Shape Provider.

Registration-free means that you don't need to register the control to be able to use it. To use this registration-free version, you must copy MSHFLXGD.OCX and MSADODC.OCX in the application folder, as if they were standard DLLs.

For using registered versions of the controls, change the following code in the examples:


' Create a registration-free instance of the MSHFlexGrid control
LOCAL  cp AS OC_CREATEPARAMS
cp.clsid = $CLSID_MSHFlexGrid
cp.riid = $IID_IMSHFlexGrid
cp.szLicKey = $RTLKEY_MSHFlexGrid
cp.szLibName = EXE.Path$ & "MSHFLXGD.OCX"
hGrid = CreateWindowEx(0, $OC_CLASSNAME, "", _
   %WS_CHILD OR %WS_VISIBLE OR %WS_BORDER OR %WS_TABSTOP, _
   0, 0, 0, 0, CB.HNDL, %IDC_GRID, GetModuleHandle(BYVAL %NULL), cp)


to:


' Create an instance of the control
hGrid = CreateWindowEx(0, $OC_CLASSNAME, _
      "MSHierarchicalFlexGridLib.MSHFlexGrid.6;RTLKEY:" & $RTLKEY_MSHFlexGrid, _
      %WS_CHILD OR %WS_VISIBLE OR %WS_TABSTOP, 0, 0, 0, 0, hWnd, %IDC_GRID, GetModuleHandle(BYVAL %NULL), BYVAL %NULL)


In the example that uses the ADODC control, change also:


' Create a registration-free instance of the ADODC control
LOCAL hAdodc AS DWORD
cp.clsid = $CLSID_Adodc
cp.riid = $IID_IAdodc
cp.szLicKey = $RTLKEY_ADODC
cp.szLibName = EXE.Path$ & "MSADODC.OCX"
hAdodc = CreateWindowEx(0, $OC_CLASSNAME, "", _
   %WS_CHILD OR %WS_VISIBLE OR %WS_BORDER OR %WS_TABSTOP, _
   0, 0, 0, 0, CB.HNDL, %IDC_ADODC, GetModuleHandle(BYVAL %NULL), cp)


to:


' Create an instance of the control
hAdodc = CreateWindowEx(0, $OC_CLASSNAME, _
      "MSAdodcLib.Adodc.6;RTLKEY:" & $RTLKEY_ADODC, _
      %WS_CHILD OR %WS_VISIBLE OR %WS_TABSTOP, 0, 0, 0, 0, hWnd, %IDC_ADODC, GetModuleHandle(BYVAL %NULL), BYVAL %NULL)


José Roca

#1
 
The following example demonstrates how to create a registration-free instance of the Microsoft Hierarchical Flex Grid Control using my OLE Container (OLECON.INC) to host it, how to fill rows and columns using an ADO recordset, how to connect to the events fired by the control and how to set the default font for all the cells.

DDT Version:


' ########################################################################################
' Microsoft Hierarchical Grid Control Demo
' ########################################################################################

#COMPILE EXE
#DIM ALL
#INCLUDE ONCE "ADO.INC"
#INCLUDE ONCE "MSHFLXGD.INC"
#INCLUDE ONCE "OLECON.INC"

%IDC_GRID = 1001

' ========================================================================================
' Main
' ========================================================================================
FUNCTION WINMAIN (BYVAL hInstance AS DWORD, BYVAL hPrevInstance AS DWORD, BYVAL lpszCmdLine AS ASCIIZ PTR, BYVAL nCmdShow AS LONG) AS LONG

   LOCAL hDlg AS DWORD

   ' Required: Initialize the Ole Container
   OC_WinInit

   DIALOG NEW 0, "Microsoft Hierarchical Flex Grid", , , 530, 346, %WS_OVERLAPPED OR %WS_THICKFRAME OR %WS_SYSMENU OR _
   %WS_MINIMIZEBOX OR %WS_MAXIMIZEBOX OR %WS_VISIBLE OR %DS_CENTER TO hDlg
   ' For icon from resource, instead use something like, LoadIcon(hInst, "APPICON")
   DIALOG SEND hDlg, %WM_SETICON, %ICON_SMALL, LoadIcon(%NULL, BYVAL %IDI_APPLICATION)
   DIALOG SEND hDlg, %WM_SETICON, %ICON_BIG, LoadIcon(%NULL, BYVAL %IDI_APPLICATION)

   ' We need to forward the messages to the control for keyboard handling
   ' and for that we need a message pump, so the dialog must be modeless.
   DIALOG SHOW MODELESS hDlg, CALL DlgProc

   ' Message handler loop
   LOCAL uMsg AS tagMsg
   WHILE GetMessage(uMsg, %NULL, 0, 0)
      IF ISFALSE OC_ForwardMessage(GetFocus, uMsg) THEN
         IF IsDialogMessage(hDlg, uMsg) = 0 THEN
            TranslateMessage uMsg
            DispatchMessage uMsg
         END IF
      END IF
   WEND

END FUNCTION
' ========================================================================================

' ========================================================================================
' Main Dialog procedure
' ========================================================================================
CALLBACK FUNCTION DlgProc() AS LONG

   LOCAL  hr AS LONG                              ' // HRESULT code
   LOCAL  rc AS RECT                              ' // RECT structure
   LOCAL  hGrid AS DWORD                          ' // Grid's handle
   LOCAL  pGrid AS IMSHFlexGrid                   ' // IMSFlexGrid interface reference
   STATIC pGridEvents AS DMSHFlexGridEventsImpl   ' // Events interface

   SELECT CASE CB.MSG

      CASE %WM_INITDIALOG

         ' Create a registration-free instance of the MSHFlexGrid control
         LOCAL cp AS OC_CREATEPARAMS
         cp.clsid = $CLSID_MSHFlexGrid
         cp.riid = $IID_IMSHFlexGrid
         cp.szLicKey = $RTLKEY_MSHFlexGrid
         cp.szLibName = EXE.Path$ & "MSHFLXGD.OCX"
         hGrid = CreateWindowEx(0, $OC_CLASSNAME, "", _
            %WS_CHILD OR %WS_VISIBLE OR %WS_BORDER OR %WS_TABSTOP, _
            0, 0, 0, 0, CB.HNDL, %IDC_GRID, GetModuleHandle(BYVAL %NULL), cp)

         ' Get a reference to the grid control
         pGrid = OC_GetDispatch(hGrid)

         IF ISOBJECT(pGrid) THEN

            ' Change the width of the columns (measures are in twips)
            ' The first parameter is the grid's pointer reference,
            ' the second the column index, and the third the col width.
            pGrid.ColWidth( 0,0) = 300
            pGrid.ColWidth( 1,0) = 1000
            pGrid.ColWidth( 2,0) = 3000
            pGrid.ColWidth( 3,0) = 2000
            pGrid.ColWidth( 4,0) = 2000
            pGrid.ColWidth( 5,0) = 3000
            pGrid.ColWidth( 6,0) = 1500
            pGrid.ColWidth( 7,0) = 700
            pGrid.ColWidth( 8,0) = 1200
            pGrid.ColWidth( 9,0) = 1200
            pGrid.ColWidth(10,0) = 1500
            pGrid.ColWidth(11,0) = 1500

            ' *** Set the default font for all the cells ***
            LOCAL pFont AS IDispatch
            hr = OleCreateFontDisp("Verdana", 8, %FW_BOLD, %ANSI_CHARSET, 0, 0, 0, pFont)
            IF ISOBJECT(pFont) THEN
               pGrid.putref_Font = pFont
               pFont = NOTHING
            END IF

            ' Change the foreground and background colors
            pGrid.ForeColor = %BLACK
            pGrid.BackColor = RGB(255,255,235)

            ' Create an ADO connection object
            LOCAL pCon AS ADOConnection
            pCon = NEWCOM "ADODB.Connection"
            IF ISOBJECT(pCon) THEN
               ' Connection string - Remember to change the path of the Data Source if needed
               LOCAL ConStr AS STRING
               ConStr = UCODE$("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & EXE.Path$ & "NWIND.mdb")
               ' Set the connection string
               pCon.ConnectionString = ConStr
               ' Open the database
               pCon.Open
               IF OBJRESULT = %S_OK THEN
                  ' Create an ADO recordset object
                  LOCAL pRec AS ADORecordset
                  pRec = NEWCOM "ADODB.Recordset"
                  IF ISOBJECT(pRec) THEN
                     ' Open the recordset
                     LOCAL SqlStr AS STRING
                     SqlStr = "SELECT * FROM Customers"
                     pRec.Open SqlStr, pCon, %adOpenKeyset, %adLockOptimistic, %adCmdText
                     ' Get the Datasource property of the recordset
                     LOCAL pDataSource AS IUnknown
                     pDataSource = pRec.DataSource
                     IF ISOBJECT(pDataSource) THEN
                        ' Bind the recordset to the grid
                        pGrid.putref_DataSource = pDataSource
                        pDataSource = NOTHING
                     END IF
                     ' Close the recordset
                     pRec.Close
                     pRec = NOTHING
                  END IF
               END IF
               ' Close the connection
               pCon.Close
               pCon = NOTHING
            END IF

            ' Connect to the events fired by the control
            pGridEvents = CLASS "CDMSHFlexGridEvents"
            EVENTS FROM pGrid CALL pGridEvents
            pGrid = NOTHING

         END IF

      CASE %WM_SIZE
         ' Resize the grid
         IF CB.WPARAM <> %SIZE_MINIMIZED THEN
            GetClientRect CB.HNDL, rc
            MoveWindow GetDlgItem(CB.HNDL, %IDC_GRID), 0, 0, (rc.nRight - rc.nLeft), (rc.nBottom - rc.nTop), %TRUE
         END IF

      CASE %WM_COMMAND
         SELECT CASE CB.CTL
            CASE %IDOK
               IF CB.CTLMSG = %BN_CLICKED THEN
               END IF
            CASE %IDCANCEL
               IF CB.CTLMSG = %BN_CLICKED THEN DIALOG END CB.HNDL, 0
         END SELECT

      ' --> Note: Both WM_SYSCOMMAND and WM_DESTROY are required with this control <--

      CASE %WM_SYSCOMMAND
         ' Capture this message and send a %WM_CLOSE message,
         ' or the program may remain in memory
         IF (CB.WPARAM AND &HFFF0) = %SC_CLOSE THEN
            DIALOG SEND CB.HNDL, %WM_CLOSE, 0, 0
         END IF

      CASE %WM_DESTROY
         ' Disconnect events and quit
         IF ISOBJECT(pGridEvents) THEN EVENTS END pGridEvents
         PostQuitMessage 0

   END SELECT

END FUNCTION
' ========================================================================================


' ########################################################################################
' Class CDMSHFlexGridEvents
' Interface name = DMSHFlexGridEvents
' IID = {0ECD9B63-23AA-11D0-B351-00A0C9055D8E}
' Attributes = 4096 [&H1000] [Dispatchable]
' ########################################################################################

CLASS CDMSHFlexGridEvents GUID$("{CC48E0EB-BC19-4277-ADDC-F2DCFB75664D}") AS EVENT

INTERFACE DMSHFlexGridEventsImpl GUID$("{0ECD9B63-23AA-11D0-B351-00A0C9055D8E}") AS EVENT

  INHERIT IDispatch

   ' =====================================================================================
   METHOD Click <-600>

     ' *** Insert your code here ***
     OutputDebugString FUNCNAME$

   END METHOD
   ' =====================================================================================

   ' =====================================================================================
   METHOD KeyDown <-602> ( _
     BYREF KeyCode AS INTEGER _                         ' *KeyCode /* *VT_I2 <Integer> */
   , BYVAL iShift AS INTEGER _                          ' Shift /* VT_I2 <Integer> */
   )                                                    ' void

     ' *** Insert your code here ***
     OutputDebugString FUNCNAME$

   END METHOD
   ' =====================================================================================

   ' =====================================================================================
   METHOD DblClick <-601>

     ' *** Insert your code here ***
     OutputDebugString FUNCNAME$

   END METHOD
   ' =====================================================================================

   ' =====================================================================================
   METHOD KeyPress <-603> ( _
     BYREF KeyAscii AS INTEGER _                        ' *KeyAscii /* *VT_I2 <Integer> */
   )                                                    ' void

     ' *** Insert your code here ***
     OutputDebugString FUNCNAME$

   END METHOD
   ' =====================================================================================

   ' =====================================================================================
   METHOD KeyUp <-604> ( _
     BYREF KeyCode AS INTEGER _                         ' *KeyCode /* *VT_I2 <Integer> */
   , BYVAL iShift AS INTEGER _                          ' Shift /* VT_I2 <Integer> */
   )                                                    ' void

     ' *** Insert your code here ***
     OutputDebugString FUNCNAME$

   END METHOD
   ' =====================================================================================

   ' =====================================================================================
   METHOD MouseDown <-605> ( _
     BYVAL iButton AS INTEGER _                         ' Button /* VT_I2 <Integer> */
   , BYVAL iShift AS INTEGER _                          ' Shift /* VT_I2 <Integer> */
   , BYVAL x AS LONG _                                  ' x /* OLE_XPOS_PIXELS <alias> <VT_I4> */
   , BYVAL y AS LONG _                                  ' y /* OLE_YPOS_PIXELS <alias> <VT_I4> */
   )                                                    ' void

     ' *** Insert your code here ***
     OutputDebugString FUNCNAME$

   END METHOD
   ' =====================================================================================

   ' =====================================================================================
   METHOD MouseMove <-606> ( _
     BYVAL iButton AS INTEGER _                         ' Button /* VT_I2 <Integer> */
   , BYVAL iShift AS INTEGER _                          ' Shift /* VT_I2 <Integer> */
   , BYVAL x AS LONG _                                  ' x /* OLE_XPOS_PIXELS <alias> <VT_I4> */
   , BYVAL y AS LONG _                                  ' y /* OLE_YPOS_PIXELS <alias> <VT_I4> */
   )                                                    ' void

     ' *** Insert your code here ***
     OutputDebugString FUNCNAME$

   END METHOD
   ' =====================================================================================

   ' =====================================================================================
   METHOD MouseUp <-607> ( _
     BYVAL iButton AS INTEGER _                         ' Button /* VT_I2 <Integer> */
   , BYVAL iShift AS INTEGER _                          ' Shift /* VT_I2 <Integer> */
   , BYVAL x AS LONG _                                  ' x /* OLE_XPOS_PIXELS <alias> <VT_I4> */
   , BYVAL y AS LONG _                                  ' y /* OLE_YPOS_PIXELS <alias> <VT_I4> */
   )                                                    ' void

     ' *** Insert your code here ***
     OutputDebugString FUNCNAME$

   END METHOD
   ' =====================================================================================

   ' =====================================================================================
   METHOD SelChange <69>

     ' *** Insert your code here ***
     OutputDebugString FUNCNAME$

   END METHOD
   ' =====================================================================================

   ' =====================================================================================
   METHOD RowColChange <70>

     ' *** Insert your code here ***
     OutputDebugString FUNCNAME$

   END METHOD
   ' =====================================================================================

   ' =====================================================================================
   METHOD EnterCell <71>

     ' *** Insert your code here ***
     OutputDebugString FUNCNAME$

   END METHOD
   ' =====================================================================================

   ' =====================================================================================
   METHOD LeaveCell <72>

     ' *** Insert your code here ***
     OutputDebugString FUNCNAME$

   END METHOD
   ' =====================================================================================

   ' =====================================================================================
   METHOD Scroll <73>

     ' *** Insert your code here ***
     OutputDebugString FUNCNAME$

   END METHOD
   ' =====================================================================================

   ' =====================================================================================
   METHOD Compare <74> ( _
     BYVAL Row1 AS LONG _                               ' Row1 /* VT_I4 <Long> */
   , BYVAL Row2 AS LONG _                               ' Row2 /* VT_I4 <Long> */
   , BYREF iCmp AS INTEGER _                            ' *Cmp /* *VT_I2 <Integer> */
   )                                                    ' void

     ' *** Insert your code here ***
     OutputDebugString FUNCNAME$

   END METHOD
   ' =====================================================================================

   ' =====================================================================================
   METHOD Collapse <140> ( _
     BYREF iCancel AS INTEGER _                         ' *Cancel /* *VT_BOOL <Integer> */
   )                                                    ' void

     ' *** Insert your code here ***
     OutputDebugString FUNCNAME$

   END METHOD
   ' =====================================================================================

   ' =====================================================================================
   METHOD Expand <141> ( _
     BYREF iCancel AS INTEGER _                         ' *Cancel /* *VT_BOOL <Integer> */
   )                                                    ' void

     ' *** Insert your code here ***
     OutputDebugString FUNCNAME$

   END METHOD
   ' =====================================================================================

   ' =====================================================================================
   METHOD OLEStartDrag <1550> ( _
     BYREF pData AS IVBDataObject _                     ' [in][out] **Data /* **DataObject <coclass> */
   , BYREF AllowedEffects AS LONG _                     ' [in][out] *AllowedEffects /* *VT_I4 <Long> */
   )                                                    ' void

     OutputDebugString FUNCNAME$
     ' *** Insert your code here ***

   END METHOD
   ' =====================================================================================

   ' =====================================================================================
   METHOD OLEGiveFeedback <1551> ( _
     BYREF Effect AS LONG _                             ' [in][out] *Effect /* *VT_I4 <Long> */
   , BYREF DefaultCursors AS INTEGER _                  ' [in][out] *DefaultCursors /* *VT_BOOL <Integer> */
   )                                                    ' void

     ' *** Insert your code here ***
     OutputDebugString FUNCNAME$

   END METHOD
   ' =====================================================================================

   ' =====================================================================================
   METHOD OLESetData <1552> ( _
     BYREF pData AS IVBDataObject _                     ' [in][out] **Data /* **DataObject <coclass> */
   , BYREF DataFormat AS INTEGER _                      ' [in][out] *DataFormat /* *VT_I2 <Integer> */
   )                                                    ' void

     ' *** Insert your code here ***
     OutputDebugString FUNCNAME$

   END METHOD
   ' =====================================================================================

   ' =====================================================================================
   METHOD OLECompleteDrag <1553> ( _
     BYREF Effect AS LONG _                             ' [in][out] *Effect /* *VT_I4 <Long> */
   )                                                    ' void

     ' *** Insert your code here ***
     OutputDebugString FUNCNAME$

   END METHOD
   ' =====================================================================================

   ' =====================================================================================
   METHOD OLEDragOver <1554> ( _
     BYREF pData AS IVBDataObject _                     ' [in][out] **Data /* **DataObject <coclass> */
   , BYREF Effect AS LONG _                             ' [in][out] *Effect /* *VT_I4 <Long> */
   , BYREF iButton AS INTEGER _                         ' [in][out] *Button /* *VT_I2 <Integer> */
   , BYREF iShift AS INTEGER _                          ' [in][out] *Shift /* *VT_I2 <Integer> */
   , BYREF x AS SINGLE _                                ' [in][out] *x /* *VT_R4 <Single> */
   , BYREF y AS SINGLE _                                ' [in][out] *y /* *VT_R4 <Single> */
   , BYREF iState AS INTEGER _                          ' [in][out] *State /* *VT_I2 <Integer> */
   )                                                    ' void

     ' *** Insert your code here ***
     OutputDebugString FUNCNAME$

   END METHOD
   ' =====================================================================================

   ' =====================================================================================
   METHOD OLEDragDrop <1555> ( _
     BYREF pData AS IVBDataObject _                     ' [in][out] **Data /* **DataObject <coclass> */
   , BYREF Effect AS LONG _                             ' [in][out] *Effect /* *VT_I4 <Long> */
   , BYREF iButton AS INTEGER _                         ' [in][out] *Button /* *VT_I2 <Integer> */
   , BYREF iShift AS INTEGER _                          ' [in][out] *Shift /* *VT_I2 <Integer> */
   , BYREF x AS SINGLE _                                ' [in][out] *x /* *VT_R4 <Single> */
   , BYREF y AS SINGLE _                                ' [in][out] *y /* *VT_R4 <Single> */
   )                                                    ' void

     ' *** Insert your code here ***
     OutputDebugString FUNCNAME$

   END METHOD
   ' =====================================================================================

END INTERFACE

END CLASS
' ========================================================================================


José Roca

 
Same as above, but using an instance of the ADODC control to create the recordset.

DDT Version:


' ########################################################################################
' Microsoft Hierarchical Grid Control Demo
' Also demonstrates the use of the MSADODC control.
' ########################################################################################

#COMPILE EXE
#DIM ALL
#INCLUDE ONCE "MSADODC.INC"
#INCLUDE ONCE "MSHFLXGD.INC"
#INCLUDE ONCE "OLECON.INC"

%IDC_GRID  = 1001
%IDC_ADODC = 1002

' ========================================================================================
' Main
' ========================================================================================
FUNCTION WINMAIN (BYVAL hInstance AS DWORD, BYVAL hPrevInstance AS DWORD, BYVAL lpszCmdLine AS ASCIIZ PTR, BYVAL nCmdShow AS LONG) AS LONG

   LOCAL hDlg AS DWORD

   ' Required: Initialize the Ole Container
   OC_WinInit

   DIALOG NEW 0, "Microsoft Hierarchical Flex Grid", , , 530, 346, %WS_OVERLAPPED OR %WS_THICKFRAME OR %WS_SYSMENU OR _
   %WS_MINIMIZEBOX OR %WS_MAXIMIZEBOX OR %WS_VISIBLE OR %DS_CENTER TO hDlg
   ' For icon from resource, instead use something like, LoadIcon(hInst, "APPICON")
   DIALOG SEND hDlg, %WM_SETICON, %ICON_SMALL, LoadIcon(%NULL, BYVAL %IDI_APPLICATION)
   DIALOG SEND hDlg, %WM_SETICON, %ICON_BIG, LoadIcon(%NULL, BYVAL %IDI_APPLICATION)

   ' We need to forward the messages to the control for keyboard handling
   ' and for that we need a message pump, so the dialog must be modeless.
   DIALOG SHOW MODELESS hDlg, CALL DlgProc

   ' Message handler loop
   LOCAL uMsg AS tagMsg
   WHILE GetMessage(uMsg, %NULL, 0, 0)
      IF ISFALSE OC_ForwardMessage(GetFocus, uMsg) THEN
         IF IsDialogMessage(hDlg, uMsg) = 0 THEN
            TranslateMessage uMsg
            DispatchMessage uMsg
         END IF
      END IF
   WEND

END FUNCTION
' ========================================================================================

' ========================================================================================
' Main Dialog procedure
' ========================================================================================
CALLBACK FUNCTION DlgProc() AS LONG

   LOCAL  hr AS LONG                              ' // HRESULT code
   LOCAL  rc AS RECT                              ' // RECT structure
   LOCAL  hGrid AS DWORD                          ' // Grid's handle
   LOCAL  pGrid AS IMSHFlexGrid                   ' // IMSFlexGrid interface reference
   STATIC pGridEvents AS DMSHFlexGridEventsImpl   ' // Events interface

   SELECT CASE CB.MSG

      CASE %WM_INITDIALOG

         ' Create a registration-free instance of the MSHFlexGrid control
         LOCAL cp AS OC_CREATEPARAMS
         cp.clsid = $CLSID_MSHFlexGrid
         cp.riid = $IID_IMSHFlexGrid
         cp.szLicKey = $RTLKEY_MSHFlexGrid
         cp.szLibName = EXE.Path$ & "MSHFLXGD.OCX"
         hGrid = CreateWindowEx(0, $OC_CLASSNAME, "", _
            %WS_CHILD OR %WS_VISIBLE OR %WS_BORDER OR %WS_TABSTOP, _
            0, 0, 0, 0, CB.HNDL, %IDC_GRID, GetModuleHandle(BYVAL %NULL), cp)

         ' Create a registration-free instance of the ADODC control
         LOCAL hAdodc AS DWORD
         cp.clsid = $CLSID_Adodc
         cp.riid = $IID_IAdodc
         cp.szLicKey = $RTLKEY_ADODC
         cp.szLibName = EXE.Path$ & "MSADODC.OCX"
         hAdodc = CreateWindowEx(0, $OC_CLASSNAME, "", _
            %WS_CHILD OR %WS_VISIBLE OR %WS_BORDER OR %WS_TABSTOP, _
            0, 0, 0, 0, CB.HNDL, %IDC_ADODC, GetModuleHandle(BYVAL %NULL), cp)

         ' Get a reference to the grid control
         pGrid = OC_GetDispatch(hGrid)

         IF ISOBJECT(pGrid) THEN

            ' Change the width of the columns (measures are in twips)
            ' The first parameter is the grid's pointer reference,
            ' the second the column index, and the third the col width.
            pGrid.ColWidth( 0,0) = 300
            pGrid.ColWidth( 1,0) = 1000
            pGrid.ColWidth( 2,0) = 3000
            pGrid.ColWidth( 3,0) = 2000
            pGrid.ColWidth( 4,0) = 2000
            pGrid.ColWidth( 5,0) = 3000
            pGrid.ColWidth( 6,0) = 1500
            pGrid.ColWidth( 7,0) = 700
            pGrid.ColWidth( 8,0) = 1200
            pGrid.ColWidth( 9,0) = 1200
            pGrid.ColWidth(10,0) = 1500
            pGrid.ColWidth(11,0) = 1500

            ' *** Set the default font for all the cells ***
            LOCAL pFont AS IDispatch
            hr = OleCreateFontDisp("Verdana", 8, %FW_BOLD, %ANSI_CHARSET, 0, 0, 0, pFont)
            IF ISOBJECT(pFont) THEN
               pGrid.putref_Font = pFont
               pFont = NOTHING
            END IF

            ' Change the foreground and background colors
            pGrid.ForeColor = %BLACK
            pGrid.BackColor = RGB(255,255,235)

            ' Get a reference to the Adodc control
            LOCAL pAdodc AS IAdodc
            pAdodc = OC_GetDispatch(hAdodc)
            IF ISOBJECT(pAdodc) THEN
               ' Set the connection string and other properties
               LOCAL ConStr AS STRING
               ConStr = UCODE$("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & EXE.Path$ & "NWIND.mdb")
               pAdodc.ConnectionString = ConStr
               pAdodc.CursorLocation = %adUseClient
               pAdodc.CursorType = %adOpenStatic
               pAdodc.Mode = %adModeRead
               ' Set the record source
               LOCAL SqlStr AS STRING
               SqlStr = UCODE$("SELECT * FROM Customers")
               pAdodc.RecordSource = SqlStr
               ' Create a recordset calling the Refresh method
               pAdodc.Refresh
               ' Get a reference to the recordset
               LOCAL pRec AS ADORecordset
               pRec = pAdodc.Recordset
               IF ISOBJECT(pRec) THEN
                  ' Get the Datasource property of the recordset
                  LOCAL pDataSource AS IUnknown
                  pDataSource = pRec.DataSource
                  IF ISOBJECT(pDataSource) THEN
                     ' Bind the recordset to the grid
                     pGrid.putref_DataSource = pDataSource
                     pDataSource = NOTHING
                  END IF
                  ' Close the recordset
                  pRec.Close
                  pRec = NOTHING
               END IF
               pAdodc = NOTHING
            END IF

            ' Connect to the events fired by the grid control
            pGridEvents = CLASS "CDMSHFlexGridEvents"
            EVENTS FROM pGrid CALL pGridEvents
            pGrid = NOTHING

         END IF

      CASE %WM_SIZE
         ' Resize the grid
         IF CB.WPARAM <> %SIZE_MINIMIZED THEN
            GetClientRect CB.HNDL, rc
            MoveWindow GetDlgItem(CB.HNDL, %IDC_GRID), 0, 0, (rc.nRight - rc.nLeft), (rc.nBottom - rc.nTop), %TRUE
         END IF

      CASE %WM_COMMAND
         SELECT CASE CB.CTL
            CASE %IDOK
               IF CB.CTLMSG = %BN_CLICKED THEN
               END IF
            CASE %IDCANCEL
               IF CB.CTLMSG = %BN_CLICKED THEN DIALOG END CB.HNDL, 0
         END SELECT

      ' --> Note: Both WM_SYSCOMMAND and WM_DESTROY are required with this control <--

      CASE %WM_SYSCOMMAND
         ' Capture this message and send a %WM_CLOSE message,
         ' or the program may remain in memory
         IF (CB.WPARAM AND &HFFF0) = %SC_CLOSE THEN
            DIALOG SEND CB.HNDL, %WM_CLOSE, 0, 0
         END IF

      CASE %WM_DESTROY
         ' Disconnect events and quit
         IF ISOBJECT(pGridEvents) THEN EVENTS END pGridEvents
         PostQuitMessage 0

   END SELECT

END FUNCTION
' ========================================================================================


' ########################################################################################
' Class CDMSHFlexGridEvents
' Interface name = DMSHFlexGridEvents
' IID = {0ECD9B63-23AA-11D0-B351-00A0C9055D8E}
' Attributes = 4096 [&H1000] [Dispatchable]
' ########################################################################################

CLASS CDMSHFlexGridEvents GUID$("{CC48E0EB-BC19-4277-ADDC-F2DCFB75664D}") AS EVENT

INTERFACE DMSHFlexGridEventsImpl GUID$("{0ECD9B63-23AA-11D0-B351-00A0C9055D8E}") AS EVENT

  INHERIT IDispatch

   ' =====================================================================================
   METHOD Click <-600>

     ' *** Insert your code here ***
     OutputDebugString FUNCNAME$

   END METHOD
   ' =====================================================================================

   ' =====================================================================================
   METHOD KeyDown <-602> ( _
     BYREF KeyCode AS INTEGER _                         ' *KeyCode /* *VT_I2 <Integer> */
   , BYVAL iShift AS INTEGER _                          ' Shift /* VT_I2 <Integer> */
   )                                                    ' void

     ' *** Insert your code here ***
     OutputDebugString FUNCNAME$

   END METHOD
   ' =====================================================================================

   ' =====================================================================================
   METHOD DblClick <-601>

     ' *** Insert your code here ***
     OutputDebugString FUNCNAME$

   END METHOD
   ' =====================================================================================

   ' =====================================================================================
   METHOD KeyPress <-603> ( _
     BYREF KeyAscii AS INTEGER _                        ' *KeyAscii /* *VT_I2 <Integer> */
   )                                                    ' void

     ' *** Insert your code here ***
     OutputDebugString FUNCNAME$

   END METHOD
   ' =====================================================================================

   ' =====================================================================================
   METHOD KeyUp <-604> ( _
     BYREF KeyCode AS INTEGER _                         ' *KeyCode /* *VT_I2 <Integer> */
   , BYVAL iShift AS INTEGER _                          ' Shift /* VT_I2 <Integer> */
   )                                                    ' void

     ' *** Insert your code here ***
     OutputDebugString FUNCNAME$

   END METHOD
   ' =====================================================================================

   ' =====================================================================================
   METHOD MouseDown <-605> ( _
     BYVAL iButton AS INTEGER _                         ' Button /* VT_I2 <Integer> */
   , BYVAL iShift AS INTEGER _                          ' Shift /* VT_I2 <Integer> */
   , BYVAL x AS LONG _                                  ' x /* OLE_XPOS_PIXELS <alias> <VT_I4> */
   , BYVAL y AS LONG _                                  ' y /* OLE_YPOS_PIXELS <alias> <VT_I4> */
   )                                                    ' void

     ' *** Insert your code here ***
     OutputDebugString FUNCNAME$

   END METHOD
   ' =====================================================================================

   ' =====================================================================================
   METHOD MouseMove <-606> ( _
     BYVAL iButton AS INTEGER _                         ' Button /* VT_I2 <Integer> */
   , BYVAL iShift AS INTEGER _                          ' Shift /* VT_I2 <Integer> */
   , BYVAL x AS LONG _                                  ' x /* OLE_XPOS_PIXELS <alias> <VT_I4> */
   , BYVAL y AS LONG _                                  ' y /* OLE_YPOS_PIXELS <alias> <VT_I4> */
   )                                                    ' void

     ' *** Insert your code here ***
     OutputDebugString FUNCNAME$

   END METHOD
   ' =====================================================================================

   ' =====================================================================================
   METHOD MouseUp <-607> ( _
     BYVAL iButton AS INTEGER _                         ' Button /* VT_I2 <Integer> */
   , BYVAL iShift AS INTEGER _                          ' Shift /* VT_I2 <Integer> */
   , BYVAL x AS LONG _                                  ' x /* OLE_XPOS_PIXELS <alias> <VT_I4> */
   , BYVAL y AS LONG _                                  ' y /* OLE_YPOS_PIXELS <alias> <VT_I4> */
   )                                                    ' void

     ' *** Insert your code here ***
     OutputDebugString FUNCNAME$

   END METHOD
   ' =====================================================================================

   ' =====================================================================================
   METHOD SelChange <69>

     ' *** Insert your code here ***
     OutputDebugString FUNCNAME$

   END METHOD
   ' =====================================================================================

   ' =====================================================================================
   METHOD RowColChange <70>

     ' *** Insert your code here ***
     OutputDebugString FUNCNAME$

   END METHOD
   ' =====================================================================================

   ' =====================================================================================
   METHOD EnterCell <71>

     ' *** Insert your code here ***
     OutputDebugString FUNCNAME$

   END METHOD
   ' =====================================================================================

   ' =====================================================================================
   METHOD LeaveCell <72>

     ' *** Insert your code here ***
     OutputDebugString FUNCNAME$

   END METHOD
   ' =====================================================================================

   ' =====================================================================================
   METHOD Scroll <73>

     ' *** Insert your code here ***
     OutputDebugString FUNCNAME$

   END METHOD
   ' =====================================================================================

   ' =====================================================================================
   METHOD Compare <74> ( _
     BYVAL Row1 AS LONG _                               ' Row1 /* VT_I4 <Long> */
   , BYVAL Row2 AS LONG _                               ' Row2 /* VT_I4 <Long> */
   , BYREF iCmp AS INTEGER _                            ' *Cmp /* *VT_I2 <Integer> */
   )                                                    ' void

     ' *** Insert your code here ***
     OutputDebugString FUNCNAME$

   END METHOD
   ' =====================================================================================

   ' =====================================================================================
   METHOD Collapse <140> ( _
     BYREF iCancel AS INTEGER _                         ' *Cancel /* *VT_BOOL <Integer> */
   )                                                    ' void

     ' *** Insert your code here ***
     OutputDebugString FUNCNAME$

   END METHOD
   ' =====================================================================================

   ' =====================================================================================
   METHOD Expand <141> ( _
     BYREF iCancel AS INTEGER _                         ' *Cancel /* *VT_BOOL <Integer> */
   )                                                    ' void

     ' *** Insert your code here ***
     OutputDebugString FUNCNAME$

   END METHOD
   ' =====================================================================================

   ' =====================================================================================
   METHOD OLEStartDrag <1550> ( _
     BYREF pData AS IVBDataObject _                     ' [in][out] **Data /* **DataObject <coclass> */
   , BYREF AllowedEffects AS LONG _                     ' [in][out] *AllowedEffects /* *VT_I4 <Long> */
   )                                                    ' void

     OutputDebugString FUNCNAME$
     ' *** Insert your code here ***

   END METHOD
   ' =====================================================================================

   ' =====================================================================================
   METHOD OLEGiveFeedback <1551> ( _
     BYREF Effect AS LONG _                             ' [in][out] *Effect /* *VT_I4 <Long> */
   , BYREF DefaultCursors AS INTEGER _                  ' [in][out] *DefaultCursors /* *VT_BOOL <Integer> */
   )                                                    ' void

     ' *** Insert your code here ***
     OutputDebugString FUNCNAME$

   END METHOD
   ' =====================================================================================

   ' =====================================================================================
   METHOD OLESetData <1552> ( _
     BYREF pData AS IVBDataObject _                     ' [in][out] **Data /* **DataObject <coclass> */
   , BYREF DataFormat AS INTEGER _                      ' [in][out] *DataFormat /* *VT_I2 <Integer> */
   )                                                    ' void

     ' *** Insert your code here ***
     OutputDebugString FUNCNAME$

   END METHOD
   ' =====================================================================================

   ' =====================================================================================
   METHOD OLECompleteDrag <1553> ( _
     BYREF Effect AS LONG _                             ' [in][out] *Effect /* *VT_I4 <Long> */
   )                                                    ' void

     ' *** Insert your code here ***
     OutputDebugString FUNCNAME$

   END METHOD
   ' =====================================================================================

   ' =====================================================================================
   METHOD OLEDragOver <1554> ( _
     BYREF pData AS IVBDataObject _                     ' [in][out] **Data /* **DataObject <coclass> */
   , BYREF Effect AS LONG _                             ' [in][out] *Effect /* *VT_I4 <Long> */
   , BYREF iButton AS INTEGER _                         ' [in][out] *Button /* *VT_I2 <Integer> */
   , BYREF iShift AS INTEGER _                          ' [in][out] *Shift /* *VT_I2 <Integer> */
   , BYREF x AS SINGLE _                                ' [in][out] *x /* *VT_R4 <Single> */
   , BYREF y AS SINGLE _                                ' [in][out] *y /* *VT_R4 <Single> */
   , BYREF iState AS INTEGER _                          ' [in][out] *State /* *VT_I2 <Integer> */
   )                                                    ' void

     ' *** Insert your code here ***
     OutputDebugString FUNCNAME$

   END METHOD
   ' =====================================================================================

   ' =====================================================================================
   METHOD OLEDragDrop <1555> ( _
     BYREF pData AS IVBDataObject _                     ' [in][out] **Data /* **DataObject <coclass> */
   , BYREF Effect AS LONG _                             ' [in][out] *Effect /* *VT_I4 <Long> */
   , BYREF iButton AS INTEGER _                         ' [in][out] *Button /* *VT_I2 <Integer> */
   , BYREF iShift AS INTEGER _                          ' [in][out] *Shift /* *VT_I2 <Integer> */
   , BYREF x AS SINGLE _                                ' [in][out] *x /* *VT_R4 <Single> */
   , BYREF y AS SINGLE _                                ' [in][out] *y /* *VT_R4 <Single> */
   )                                                    ' void

     ' *** Insert your code here ***
     OutputDebugString FUNCNAME$

   END METHOD
   ' =====================================================================================

END INTERFACE

END CLASS
' ========================================================================================


José Roca

#3
 
Same as the first example, but using the Microsoft Data Shape Provider to create an hierarchical recordset.

DDT Version:


' ########################################################################################
' Microsoft Hierarchical Grid Control Demo
' Also demonstrates the use of the Microsoft Data Shape Provider.
' ########################################################################################

#COMPILE EXE
#DIM ALL
#INCLUDE ONCE "ADO.INC"
#INCLUDE ONCE "MSHFLXGD.INC"
#INCLUDE ONCE "OLECON.INC"

%IDC_GRID = 1001

' ========================================================================================
' Main
' ========================================================================================
FUNCTION WINMAIN (BYVAL hInstance AS DWORD, BYVAL hPrevInstance AS DWORD, BYVAL lpszCmdLine AS ASCIIZ PTR, BYVAL nCmdShow AS LONG) AS LONG

   LOCAL hDlg AS DWORD

   ' Required: Initialize the Ole Container
   OC_WinInit

   DIALOG NEW 0, "Microsoft Hierarchical Flex Grid", , , 530, 346, %WS_OVERLAPPED OR %WS_THICKFRAME OR %WS_SYSMENU OR _
   %WS_MINIMIZEBOX OR %WS_MAXIMIZEBOX OR %WS_VISIBLE OR %DS_CENTER TO hDlg
   ' For icon from resource, instead use something like, LoadIcon(hInst, "APPICON")
   DIALOG SEND hDlg, %WM_SETICON, %ICON_SMALL, LoadIcon(%NULL, BYVAL %IDI_APPLICATION)
   DIALOG SEND hDlg, %WM_SETICON, %ICON_BIG, LoadIcon(%NULL, BYVAL %IDI_APPLICATION)

   ' We need to forward the messages to the control for keyboard handling
   ' and for that we need a message pump, so the dialog must be modeless.
   DIALOG SHOW MODELESS hDlg, CALL DlgProc

   ' Message handler loop
   LOCAL uMsg AS tagMsg
   WHILE GetMessage(uMsg, %NULL, 0, 0)
      IF ISFALSE OC_ForwardMessage(GetFocus, uMsg) THEN
         IF IsDialogMessage(hDlg, uMsg) = 0 THEN
            TranslateMessage uMsg
            DispatchMessage uMsg
         END IF
      END IF
   WEND

END FUNCTION
' ========================================================================================

' ========================================================================================
' Main Dialog procedure
' ========================================================================================
CALLBACK FUNCTION DlgProc() AS LONG

   LOCAL  hr AS LONG                              ' // HRESULT code
   LOCAL  rc AS RECT                              ' // RECT structure
   LOCAL  hGrid AS DWORD                          ' // Grid's handle
   LOCAL  pGrid AS IMSHFlexGrid                   ' // IMSFlexGrid interface reference
   STATIC pGridEvents AS DMSHFlexGridEventsImpl   ' // Events interface

   SELECT CASE CB.MSG

      CASE %WM_INITDIALOG

         ' Create a registration-free instance of the MSHFlexGrid control
         LOCAL cp AS OC_CREATEPARAMS
         cp.clsid = $CLSID_MSHFlexGrid
         cp.riid = $IID_IMSHFlexGrid
         cp.szLicKey = $RTLKEY_MSHFlexGrid
         cp.szLibName = EXE.Path$ & "MSHFLXGD.OCX"
         hGrid = CreateWindowEx(0, $OC_CLASSNAME, "", _
            %WS_CHILD OR %WS_VISIBLE OR %WS_BORDER OR %WS_TABSTOP, _
            0, 0, 0, 0, CB.HNDL, %IDC_GRID, GetModuleHandle(BYVAL %NULL), cp)

         ' Get a reference to the grid control
         pGrid = OC_GetDispatch(hGrid)

         IF ISOBJECT(pGrid) THEN

            ' Change the width of the columns (measures are in twips)
            ' The first parameter is the grid's pointer reference,
            ' the second the column index, and the third the col width.
            pGrid.ColWidth( 0,0) = 300
            pGrid.ColWidth( 1,0) = 1000
            pGrid.ColWidth( 2,0) = 3000
            pGrid.ColWidth( 3,0) = 2000
            pGrid.ColWidth( 4,0) = 2000
            pGrid.ColWidth( 5,0) = 3000
            pGrid.ColWidth( 6,0) = 1500
            pGrid.ColWidth( 7,0) = 700
            pGrid.ColWidth( 8,0) = 1200
            pGrid.ColWidth( 9,0) = 1200
            pGrid.ColWidth(10,0) = 1500
            pGrid.ColWidth(11,0) = 1500

            ' *** Set the default font for all the cells ***
            LOCAL pFont AS IDispatch
            hr = OleCreateFontDisp("Verdana", 8, %FW_BOLD, %ANSI_CHARSET, 0, 0, 0, pFont)
            IF ISOBJECT(pFont) THEN
               pGrid.putref_Font = pFont
               pFont = NOTHING
            END IF

            ' Change the foreground and background colors
            pGrid.ForeColor = %BLACK
            pGrid.BackColor = RGB(255,255,235)

            ' Create an ADO connection object
            LOCAL pCon AS ADOConnection
            pCon = NEWCOM "ADODB.Connection"
            IF ISOBJECT(pCon) THEN
               ' Connection string - Remember to change the path of the Data Source if needed
               LOCAL ConStr AS STRING
               ConStr = UCODE$("Provider=MSDataShape;Data Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & EXE.Path$ & "NWIND.mdb")
               ' Set the connection string
               pCon.ConnectionString = ConStr
               ' Open the database
               pCon.Open
               IF OBJRESULT = %S_OK THEN
                  ' Create an ADO recordset object
                  LOCAL pRec AS ADORecordset
                  pRec = NEWCOM "ADODB.Recordset"
                  IF ISOBJECT(pRec) THEN
                     ' Open the recordset
                     LOCAL SqlStr AS STRING
                     SqlStr = "SHAPE {select * from Customers} APPEND ({select * from Orders} AS CustOrders RELATE CustomerID TO CustomerID)"
                     pRec.Open SqlStr, pCon, %adOpenKeyset, %adLockOptimistic, %adCmdText
                     ' Get the Datasource property of the recordset
                     LOCAL pDataSource AS IUnknown
                     pDataSource = pRec.DataSource
                     IF ISOBJECT(pDataSource) THEN
                        ' Bind the recordset to the grid
                        pGrid.putref_DataSource = pDataSource
                        pDataSource = NOTHING
                     END IF
                     ' Close the recordset
                     pRec.Close
                     pRec = NOTHING
                  END IF
               END IF
               ' Close the connecion
               pCon.Close
               pCon = NOTHING
            END IF

            ' Connect to the events fired by the control
            pGridEvents = CLASS "CDMSHFlexGridEvents"
            EVENTS FROM pGrid CALL pGridEvents
            pGrid = NOTHING

         END IF

      CASE %WM_SIZE
         ' Resize the grid
         IF CB.WPARAM <> %SIZE_MINIMIZED THEN
            GetClientRect CB.HNDL, rc
            MoveWindow GetDlgItem(CB.HNDL, %IDC_GRID), 0, 0, (rc.nRight - rc.nLeft), (rc.nBottom - rc.nTop), %TRUE
         END IF

      CASE %WM_COMMAND
         SELECT CASE CB.CTL
            CASE %IDOK
               IF CB.CTLMSG = %BN_CLICKED THEN
               END IF
            CASE %IDCANCEL
               IF CB.CTLMSG = %BN_CLICKED THEN DIALOG END CB.HNDL, 0
         END SELECT

      ' --> Note: Both WM_SYSCOMMAND and WM_DESTROY are required with this control <--

      CASE %WM_SYSCOMMAND
         ' Capture this message and send a %WM_CLOSE message,
         ' or the program may remain in memory
         IF (CB.WPARAM AND &HFFF0) = %SC_CLOSE THEN
            DIALOG SEND CB.HNDL, %WM_CLOSE, 0, 0
         END IF

      CASE %WM_DESTROY
         ' Disconnect events
         IF ISOBJECT(pGridEvents) THEN EVENTS END pGridEvents
         ' Quit
         PostQuitMessage 0

   END SELECT

END FUNCTION
' ========================================================================================


' ########################################################################################
' Class CDMSHFlexGridEvents
' Interface name = DMSHFlexGridEvents
' IID = {0ECD9B63-23AA-11D0-B351-00A0C9055D8E}
' Attributes = 4096 [&H1000] [Dispatchable]
' ########################################################################################

CLASS CDMSHFlexGridEvents GUID$("{CC48E0EB-BC19-4277-ADDC-F2DCFB75664D}") AS EVENT

INTERFACE DMSHFlexGridEventsImpl GUID$("{0ECD9B63-23AA-11D0-B351-00A0C9055D8E}") AS EVENT

  INHERIT IDispatch

   ' =====================================================================================
   METHOD Click <-600>

     ' *** Insert your code here ***
     OutputDebugString FUNCNAME$

   END METHOD
   ' =====================================================================================

   ' =====================================================================================
   METHOD KeyDown <-602> ( _
     BYREF KeyCode AS INTEGER _                         ' *KeyCode /* *VT_I2 <Integer> */
   , BYVAL iShift AS INTEGER _                          ' Shift /* VT_I2 <Integer> */
   )                                                    ' void

     ' *** Insert your code here ***
     OutputDebugString FUNCNAME$

   END METHOD
   ' =====================================================================================

   ' =====================================================================================
   METHOD DblClick <-601>

     ' *** Insert your code here ***
     OutputDebugString FUNCNAME$

   END METHOD
   ' =====================================================================================

   ' =====================================================================================
   METHOD KeyPress <-603> ( _
     BYREF KeyAscii AS INTEGER _                        ' *KeyAscii /* *VT_I2 <Integer> */
   )                                                    ' void

     ' *** Insert your code here ***
     OutputDebugString FUNCNAME$

   END METHOD
   ' =====================================================================================

   ' =====================================================================================
   METHOD KeyUp <-604> ( _
     BYREF KeyCode AS INTEGER _                         ' *KeyCode /* *VT_I2 <Integer> */
   , BYVAL iShift AS INTEGER _                          ' Shift /* VT_I2 <Integer> */
   )                                                    ' void

     ' *** Insert your code here ***
     OutputDebugString FUNCNAME$

   END METHOD
   ' =====================================================================================

   ' =====================================================================================
   METHOD MouseDown <-605> ( _
     BYVAL iButton AS INTEGER _                         ' Button /* VT_I2 <Integer> */
   , BYVAL iShift AS INTEGER _                          ' Shift /* VT_I2 <Integer> */
   , BYVAL x AS LONG _                                  ' x /* OLE_XPOS_PIXELS <alias> <VT_I4> */
   , BYVAL y AS LONG _                                  ' y /* OLE_YPOS_PIXELS <alias> <VT_I4> */
   )                                                    ' void

     ' *** Insert your code here ***
     OutputDebugString FUNCNAME$

   END METHOD
   ' =====================================================================================

   ' =====================================================================================
   METHOD MouseMove <-606> ( _
     BYVAL iButton AS INTEGER _                         ' Button /* VT_I2 <Integer> */
   , BYVAL iShift AS INTEGER _                          ' Shift /* VT_I2 <Integer> */
   , BYVAL x AS LONG _                                  ' x /* OLE_XPOS_PIXELS <alias> <VT_I4> */
   , BYVAL y AS LONG _                                  ' y /* OLE_YPOS_PIXELS <alias> <VT_I4> */
   )                                                    ' void

     ' *** Insert your code here ***
     OutputDebugString FUNCNAME$

   END METHOD
   ' =====================================================================================

   ' =====================================================================================
   METHOD MouseUp <-607> ( _
     BYVAL iButton AS INTEGER _                         ' Button /* VT_I2 <Integer> */
   , BYVAL iShift AS INTEGER _                          ' Shift /* VT_I2 <Integer> */
   , BYVAL x AS LONG _                                  ' x /* OLE_XPOS_PIXELS <alias> <VT_I4> */
   , BYVAL y AS LONG _                                  ' y /* OLE_YPOS_PIXELS <alias> <VT_I4> */
   )                                                    ' void

     ' *** Insert your code here ***
     OutputDebugString FUNCNAME$

   END METHOD
   ' =====================================================================================

   ' =====================================================================================
   METHOD SelChange <69>

     ' *** Insert your code here ***
     OutputDebugString FUNCNAME$

   END METHOD
   ' =====================================================================================

   ' =====================================================================================
   METHOD RowColChange <70>

     ' *** Insert your code here ***
     OutputDebugString FUNCNAME$

   END METHOD
   ' =====================================================================================

   ' =====================================================================================
   METHOD EnterCell <71>

     ' *** Insert your code here ***
     OutputDebugString FUNCNAME$

   END METHOD
   ' =====================================================================================

   ' =====================================================================================
   METHOD LeaveCell <72>

     ' *** Insert your code here ***
     OutputDebugString FUNCNAME$

   END METHOD
   ' =====================================================================================

   ' =====================================================================================
   METHOD Scroll <73>

     ' *** Insert your code here ***
     OutputDebugString FUNCNAME$

   END METHOD
   ' =====================================================================================

   ' =====================================================================================
   METHOD Compare <74> ( _
     BYVAL Row1 AS LONG _                               ' Row1 /* VT_I4 <Long> */
   , BYVAL Row2 AS LONG _                               ' Row2 /* VT_I4 <Long> */
   , BYREF iCmp AS INTEGER _                            ' *Cmp /* *VT_I2 <Integer> */
   )                                                    ' void

     ' *** Insert your code here ***
     OutputDebugString FUNCNAME$

   END METHOD
   ' =====================================================================================

   ' =====================================================================================
   METHOD Collapse <140> ( _
     BYREF iCancel AS INTEGER _                         ' *Cancel /* *VT_BOOL <Integer> */
   )                                                    ' void

     ' *** Insert your code here ***
     OutputDebugString FUNCNAME$

   END METHOD
   ' =====================================================================================

   ' =====================================================================================
   METHOD Expand <141> ( _
     BYREF iCancel AS INTEGER _                         ' *Cancel /* *VT_BOOL <Integer> */
   )                                                    ' void

     ' *** Insert your code here ***
     OutputDebugString FUNCNAME$

   END METHOD
   ' =====================================================================================

   ' =====================================================================================
   METHOD OLEStartDrag <1550> ( _
     BYREF pData AS IVBDataObject _                     ' [in][out] **Data /* **DataObject <coclass> */
   , BYREF AllowedEffects AS LONG _                     ' [in][out] *AllowedEffects /* *VT_I4 <Long> */
   )                                                    ' void

     OutputDebugString FUNCNAME$
     ' *** Insert your code here ***

   END METHOD
   ' =====================================================================================

   ' =====================================================================================
   METHOD OLEGiveFeedback <1551> ( _
     BYREF Effect AS LONG _                             ' [in][out] *Effect /* *VT_I4 <Long> */
   , BYREF DefaultCursors AS INTEGER _                  ' [in][out] *DefaultCursors /* *VT_BOOL <Integer> */
   )                                                    ' void

     ' *** Insert your code here ***
     OutputDebugString FUNCNAME$

   END METHOD
   ' =====================================================================================

   ' =====================================================================================
   METHOD OLESetData <1552> ( _
     BYREF pData AS IVBDataObject _                     ' [in][out] **Data /* **DataObject <coclass> */
   , BYREF DataFormat AS INTEGER _                      ' [in][out] *DataFormat /* *VT_I2 <Integer> */
   )                                                    ' void

     ' *** Insert your code here ***
     OutputDebugString FUNCNAME$

   END METHOD
   ' =====================================================================================

   ' =====================================================================================
   METHOD OLECompleteDrag <1553> ( _
     BYREF Effect AS LONG _                             ' [in][out] *Effect /* *VT_I4 <Long> */
   )                                                    ' void

     ' *** Insert your code here ***
     OutputDebugString FUNCNAME$

   END METHOD
   ' =====================================================================================

   ' =====================================================================================
   METHOD OLEDragOver <1554> ( _
     BYREF pData AS IVBDataObject _                     ' [in][out] **Data /* **DataObject <coclass> */
   , BYREF Effect AS LONG _                             ' [in][out] *Effect /* *VT_I4 <Long> */
   , BYREF iButton AS INTEGER _                         ' [in][out] *Button /* *VT_I2 <Integer> */
   , BYREF iShift AS INTEGER _                          ' [in][out] *Shift /* *VT_I2 <Integer> */
   , BYREF x AS SINGLE _                                ' [in][out] *x /* *VT_R4 <Single> */
   , BYREF y AS SINGLE _                                ' [in][out] *y /* *VT_R4 <Single> */
   , BYREF iState AS INTEGER _                          ' [in][out] *State /* *VT_I2 <Integer> */
   )                                                    ' void

     ' *** Insert your code here ***
     OutputDebugString FUNCNAME$

   END METHOD
   ' =====================================================================================

   ' =====================================================================================
   METHOD OLEDragDrop <1555> ( _
     BYREF pData AS IVBDataObject _                     ' [in][out] **Data /* **DataObject <coclass> */
   , BYREF Effect AS LONG _                             ' [in][out] *Effect /* *VT_I4 <Long> */
   , BYREF iButton AS INTEGER _                         ' [in][out] *Button /* *VT_I2 <Integer> */
   , BYREF iShift AS INTEGER _                          ' [in][out] *Shift /* *VT_I2 <Integer> */
   , BYREF x AS SINGLE _                                ' [in][out] *x /* *VT_R4 <Single> */
   , BYREF y AS SINGLE _                                ' [in][out] *y /* *VT_R4 <Single> */
   )                                                    ' void

     ' *** Insert your code here ***
     OutputDebugString FUNCNAME$

   END METHOD
   ' =====================================================================================

END INTERFACE

END CLASS
' ========================================================================================