Click here to Skip to main content
15,884,099 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Question about Getting Main Icon using Findresource() Pin
MicroVirus21-Jun-11 5:50
MicroVirus21-Jun-11 5:50 
Questionproblem while freeing a link list within a vector structure [modified] Pin
Madan Chauhan20-Jun-11 21:27
Madan Chauhan20-Jun-11 21:27 
AnswerRe: problem while freeing a link list within a vector structure Pin
CPallini20-Jun-11 22:12
mveCPallini20-Jun-11 22:12 
AnswerRe: problem while freeing a link list within a vector structure Pin
Stefan_Lang21-Jun-11 0:35
Stefan_Lang21-Jun-11 0:35 
GeneralRe: problem while freeing a link list within a vector structure Pin
Madan Chauhan21-Jun-11 1:07
Madan Chauhan21-Jun-11 1:07 
GeneralRe: problem while freeing a link list within a vector structure Pin
Stefan_Lang21-Jun-11 1:27
Stefan_Lang21-Jun-11 1:27 
AnswerRe: problem while freeing a link list within a vector structure Pin
CPallini21-Jun-11 1:15
mveCPallini21-Jun-11 1:15 
QuestionRe: problem while freeing a link list within a vector structure Pin
David Crow21-Jun-11 4:04
David Crow21-Jun-11 4:04 
Madan Chauhan wrote:
All the nodes become free but one that is very first node in the list does not free.

How are you verifying this?

Madan Chauhan wrote:
Please give me some idea...

Just a tad bit of cleanup:

void main( void )
{
    for (int i = 0; i < 2; i++)
    {
        TEST_STRUCT *ptrCurrent;
        TEST_VECTORST wVectorSt = {0};
        wVectorSt.nVal = i + 1;
   
        for (int j = 0; j < 10; j++)
        {
            TEST_STRUCT *ptrTemp = (TEST_STRUCT *) calloc(1, sizeof(TEST_STRUCT));
            _tcscpy_s(ptrTemp->_tchTemp, _countof(ptrTemp->_tchTemp), _T(""));
            ptrTemp->dwTemp = 10 + j;
            ptrTemp->i64Temp = 100 + j;
            ptrTemp->Next = NULL;
  
            if (wVectorSt.m_ListInVector == NULL)
                wVectorSt.m_ListInVector = ptrTemp;
            else
                ptrCurrent->Next = ptrTemp;
  
            ptrCurrent = ptrTemp;
        }
  
        m_StVector.push_back(wVectorSt);
    }
  
    for (unsigned int i = 0; i < m_StVector.size(); i++)
    {
        TEST_STRUCT *ptrList = m_StVector[i].m_ListInVector;
        while (ptrList != NULL)
        {
            TEST_STRUCT *ptrTemp = ptrList;
            ptrList = ptrList->Next;
            free(ptrTemp);
        }
    } 
}

"One man's wage rise is another man's price increase." - Harold Wilson

"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

"Some people are making such thorough preparation for rainy days that they aren't enjoying today's sunshine." - William Feather


QuestionI am using VC++ coding,Can any one help me? Pin
lucky_122120-Jun-11 21:14
lucky_122120-Jun-11 21:14 
AnswerRe: I am using VC++ coding,Can any one help me? Pin
CPallini20-Jun-11 22:10
mveCPallini20-Jun-11 22:10 
AnswerRe: I am using VC++ coding,Can any one help me? Pin
Cool_Dev20-Jun-11 22:18
Cool_Dev20-Jun-11 22:18 
QuestionConverting char array to CSting Pin
VCProgrammer20-Jun-11 1:43
VCProgrammer20-Jun-11 1:43 
AnswerRe: Converting char array to CSting Pin
Pete O'Hanlon20-Jun-11 1:54
mvePete O'Hanlon20-Jun-11 1:54 
GeneralRe: Converting char array to CSting [modified] Pin
Albert Holguin20-Jun-11 4:36
professionalAlbert Holguin20-Jun-11 4:36 
GeneralRe: Converting char array to CSting Pin
Pete O'Hanlon20-Jun-11 6:10
mvePete O'Hanlon20-Jun-11 6:10 
AnswerRe: Converting char array to CSting Pin
CPallini20-Jun-11 1:55
mveCPallini20-Jun-11 1:55 
AnswerRe: Converting char array to CSting Pin
Rajesh R Subramanian20-Jun-11 3:54
professionalRajesh R Subramanian20-Jun-11 3:54 
Question[Win32]Add context menu to edit control Pin
Member 296547120-Jun-11 1:24
Member 296547120-Jun-11 1:24 
AnswerRe: [Win32]Add context menu to edit control Pin
CPallini20-Jun-11 1:58
mveCPallini20-Jun-11 1:58 
AnswerRe: [Win32]Add context menu to edit control Pin
వేంకటనారాయణ(venkatmakam)20-Jun-11 2:23
వేంకటనారాయణ(venkatmakam)20-Jun-11 2:23 
GeneralRe: [Win32]Add context menu to edit control Pin
Member 296547120-Jun-11 3:07
Member 296547120-Jun-11 3:07 
GeneralRe: [Win32]Add context menu to edit control Pin
Mark Salsbery20-Jun-11 10:16
Mark Salsbery20-Jun-11 10:16 
AnswerRe: [Win32]Add context menu to edit control Pin
User 742933821-Jun-11 1:04
professionalUser 742933821-Jun-11 1:04 
QuestionSendMessage Pin
Sakhalean19-Jun-11 23:36
Sakhalean19-Jun-11 23:36 
AnswerRe: SendMessage Pin
xrg_soft@163.com19-Jun-11 23:49
xrg_soft@163.com19-Jun-11 23:49 

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.