Click here to Skip to main content
15,921,279 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: determine cpu time of a process ? Pin
3-Mar-02 9:48
suss3-Mar-02 9:48 
GeneralRe: determine cpu time of a process ? Pin
alex.barylski3-Mar-02 13:46
alex.barylski3-Mar-02 13:46 
Generalmerge sort Pin
3-Mar-02 5:46
suss3-Mar-02 5:46 
GeneralRe: merge sort Pin
Michael Dunn3-Mar-02 7:25
sitebuilderMichael Dunn3-Mar-02 7:25 
Generalplease.........................please..................... Pin
3-Mar-02 4:49
suss3-Mar-02 4:49 
GeneralRe: please.........................please..................... Pin
Tim Smith3-Mar-02 5:10
Tim Smith3-Mar-02 5:10 
Generalhere is one memory leak Pin
3-Mar-02 5:11
suss3-Mar-02 5:11 
GeneralRe: here is one memory leak Pin
Christian Graus3-Mar-02 9:02
protectorChristian Graus3-Mar-02 9:02 
For starters, CTypedPtrList ? MFC containers suck in every possible way. Use std::list or std::vector, then you can write functors to do things like delete pointers as you empty the list.


while(!InitialList.IsEmpty())
{

POSITION nPos=InitialList.GetHeadPosition();
DAILY_DATA * TempHeadPosData=new DAILY_DATA;

// You never delete this - why ?

TempHeadPosData=InitialList.GetAt(nPos);//Head Position Priority
nStuctPos=InitialList.Find(TempHeadPosData);
nHPosCode=TempHeadPosData->nCode;
for(int nIndex=0;nIndex{
DAILY_DATA * TempNextPosData=new DAILY_DATA;

// You never delete this - why ?

TempNextPosData=InitialList.GetNext(nPos);
nNextPosCode=TempNextPosData->nCode;
if(nHPosCode>nNextPosCode)
{
nStuctPos=InitialList.Find(TempNextPosData);
int nTempHold=nHPosCode;
nHPosCode=nNextPosCode;
nNextPosCode=nHPosCode;

}//end if(nHPosCode>nNextPosCode)
else
{
if(nHPosCode==nNextPosCode)
{
//here i am doing somethine
}//end if(nHPosCode==NextPosPriority)

}//end else
}//end for(int nIndex=0;nIndex
DAILY_DATA * TempNewData=new DAILY_DATA;
TempNewData=InitialList.GetAt(nStuctPos);
PriorityList.AddTail(TempNewData);

// This one is fine, because it gets put into the list, but it must be deleted in your destructor if not before (unless the MFC container does it for you ).

InitialList.RemoveAt(nStuctPos);
}//end while(!InitialList.IsEmpty())


Christian

The tragedy of cyberspace - that so much can travel so far, and yet mean so little.

GeneralRe: Thanks i got the solution Pin
5-Mar-02 4:08
suss5-Mar-02 4:08 
GeneralRe: Thanks i got the solution Pin
5-Mar-02 4:08
suss5-Mar-02 4:08 
GeneralVSS Header comments Pin
Darren Schroeder3-Mar-02 4:39
Darren Schroeder3-Mar-02 4:39 
GeneralRe: VSS Header comments Pin
Anders Molin3-Mar-02 4:43
professionalAnders Molin3-Mar-02 4:43 
Questionusing namespace std; <-- is evil? Pin
Travis D. Mathison3-Mar-02 4:28
Travis D. Mathison3-Mar-02 4:28 
AnswerRe: using namespace std; <-- is evil? Pin
Todd Smith3-Mar-02 4:41
Todd Smith3-Mar-02 4:41 
AnswerRe: using namespace std; <-- is evil? Pin
Tim Smith3-Mar-02 5:00
Tim Smith3-Mar-02 5:00 
AnswerRe: using namespace std; <-- is evil? Pin
Travis D. Mathison3-Mar-02 5:07
Travis D. Mathison3-Mar-02 5:07 
AnswerRe: using namespace std; <-- is evil? Pin
Felix Cho3-Mar-02 12:37
Felix Cho3-Mar-02 12:37 
GeneralRe: using namespace std; <-- is evil? Pin
Christian Graus3-Mar-02 12:57
protectorChristian Graus3-Mar-02 12:57 
GeneralRe: using namespace std; <-- is evil? Pin
Tim Smith3-Mar-02 13:11
Tim Smith3-Mar-02 13:11 
GeneralRe: using namespace std; <-- is evil? Pin
Christian Graus3-Mar-02 13:48
protectorChristian Graus3-Mar-02 13:48 
GeneralRe: using namespace std; <-- is evil? Pin
Tim Smith3-Mar-02 13:57
Tim Smith3-Mar-02 13:57 
GeneralRe: using namespace std; <-- is evil? Pin
Christian Graus3-Mar-02 15:24
protectorChristian Graus3-Mar-02 15:24 
GeneralRe: using namespace std; <-- is evil? Pin
Felix Cho4-Mar-02 17:38
Felix Cho4-Mar-02 17:38 
GeneralSend To IrDA printer in Pocket PC Pin
Mesut3-Mar-02 1:18
Mesut3-Mar-02 1:18 
GeneralSimple question Pin
John Cruz3-Mar-02 0:50
John Cruz3-Mar-02 0:50 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.