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. cannot Create CListBox : CFormView without IDD

cannot Create CListBox : CFormView without IDD

Scheduled Pinned Locked Moved C / C++ / MFC
questionlearning
3 Posts 2 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.
  • R Offline
    R Offline
    rtischer8277
    wrote on last edited by
    #1

    I cannot create MyListBox derived from CFormView. The docs say I can put the Create call in the MyListBox ctor. I get these errors: // dialog template must exist and be invisible with WS_CHILD set // invalid dialog template name I don't want to create a resource dialog template, however, like an IDD_... because my listbox is just a PLACE_HOLDER control in a resource control. How do I get the object created without a dialog resource IDD?

    D 1 Reply Last reply
    0
    • R rtischer8277

      I cannot create MyListBox derived from CFormView. The docs say I can put the Create call in the MyListBox ctor. I get these errors: // dialog template must exist and be invisible with WS_CHILD set // invalid dialog template name I don't want to create a resource dialog template, however, like an IDD_... because my listbox is just a PLACE_HOLDER control in a resource control. How do I get the object created without a dialog resource IDD?

      D Offline
      D Offline
      David Crow
      wrote on last edited by
      #2

      What does the relevant code look like?

      "One man's wage rise is another man's price increase." - Harold Wilson

      "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

      "You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles

      R 1 Reply Last reply
      0
      • D David Crow

        What does the relevant code look like?

        "One man's wage rise is another man's price increase." - Harold Wilson

        "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

        "You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles

        R Offline
        R Offline
        rtischer8277
        wrote on last edited by
        #3

        class MyListBoxView : public CFormView
        {
        ...
        CListBox m_wndListBox;

        MyListBoxView::MyListBoxView()
        : CFormView( IDC_LIST1 ) // ID is a LISTBOX control in another .rc file
        {
        Create( WC_LISTBOX, L"My devices", WS_CAPTION | WS_CHILD | WS_VISIBLE, CRect( 0, 0, 0, 0 ), this, IDC_LIST1, ( CCreateContext* )NULL );

        **Create** fails at:

        if (!_AfxCheckDialogTemplate(m_lpszTemplateName, TRUE))
        {
        ASSERT(FALSE); // invalid dialog template name

        I have tried to do w_wndListBox.Create(...), but CFormView::Create is protected and can't be called from outside. I have also tried to call Create in MyListBoxView's ctor, using the static call form (CFormView::Create), but that fails because Create, of course, is not a static and you can't call non-statics from a static. So I must have the class and object structure wrong for these calls not to work.

        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