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. Again CListBox

Again CListBox

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
4 Posts 4 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.
  • H Offline
    H Offline
    hanno25
    wrote on last edited by
    #1

    Another question: Before calling the dialog, I try to call another function, which has access to the list elements. This function should fill the CListBox. But every time, I will add this elements to the CListBox (using AddString("text")), the program returns a error message. Whats the mistake? Help!

    P E L 3 Replies Last reply
    0
    • H hanno25

      Another question: Before calling the dialog, I try to call another function, which has access to the list elements. This function should fill the CListBox. But every time, I will add this elements to the CListBox (using AddString("text")), the program returns a error message. Whats the mistake? Help!

      P Offline
      P Offline
      PJ Arends
      wrote on last edited by
      #2

      hanno25 wrote:

      the program returns a error message

      What message? The message that you get is telling you what is wrong. If you want help you have to let us know what the message is or else all we can do is take a guess. My guess is that the CListBox window is not yet created when you call AddString() so there is no HWND to handle the LB_ADDSTRING message, resulting in an ASSERTion being thrown in CListBox::AddString().


      "You're obviously a superstar." - Christian Graus about me - 12 Feb '03 "Obviously ???  You're definitely a superstar!!!" - mYkel - 21 Jun '04 "There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05 Within you lies the power for good - Use it!

      1 Reply Last reply
      0
      • H hanno25

        Another question: Before calling the dialog, I try to call another function, which has access to the list elements. This function should fill the CListBox. But every time, I will add this elements to the CListBox (using AddString("text")), the program returns a error message. Whats the mistake? Help!

        E Offline
        E Offline
        Eytukan
        wrote on last edited by
        #3

        you cannot access your dialog Items before initializing your dialog.

        BOOL CMFCDlg::OnInitDialog()
        {
        }


        VuNic

        1 Reply Last reply
        0
        • H hanno25

          Another question: Before calling the dialog, I try to call another function, which has access to the list elements. This function should fill the CListBox. But every time, I will add this elements to the CListBox (using AddString("text")), the program returns a error message. Whats the mistake? Help!

          L Offline
          L Offline
          Laxman9
          wrote on last edited by
          #4

          you may add ur code into initdialog function that insert the elements into the list box BOOL CTestDlg::OnInitDialog() { CDialog::OnInitDialog(); //my code for adding the data into listbox } Thanks and Regards Laxman FAILURE is the first step towards SUCCESS :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