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. About CTypedPtrList class--"new" and "delete"..

About CTypedPtrList class--"new" and "delete"..

Scheduled Pinned Locked Moved C / C++ / MFC
databaseperformancehelptutorial
1 Posts 1 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 Offline
    A Offline
    anju
    wrote on last edited by
    #1

    The Problem is --Where and How to Delete the created objects with "new" Operator Please mark the palce and solution.. i tried with somany ways but i am getting "Heap assertion" and in Debugging mode it is showing MemoryLeak Detected as follows: Detected memory leaks! Dumping objects -> {172} normal block at 0x002F5F88, 500 bytes long. Data: 44 3A 5C 50 72 6F 6A 65 63 74 73 5C 44 75 6D 70 and also i am getting the First-chance exception in MyApp.exe (KERNEL32.DLL): 0x000006B5: (no name). please give me the solution I am very much worring about these problems please please.... This is Mycode: I am declaring structures as follows: 1.For Database entries: ;;;;;;;;;;;;;;;;;;;;;;; typedef struct{ char strName[MAX_PATH]; int nNumber; int nCode; }DB_DATA; 2:For Daily entries: ;;;;;;;;;;;;;;;;;;;; typedef struct{ char strName[MAX_PATH]; int nNumber; int nCode; }DAILY_DATA; Now i am using CTypedPtrList as follows: 1.For Database: =============== typedef CTypedPtrList DB_DATA_LIST; DB_DATA_LIST m_lstDbData; 2.For Initial List: ================== typedef CTypedPtrList INITIAL_LIST; INITIAL_LIST m_InitialList; 3.For Priority List: ==================== typedef CTypedPtrList PRIORITY_LIST; PRIORITY_LIST m_PriorityList; Initially i am getting all the data from database and store it in "m_lstDbData" as follows: ############ while (EndOfFile) { DB_DATA * dbdata=new DB_DATA; strcpy(dbdata->sName,rs.sName); dbdata->nNumber=rs.nNumber; dbdata->nCode=rs.nCode; m_lstDbData.AddTail(dbdata); MoveNext(); } Preparing the InitialList as follows: ````````````````````````````````````` Now i am checking the Dialy Register(one Text file contains record wise data) if Daily Register values mactched with Database values then stored this values into InitialList. do { POSITION nPos=m_lstDbData.GetHeadPosition(); for(int nPass=0;nPassnCode) { DAILY_DATA * tempDailyData=new DAILY_DATA; strcpy(tempDailyData->sFileName,str); tempDailyData->nNumber=tempDbdata->nNumber; tempDailyData->nCode=tempDbdata->nCode; InitialList.AddTail(tempDailyData); }//end if(Dial

    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