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. Dr Watson dump :-\

Dr Watson dump :-\

Scheduled Pinned Locked Moved C / C++ / MFC
announcementdata-structuresdebuggingquestion
24 Posts 5 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 Alvaro Mendez

    typedef struct {
    int iImage;
    int iSelectedImage;
    int iIndent;
    LPTSTR pszText;
    } ITEMINFO, *PITEMINFO;

    Searched MSDN and found it on an example illustrating the use of ComboBoxEx controls. :confused: My guess is that ITEMINFO is his own structure which also happens to have the same name. :-) Regards, Alvaro


    All you need in this life is ignorance and confidence, and then success is sure. -- Mark Twain

    W Offline
    W Offline
    will1383
    wrote on last edited by
    #21

    oh, Sorry guys, I was on a bug hunt (still). I totally forgot about the ITEMINFO struct. Here is my ITEMINFO Structure: typedef struct tagITEMINFO { CString strFileName; DWORD nFileSizeLow; FILETIME ftLastWriteTime; } ITEMINFO; The reason I am modifying the displayed file information is that I'm really displaying a single "file" for a group of files, and this required me to associate a different filename/filesize/filedate with the item in the item list. I suppose there was a different way to do it but this was all that came to mind the first time it was written. I tried the pDispInfo->item.pszText = (LPTSTR) (LPCTSTR) string; and declaring the string as static but I'm still having the same issues. Good ole' Dr. Watson. Same exact spot though. I wish I could figure out how to find the exact line from the Dr. Watson. Then I'd be able to narrow it down even more. Although I suspect you guys are right, it has something to do with the buffer size for the text string. Dan Willis

    A 1 Reply Last reply
    0
    • W will1383

      oh, Sorry guys, I was on a bug hunt (still). I totally forgot about the ITEMINFO struct. Here is my ITEMINFO Structure: typedef struct tagITEMINFO { CString strFileName; DWORD nFileSizeLow; FILETIME ftLastWriteTime; } ITEMINFO; The reason I am modifying the displayed file information is that I'm really displaying a single "file" for a group of files, and this required me to associate a different filename/filesize/filedate with the item in the item list. I suppose there was a different way to do it but this was all that came to mind the first time it was written. I tried the pDispInfo->item.pszText = (LPTSTR) (LPCTSTR) string; and declaring the string as static but I'm still having the same issues. Good ole' Dr. Watson. Same exact spot though. I wish I could figure out how to find the exact line from the Dr. Watson. Then I'd be able to narrow it down even more. Although I suspect you guys are right, it has something to do with the buffer size for the text string. Dan Willis

      A Offline
      A Offline
      AlexO
      wrote on last edited by
      #22

      Ok now we are getting somewhere:). Show how you instantiate your ITEMINFO and how you assign it to lParam

      W 1 Reply Last reply
      0
      • A AlexO

        Ok now we are getting somewhere:). Show how you instantiate your ITEMINFO and how you assign it to lParam

        W Offline
        W Offline
        will1383
        wrote on last edited by
        #23

        Here's where I initialize the ITEMINFO. I do this for every item in the list that is to be shown in my ListView. // // Allocate a new ITEMINFO structure and initialize it with information // about the item. // ITEMINFO* pItem; try { pItem = new ITEMINFO; } catch (CMemoryException* e) { e->Delete (); return FALSE; } pItem->strFileName = fileName; pItem->nFileSizeLow = fileSize / 1024; // in KB pItem->ftLastWriteTime = fileAccessTime; // // Add the item to the list view. // LV_ITEM lvi; lvi.mask = LVIF_TEXT | LVIF_IMAGE | LVIF_PARAM; lvi.iItem = nIndex; lvi.iSubItem = 0; lvi.iImage = 0; lvi.pszText = LPSTR_TEXTCALLBACK; lvi.lParam = (LPARAM) pItem; if (GetListCtrl ().InsertItem (&lvi) == -1) return FALSE; // now add the file data text GetListCtrl().SetItemText(nIndex,3,(LPCSTR) fileDataType); Dan Willis

        W 1 Reply Last reply
        0
        • W will1383

          Here's where I initialize the ITEMINFO. I do this for every item in the list that is to be shown in my ListView. // // Allocate a new ITEMINFO structure and initialize it with information // about the item. // ITEMINFO* pItem; try { pItem = new ITEMINFO; } catch (CMemoryException* e) { e->Delete (); return FALSE; } pItem->strFileName = fileName; pItem->nFileSizeLow = fileSize / 1024; // in KB pItem->ftLastWriteTime = fileAccessTime; // // Add the item to the list view. // LV_ITEM lvi; lvi.mask = LVIF_TEXT | LVIF_IMAGE | LVIF_PARAM; lvi.iItem = nIndex; lvi.iSubItem = 0; lvi.iImage = 0; lvi.pszText = LPSTR_TEXTCALLBACK; lvi.lParam = (LPARAM) pItem; if (GetListCtrl ().InsertItem (&lvi) == -1) return FALSE; // now add the file data text GetListCtrl().SetItemText(nIndex,3,(LPCSTR) fileDataType); Dan Willis

          W Offline
          W Offline
          will1383
          wrote on last edited by
          #24

          I think I may have found my problem. Gimme a couple of minutes :-D Dan Willis

          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