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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. SetItemData, GetItemData

SetItemData, GetItemData

Scheduled Pinned Locked Moved C / C++ / MFC
helpdatabasedebuggingquestion
6 Posts 5 Posters 1 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.
  • E Offline
    E Offline
    elephantstar
    wrote on last edited by
    #1

    I created a dialog box with 3 controls using the ClassWizard. I created a variable for each control with type CComboBox. Within my constructor I set up the values associated with each index item: m_combo1.SetItemData(0, 1); m_combo1.SetItemData(1, 2); m_combo1.SetItemData(2, 5); When I run the program, it throws a debug assertion failed error. What seems to be the problem? Does it have something to do with its declaration? Thanks!

    C T M 3 Replies Last reply
    0
    • E elephantstar

      I created a dialog box with 3 controls using the ClassWizard. I created a variable for each control with type CComboBox. Within my constructor I set up the values associated with each index item: m_combo1.SetItemData(0, 1); m_combo1.SetItemData(1, 2); m_combo1.SetItemData(2, 5); When I run the program, it throws a debug assertion failed error. What seems to be the problem? Does it have something to do with its declaration? Thanks!

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      If you debug when you get the assert, you'll see the MFC source code where it's blowing up, and the comment above the ASSERT will answer your question. Christian I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer

      D 1 Reply Last reply
      0
      • C Christian Graus

        If you debug when you get the assert, you'll see the MFC source code where it's blowing up, and the comment above the ASSERT will answer your question. Christian I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer

        D Offline
        D Offline
        DasdaDAS
        wrote on last edited by
        #3

        Or u can do ur codings in OnInitDialog() :laugh: Zxczc

        E 1 Reply Last reply
        0
        • E elephantstar

          I created a dialog box with 3 controls using the ClassWizard. I created a variable for each control with type CComboBox. Within my constructor I set up the values associated with each index item: m_combo1.SetItemData(0, 1); m_combo1.SetItemData(1, 2); m_combo1.SetItemData(2, 5); When I run the program, it throws a debug assertion failed error. What seems to be the problem? Does it have something to do with its declaration? Thanks!

          T Offline
          T Offline
          toxcct
          wrote on last edited by
          #4

          you can also use SetwindowText() to fill you controls with some datas.


          TOXCCT >>> GEII power
          [toxcct][VisualCalc]

          1 Reply Last reply
          0
          • E elephantstar

            I created a dialog box with 3 controls using the ClassWizard. I created a variable for each control with type CComboBox. Within my constructor I set up the values associated with each index item: m_combo1.SetItemData(0, 1); m_combo1.SetItemData(1, 2); m_combo1.SetItemData(2, 5); When I run the program, it throws a debug assertion failed error. What seems to be the problem? Does it have something to do with its declaration? Thanks!

            M Offline
            M Offline
            Michael Dunn
            wrote on last edited by
            #5

            3.1 What does a failed debug assert mean?[^] --Mike-- Visual C++ MVP :cool: LINKS~! Ericahist | 1ClickPicGrabber | CP SearchBar v2.0.2 | C++ Forum FAQ Strange things are afoot at the U+004B U+20DD

            1 Reply Last reply
            0
            • D DasdaDAS

              Or u can do ur codings in OnInitDialog() :laugh: Zxczc

              E Offline
              E Offline
              elephantstar
              wrote on last edited by
              #6

              That did it. Thanks!

              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