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. Problem with ListView API : LVM_ISERTITEM

Problem with ListView API : LVM_ISERTITEM

Scheduled Pinned Locked Moved C / C++ / MFC
testingbeta-testingjsonhelpquestion
15 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.
  • A Andrew Quinn AUS

    Hi, Are you sure that lParam is pointing to a valid LV_ITEM structure? Cheers, Andy

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

    I'm pretty sure because listview is a HWND of list control and its valid Pain is a weakness living the body

    B 1 Reply Last reply
    0
    • R ravjak

      I'm pretty sure because listview is a HWND of list control and its valid Pain is a weakness living the body

      B Offline
      B Offline
      bikram singh
      wrote on last edited by
      #4

      Check that mask member contains LVIF_TEXT This flag indicates that the pszText member contains a valid address. If the flag is not set, the member could contain any "address". Also, check that cchTextMax member is not zero. (not really required) Bikram Singh

      R 1 Reply Last reply
      0
      • B bikram singh

        Check that mask member contains LVIF_TEXT This flag indicates that the pszText member contains a valid address. If the flag is not set, the member could contain any "address". Also, check that cchTextMax member is not zero. (not really required) Bikram Singh

        R Offline
        R Offline
        ravjak
        wrote on last edited by
        #5

        this pice of code doesn't work :( case LVM_INSERTITEM: { LV_ITEM FAR* pitem = (LV_ITEM FAR*) lParam; if(!pitem && !pitem->pszText) break; if( pitem->mask & LVIF_TEXT == LVIF_TEXT && pitem->cchTextMax>0) { MessageBox(okno,pitem->pszText,":-)",MB_OK); } break; any other ideas :confused: :mad::mad: Pain is a weakness living the body

        B J 2 Replies Last reply
        0
        • R ravjak

          this pice of code doesn't work :( case LVM_INSERTITEM: { LV_ITEM FAR* pitem = (LV_ITEM FAR*) lParam; if(!pitem && !pitem->pszText) break; if( pitem->mask & LVIF_TEXT == LVIF_TEXT && pitem->cchTextMax>0) { MessageBox(okno,pitem->pszText,":-)",MB_OK); } break; any other ideas :confused: :mad::mad: Pain is a weakness living the body

          B Offline
          B Offline
          bikram singh
          wrote on last edited by
          #6

          Try using brackets to delimit each expression you are testing in the if statement. Bikram Singh

          1 Reply Last reply
          0
          • R ravjak

            this pice of code doesn't work :( case LVM_INSERTITEM: { LV_ITEM FAR* pitem = (LV_ITEM FAR*) lParam; if(!pitem && !pitem->pszText) break; if( pitem->mask & LVIF_TEXT == LVIF_TEXT && pitem->cchTextMax>0) { MessageBox(okno,pitem->pszText,":-)",MB_OK); } break; any other ideas :confused: :mad::mad: Pain is a weakness living the body

            J Offline
            J Offline
            jmkhael
            wrote on last edited by
            #7

            What happens if pitem != NULL and pitem->pszText = NULL? (Hint: It wont break) I would do the test: if(pitem && pitem->pszText) { // Do the dance... } Papa while (TRUE) Papa.WillLove ( Bebe ) ;

            R B 2 Replies Last reply
            0
            • J jmkhael

              What happens if pitem != NULL and pitem->pszText = NULL? (Hint: It wont break) I would do the test: if(pitem && pitem->pszText) { // Do the dance... } Papa while (TRUE) Papa.WillLove ( Bebe ) ;

              R Offline
              R Offline
              ravjak
              wrote on last edited by
              #8

              Not working hmmm hardcore hehe. Im testing changing iImage value according to iItem and it seems to be good if I know sequence of adding apriori, which will require some more coding. Anyway its really strage stuff isn't it :confused: Pain is a weakness living the body

              J 1 Reply Last reply
              0
              • R ravjak

                Not working hmmm hardcore hehe. Im testing changing iImage value according to iItem and it seems to be good if I know sequence of adding apriori, which will require some more coding. Anyway its really strage stuff isn't it :confused: Pain is a weakness living the body

                J Offline
                J Offline
                jmkhael
                wrote on last edited by
                #9

                Try this case LVM_INSERTITEM: { LPLVITEM pitem = (LPLVITEM) lParam; if(pitem && pitem->pszText) { if( ((pitem->mask & LVIF_TEXT) == LVIF_TEXT)) { MessageBox(okno,pitem->pszText,"",MB_OK); } } break; Papa while (TRUE) Papa.WillLove ( Bebe ) ;

                R 1 Reply Last reply
                0
                • J jmkhael

                  Try this case LVM_INSERTITEM: { LPLVITEM pitem = (LPLVITEM) lParam; if(pitem && pitem->pszText) { if( ((pitem->mask & LVIF_TEXT) == LVIF_TEXT)) { MessageBox(okno,pitem->pszText,"",MB_OK); } } break; Papa while (TRUE) Papa.WillLove ( Bebe ) ;

                  R Offline
                  R Offline
                  ravjak
                  wrote on last edited by
                  #10

                  Not working. Plese remind me next time do not take a project for windows. Pain is a weakness living the body

                  R J 2 Replies Last reply
                  0
                  • R ravjak

                    Not working. Plese remind me next time do not take a project for windows. Pain is a weakness living the body

                    R Offline
                    R Offline
                    ravjak
                    wrote on last edited by
                    #11

                    But I thing I know why is it so. According to spy ++ this is a ATL:SysTreeView control. Maybe as a lparam they are sending some other struct than LV_ITEM:confused: Pain is a weakness living the body

                    1 Reply Last reply
                    0
                    • R ravjak

                      Not working. Plese remind me next time do not take a project for windows. Pain is a weakness living the body

                      J Offline
                      J Offline
                      jmkhael
                      wrote on last edited by
                      #12

                      Where is it crashing? Papa while (TRUE) Papa.WillLove ( Bebe ) ;

                      R 1 Reply Last reply
                      0
                      • J jmkhael

                        What happens if pitem != NULL and pitem->pszText = NULL? (Hint: It wont break) I would do the test: if(pitem && pitem->pszText) { // Do the dance... } Papa while (TRUE) Papa.WillLove ( Bebe ) ;

                        B Offline
                        B Offline
                        bikram singh
                        wrote on last edited by
                        #13

                        I would do: if(pitem) { if(pitem->pszText) { // Do the dance... } } Bikram Singh

                        R 1 Reply Last reply
                        0
                        • J jmkhael

                          Where is it crashing? Papa while (TRUE) Papa.WillLove ( Bebe ) ;

                          R Offline
                          R Offline
                          ravjak
                          wrote on last edited by
                          #14

                          Im hooking into OE and it crashes when OE adds new items to address list. when i use olny iImage eg iImage = 2 it works properly but i want test pszText vaule and according to this set proper valus of iImage :) Pain is a weakness living the body

                          1 Reply Last reply
                          0
                          • B bikram singh

                            I would do: if(pitem) { if(pitem->pszText) { // Do the dance... } } Bikram Singh

                            R Offline
                            R Offline
                            ravjak
                            wrote on last edited by
                            #15

                            not working too i think this not valid pointer beacuse its not the same address space I had the similar problem some time ago when i wannted to send some char * as wparam or lparam using SendMessage. I had to use WM_COPYDATA then char * goes thru kernel memory and pointer is valid:confused: Pain is a weakness living the body

                            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