Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Grid Control in CFormView

Grid Control in CFormView

Scheduled Pinned Locked Moved C / C++ / MFC
debuggingcssquestion
6 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    markkuk
    wrote on last edited by
    #1

    I'm trying to use the grid control in a CFormView-based class, by inserting a custom control in the dialog. My application fails with "Failed to create empty document" message at startup, the trace information from a debug run is as follows:

    WndProc: hwnd=0x4C03D6, msg = WM_GETMINMAXINFO (0x0000, 0x0012F9FC)
    WndProc: hwnd=0x4C03D6, msg = WM_NCCREATE (0x0000, 0x0012F9D0)
    WndProc: hwnd=0x4C03D6, msg = WM_NCCALCSIZE (0x0000, 0x0012FA1C)
    WndProc: hwnd=0x4C03D6, msg = WM_CREATE (0x0000, 0x0012F9BC)
    WndProc: hwnd=0x2D02FE, msg = WM_NCCREATE (0x0000, 0x0012F394)
    WndProc: hwnd=0x2D02FE, msg = WM_NCCALCSIZE (0x0000, 0x0012F3C4)
    WndProc: hwnd=0x2D02FE, msg = WM_CREATE (0x0000, 0x0012F394)
    WndProc: hwnd=0x2D02FE, msg = WM_SIZE (0x0000, 0x014501E0)
    WndProc: hwnd=0x4C03D6, msg = 0x0368 (0x0000, 0x0012F0E4)
    WndProc: hwnd=0x2D02FE, msg = WM_MOVE (0x0000, 0x00000000)
    WndProc: hwnd=0x4C03D6, msg = WM_PARENTNOTIFY (0x0001, 0x002D02FE)
    WndProc: hwnd=0x2D02FE, msg = WM_SETFONT (0x500A043F, 0x00000000)
    WndProc: hwnd=0x4C03D6, msg = WM_PARENTNOTIFY (0x0002, 0x002D02FE)
    WndProc: hwnd=0x2D02FE, msg = WM_DESTROY (0x0000, 0x00000000)
    WndProc: hwnd=0x2D02FE, msg = WM_NCDESTROY (0x0000, 0x00000000)
    Warning: could not create view for frame.
    Failed to create client pane/view for frame.
    WndProc: hwnd=0x4C03D6, msg = WM_DESTROY (0x0000, 0x00000000)
    WndProc: hwnd=0x4C03D6, msg = WM_NCDESTROY (0x0000, 0x00000000)
    Warning: Window creation failed: GetLastError returns 0x00000000
    Warning: failed to create CFrameWnd.
    Warning: CDocTemplate couldn't create a frame.
    The thread 0x4C4 has exited with code 0 (0x0).
    The program 'D:\TEMP\gctest\Debug\gctest.exe' has exited with code 0 (0x0).

    The first warning is caused by ::CreateDialogIndirect() failing when the CMainFrame is being created. Then everything else fails because there is no main window.

    Any idea why the window creation fails? Is some additional initialization needed?

    L 2 Replies Last reply
    0
    • M markkuk

      I'm trying to use the grid control in a CFormView-based class, by inserting a custom control in the dialog. My application fails with "Failed to create empty document" message at startup, the trace information from a debug run is as follows:

      WndProc: hwnd=0x4C03D6, msg = WM_GETMINMAXINFO (0x0000, 0x0012F9FC)
      WndProc: hwnd=0x4C03D6, msg = WM_NCCREATE (0x0000, 0x0012F9D0)
      WndProc: hwnd=0x4C03D6, msg = WM_NCCALCSIZE (0x0000, 0x0012FA1C)
      WndProc: hwnd=0x4C03D6, msg = WM_CREATE (0x0000, 0x0012F9BC)
      WndProc: hwnd=0x2D02FE, msg = WM_NCCREATE (0x0000, 0x0012F394)
      WndProc: hwnd=0x2D02FE, msg = WM_NCCALCSIZE (0x0000, 0x0012F3C4)
      WndProc: hwnd=0x2D02FE, msg = WM_CREATE (0x0000, 0x0012F394)
      WndProc: hwnd=0x2D02FE, msg = WM_SIZE (0x0000, 0x014501E0)
      WndProc: hwnd=0x4C03D6, msg = 0x0368 (0x0000, 0x0012F0E4)
      WndProc: hwnd=0x2D02FE, msg = WM_MOVE (0x0000, 0x00000000)
      WndProc: hwnd=0x4C03D6, msg = WM_PARENTNOTIFY (0x0001, 0x002D02FE)
      WndProc: hwnd=0x2D02FE, msg = WM_SETFONT (0x500A043F, 0x00000000)
      WndProc: hwnd=0x4C03D6, msg = WM_PARENTNOTIFY (0x0002, 0x002D02FE)
      WndProc: hwnd=0x2D02FE, msg = WM_DESTROY (0x0000, 0x00000000)
      WndProc: hwnd=0x2D02FE, msg = WM_NCDESTROY (0x0000, 0x00000000)
      Warning: could not create view for frame.
      Failed to create client pane/view for frame.
      WndProc: hwnd=0x4C03D6, msg = WM_DESTROY (0x0000, 0x00000000)
      WndProc: hwnd=0x4C03D6, msg = WM_NCDESTROY (0x0000, 0x00000000)
      Warning: Window creation failed: GetLastError returns 0x00000000
      Warning: failed to create CFrameWnd.
      Warning: CDocTemplate couldn't create a frame.
      The thread 0x4C4 has exited with code 0 (0x0).
      The program 'D:\TEMP\gctest\Debug\gctest.exe' has exited with code 0 (0x0).

      The first warning is caused by ::CreateDialogIndirect() failing when the CMainFrame is being created. Then everything else fails because there is no main window.

      Any idea why the window creation fails? Is some additional initialization needed?

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      hi..if u wanna use gridcontrol... use active X.....Add dbgrid control and ado to your project......assign ado topo a recordsource......\ Set SQL in ado... Call the the id of ado from the dbgrid control......Add table and recordset u wanna call in dbgrid..... These thing can be done in resource workshop that is in something.rc file....No need to code anything in the CMainFrm...... Ur problem occurs becoz another program might have running the recorsource at the sametime.... "LIFE IS AN ADVENTURE THAT SHOULD BE LIVED.... LOVE IS A PROBLEM THAT SHOULD SOLVED...LOVE YOUR LIFE!!" CVASIVA

      M 1 Reply Last reply
      0
      • L Lost User

        hi..if u wanna use gridcontrol... use active X.....Add dbgrid control and ado to your project......assign ado topo a recordsource......\ Set SQL in ado... Call the the id of ado from the dbgrid control......Add table and recordset u wanna call in dbgrid..... These thing can be done in resource workshop that is in something.rc file....No need to code anything in the CMainFrm...... Ur problem occurs becoz another program might have running the recorsource at the sametime.... "LIFE IS AN ADVENTURE THAT SHOULD BE LIVED.... LOVE IS A PROBLEM THAT SHOULD SOLVED...LOVE YOUR LIFE!!" CVASIVA

        M Offline
        M Offline
        markkuk
        wrote on last edited by
        #3

        I guess I should have specified that I am trying to use Chris Maunder's MFC Grid Control 2.22, not an ActiveX component. I need a control with checkboxes and date pickers as cells.

        Anyway, I solved the first problem myself, I had to include a member variable for the control in the view class (not mentioned in the documentation). But the control still doesn't work, in fact it doesn't appear at all on the dialog. Debugging shows that the control's Create() function isn't called.

        Isn't the MFC framework supposed to Create() all the controls defined in the dialog template? If I must Create() the control myself, how do I access the control position and size information defined in the dialog editor?

        T 1 Reply Last reply
        0
        • M markkuk

          I guess I should have specified that I am trying to use Chris Maunder's MFC Grid Control 2.22, not an ActiveX component. I need a control with checkboxes and date pickers as cells.

          Anyway, I solved the first problem myself, I had to include a member variable for the control in the view class (not mentioned in the documentation). But the control still doesn't work, in fact it doesn't appear at all on the dialog. Debugging shows that the control's Create() function isn't called.

          Isn't the MFC framework supposed to Create() all the controls defined in the dialog template? If I must Create() the control myself, how do I access the control position and size information defined in the dialog editor?

          T Offline
          T Offline
          Tomasz Sowinski
          wrote on last edited by
          #4

          > Isn't the MFC framework supposed to Create() all the controls > defined in the dialog template? Only if you add the corresponding call to DDX_Control in DoDataExchange. Tomasz Sowinski -- http://www.shooltz.com.pl

          M 1 Reply Last reply
          0
          • T Tomasz Sowinski

            > Isn't the MFC framework supposed to Create() all the controls > defined in the dialog template? Only if you add the corresponding call to DDX_Control in DoDataExchange. Tomasz Sowinski -- http://www.shooltz.com.pl

            M Offline
            M Offline
            markkuk
            wrote on last edited by
            #5

            Thanks, this was just the information I needed :)

            1 Reply Last reply
            0
            • M markkuk

              I'm trying to use the grid control in a CFormView-based class, by inserting a custom control in the dialog. My application fails with "Failed to create empty document" message at startup, the trace information from a debug run is as follows:

              WndProc: hwnd=0x4C03D6, msg = WM_GETMINMAXINFO (0x0000, 0x0012F9FC)
              WndProc: hwnd=0x4C03D6, msg = WM_NCCREATE (0x0000, 0x0012F9D0)
              WndProc: hwnd=0x4C03D6, msg = WM_NCCALCSIZE (0x0000, 0x0012FA1C)
              WndProc: hwnd=0x4C03D6, msg = WM_CREATE (0x0000, 0x0012F9BC)
              WndProc: hwnd=0x2D02FE, msg = WM_NCCREATE (0x0000, 0x0012F394)
              WndProc: hwnd=0x2D02FE, msg = WM_NCCALCSIZE (0x0000, 0x0012F3C4)
              WndProc: hwnd=0x2D02FE, msg = WM_CREATE (0x0000, 0x0012F394)
              WndProc: hwnd=0x2D02FE, msg = WM_SIZE (0x0000, 0x014501E0)
              WndProc: hwnd=0x4C03D6, msg = 0x0368 (0x0000, 0x0012F0E4)
              WndProc: hwnd=0x2D02FE, msg = WM_MOVE (0x0000, 0x00000000)
              WndProc: hwnd=0x4C03D6, msg = WM_PARENTNOTIFY (0x0001, 0x002D02FE)
              WndProc: hwnd=0x2D02FE, msg = WM_SETFONT (0x500A043F, 0x00000000)
              WndProc: hwnd=0x4C03D6, msg = WM_PARENTNOTIFY (0x0002, 0x002D02FE)
              WndProc: hwnd=0x2D02FE, msg = WM_DESTROY (0x0000, 0x00000000)
              WndProc: hwnd=0x2D02FE, msg = WM_NCDESTROY (0x0000, 0x00000000)
              Warning: could not create view for frame.
              Failed to create client pane/view for frame.
              WndProc: hwnd=0x4C03D6, msg = WM_DESTROY (0x0000, 0x00000000)
              WndProc: hwnd=0x4C03D6, msg = WM_NCDESTROY (0x0000, 0x00000000)
              Warning: Window creation failed: GetLastError returns 0x00000000
              Warning: failed to create CFrameWnd.
              Warning: CDocTemplate couldn't create a frame.
              The thread 0x4C4 has exited with code 0 (0x0).
              The program 'D:\TEMP\gctest\Debug\gctest.exe' has exited with code 0 (0x0).

              The first warning is caused by ::CreateDialogIndirect() failing when the CMainFrame is being created. Then everything else fails because there is no main window.

              Any idea why the window creation fails? Is some additional initialization needed?

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #6

              Try EasyGrid ActiveX as a substitute. It must will be very helpful. Download is available @ http://www.share2.com/easygrid/ :cool:

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups