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. ClistBox problem here........help!!!!! :-(

ClistBox problem here........help!!!!! :-(

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestionlearning
4 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.
  • S Offline
    S Offline
    Steve Obbayi
    wrote on last edited by
    #1

    Run this by me... Im missing something and i cant see what. Ok, Supposing i have a PropertySheet. inside it i have a CPropertyPage Class that has 'CListBox myListBox' as a class member variable and is attached to a ListBox control created using the resource editor. I then have another class called myApp derived from CWinApp. The question is... How do i add a string to my ListBox contol at runime from a function triggered by another action in myApp? When i put the pieces together and compile its all fine until trgger the function. From then i get an assertion error. void signature(){ cout<<"Sobbayi Interactive"<

    R M 2 Replies Last reply
    0
    • S Steve Obbayi

      Run this by me... Im missing something and i cant see what. Ok, Supposing i have a PropertySheet. inside it i have a CPropertyPage Class that has 'CListBox myListBox' as a class member variable and is attached to a ListBox control created using the resource editor. I then have another class called myApp derived from CWinApp. The question is... How do i add a string to my ListBox contol at runime from a function triggered by another action in myApp? When i put the pieces together and compile its all fine until trgger the function. From then i get an assertion error. void signature(){ cout<<"Sobbayi Interactive"<

      R Offline
      R Offline
      Rafael Fernandez Lopez
      wrote on last edited by
      #2

      You are supposed to write: myApp.myListBox.InsertString("My String 1"); Am I right ? ;)


      MaestroProgramador.Com Where every source code is loved like a girl.

      1 Reply Last reply
      0
      • S Steve Obbayi

        Run this by me... Im missing something and i cant see what. Ok, Supposing i have a PropertySheet. inside it i have a CPropertyPage Class that has 'CListBox myListBox' as a class member variable and is attached to a ListBox control created using the resource editor. I then have another class called myApp derived from CWinApp. The question is... How do i add a string to my ListBox contol at runime from a function triggered by another action in myApp? When i put the pieces together and compile its all fine until trgger the function. From then i get an assertion error. void signature(){ cout<<"Sobbayi Interactive"<

        M Offline
        M Offline
        Mike Danberg
        wrote on last edited by
        #3

        You're probably trying to write to a non-existing listbox. You have to pass the listbox along to the other class in order to write to it. Create a pointer to the listbox in the myApp class and then set it equal to the listbox when you set up the myApp class, then you should be able to write to it. Mike

        S 1 Reply Last reply
        0
        • M Mike Danberg

          You're probably trying to write to a non-existing listbox. You have to pass the listbox along to the other class in order to write to it. Create a pointer to the listbox in the myApp class and then set it equal to the listbox when you set up the myApp class, then you should be able to write to it. Mike

          S Offline
          S Offline
          Steve Obbayi
          wrote on last edited by
          #4

          Thanks guys, The problem is certainly not InsertString() or AddString() i think i am gonna go with Mike. I discovered i am actually trying to insert a string into a non initialized ListBox. So am gonna go with using a pointer to myListBox from myApp class. Thanks alot guys. void signature(){ cout<<"Sobbayi Interactive"<

          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