Changeset 745


Ignore:
Timestamp:
Jul 30, 2007, 3:38:41 AM (13 years ago)
Author:
Steven Levine
Message:

Add CNRITEM free and remove support (ticket#24)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/filldir.c

    r744 r745  
    14861486  pfi = (PFIELDINFO) WinSendMsg(hwnd, CM_QUERYDETAILFIELDINFO, MPVOID,
    14871487                                MPFROMSHORT(CMA_FIRST));
    1488   if (pfi)
    1489     WinSendMsg(hwnd, CM_REMOVEDETAILFIELDINFO, MPVOID,
    1490                MPFROM2SHORT(0, CMA_FREE));
     1488  if (pfi &&
     1489      (INT)WinSendMsg(hwnd, CM_REMOVEDETAILFIELDINFO, MPVOID,
     1490               MPFROM2SHORT(0, CMA_FREE)) == -1) {
     1491    Win_Error(hwnd, HWND_DESKTOP, pszSrcFile, __LINE__,"CM_REMOVEDETAILFIELDINFO hwnd %x", hwnd);
     1492  }
     1493
     1494  // DbgMsg(pszSrcFile, __LINE__, "EmptyCnr hwnd %p emptied", hwnd);
    14911495}
    1492 
    14931496
    14941497/**
     
    14981501static VOID FreeCnrItemData(PCNRITEM pci)
    14991502{
     1503  // DbgMsg(pszSrcFile, __LINE__, "FreeCnrItemData %p", pci);
     1504
    15001505  if (pci->pszSubject && pci->pszSubject != NullStr)
    15011506    xfree(pci->pszSubject);
     
    15151520VOID FreeCnrItem(HWND hwnd, PCNRITEM pci)
    15161521{
     1522  // DbgMsg(pszSrcFile, __LINE__, "FreeCnrItem hwnd %x pci %p", hwnd, pci);
     1523
    15171524  FreeCnrItemData(pci);
    15181525
    1519   if (!WinSendMsg(hwnd, CM_FREERECORD, MPFROMP(&pci), MPFROMSHORT(1))) {
     1526  if ((INT)WinSendMsg(hwnd, CM_FREERECORD, MPFROMP(&pci), MPFROMSHORT(1)) == -1) {
    15201527    // Win_Error2(hwnd, HWND_DESKTOP, pszSrcFile, __LINE__,IDS_CMFREEERRTEXT);
    1521     Win_Error(hwnd, HWND_DESKTOP, pszSrcFile, __LINE__,"CM_FREERECORD");
     1528    Win_Error(hwnd, HWND_DESKTOP, pszSrcFile, __LINE__,"CM_FREERECORD hwnd %x pci %p", hwnd, pci);
    15221529  }
    15231530}
     
    15501557    Runtime_Error(pszSrcFile, __LINE__, "count not 1");
    15511558  else {
     1559    // DbgMsg(pszSrcFile, __LINE__, "RemoveCnrItems %p %u %s", pci, usCnt, pci->pszFileName);
     1560
    15521561    FreeCnrItemData(pci);
    15531562
    1554     DbgMsg(pszSrcFile, __LINE__, "removing %p %u", pci, usCnt);
    1555     if (!WinSendMsg(hwnd, CM_REMOVERECORD, MPFROMP(&pci), MPFROM2SHORT(usCnt, CMA_FREE))) {
     1563    if ((INT)WinSendMsg(hwnd, CM_REMOVERECORD, MPFROMP(&pci), MPFROM2SHORT(usCnt, CMA_FREE)) == -1) {
    15561564      // Win_Error2(hwnd, HWND_DESKTOP, pszSrcFile, __LINE__,IDS_CMREMOVEERRTEXT);
    1557       Win_Error(hwnd, HWND_DESKTOP, pszSrcFile, __LINE__,"CM_REMOVERECORD");
     1565      Win_Error(hwnd, HWND_DESKTOP, pszSrcFile, __LINE__,"CM_REMOVERECORD hwnd %x pci %p", hwnd, pci);
    15581566    }
    15591567  }
Note: See TracChangeset for help on using the changeset viewer.