Click here to Skip to main content
15,892,697 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Exchanging rows in CListCtrl Pin
David Crow4-Sep-04 17:18
David Crow4-Sep-04 17:18 
GeneralDXSDK 9 (Summer2004) and Visual C++ 6 issue Pin
tareqsiraj3-Sep-04 22:24
tareqsiraj3-Sep-04 22:24 
GeneralRe: DXSDK 9 (Summer2004) and Visual C++ 6 issue Pin
Bob Stanneveld3-Sep-04 23:16
Bob Stanneveld3-Sep-04 23:16 
GeneralRe: DXSDK 9 (Summer2004) and Visual C++ 6 issue Pin
tareqsiraj4-Sep-04 1:38
tareqsiraj4-Sep-04 1:38 
GeneralRe: DXSDK 9 (Summer2004) and Visual C++ 6 issue Pin
Jörgen Sigvardsson4-Sep-04 1:50
Jörgen Sigvardsson4-Sep-04 1:50 
GeneralRe: DXSDK 9 (Summer2004) and Visual C++ 6 issue Pin
tareqsiraj4-Sep-04 2:42
tareqsiraj4-Sep-04 2:42 
GeneralRe: DXSDK 9 (Summer2004) and Visual C++ 6 issue Pin
Jörgen Sigvardsson4-Sep-04 4:36
Jörgen Sigvardsson4-Sep-04 4:36 
GeneralDestructo rin DLL Pin
GGConsulting3-Sep-04 22:14
GGConsulting3-Sep-04 22:14 
Hello

I wrote an DLL with many Code.
My Calling Programm uses

CTCPHufKommDLLApp *m_pClient;
in the .h flie
and
this->m_pClient = new CTCPHufKommDLLApp((CWnd*) this);
in the Init Dialog of the calling Window.

this i no problem.
But in the OK Button code the line
void CHUFClientDlg::OnBnClickedOk()
{
if ( this->m_pClient != NULL )
{
delete( this->m_pClient );
this->m_pClient = NULL;
}
OnOK();
}

the delete line don't work. I never come in the destruktor. But I get an Compilerhalt at
afxtls.cpp
inline void* CThreadSlotData::GetThreadValue(int nSlot)
{
EnterCriticalSection(&m_sect);
ASSERT(nSlot != 0 && nSlot < m_nMax);
ASSERT(m_pSlotData != NULL);
ASSERT(m_pSlotData[nSlot].dwFlags & SLOT_USED);
ASSERT(m_tlsIndex != (DWORD)-1);
if( nSlot <= 0 || nSlot >= m_nMax ) // check for retail builds.
{
LeaveCriticalSection(&m_sect);
return NULL;
}

CThreadData* pData = (CThreadData*)TlsGetValue(m_tlsIndex);
if (pData == NULL || nSlot >= pData->nCount)
{
LeaveCriticalSection(&m_sect);
!!!Here it stops!!!
return NULL;
!!! HERE it stops!!!
}
void* pRetVal = pData->pData[nSlot];
LeaveCriticalSection(&m_sect);
return pRetVal;
}

I can continue without more errors, but never come into destructor.
So I get a memory leak.

Who can help me?
I'm just a beginner in DLL Programming.

Thank You for every Tip.

Greetings
Gerhard from Germany
GeneralRe: Destructo rin DLL Pin
Anonymous4-Sep-04 8:15
Anonymous4-Sep-04 8:15 
GeneralGradient Masks Pin
bmw50023-Sep-04 22:10
bmw50023-Sep-04 22:10 
QuestionHow to write synchronized audio and video Pin
imranlodhi3-Sep-04 20:50
imranlodhi3-Sep-04 20:50 
GeneralChange filename case Pin
alex.barylski3-Sep-04 20:39
alex.barylski3-Sep-04 20:39 
GeneralRe: Change filename case Pin
alex.barylski3-Sep-04 20:41
alex.barylski3-Sep-04 20:41 
GeneralRe: Change filename case Pin
David Crow4-Sep-04 17:22
David Crow4-Sep-04 17:22 
GeneralWaitable Timers Pin
bmw50023-Sep-04 20:06
bmw50023-Sep-04 20:06 
GeneralDataGrid Control problem Pin
Imtiaz Murtaza3-Sep-04 20:04
Imtiaz Murtaza3-Sep-04 20:04 
GeneralAlgorithm for CTime in CTimeSpan Pin
anderslundsgard3-Sep-04 19:59
anderslundsgard3-Sep-04 19:59 
GeneralRe: Algorithm for CTime in CTimeSpan Pin
Ravi Bhavnani3-Sep-04 20:18
professionalRavi Bhavnani3-Sep-04 20:18 
GeneralRe: Algorithm for CTime in CTimeSpan Pin
Jörgen Sigvardsson4-Sep-04 1:54
Jörgen Sigvardsson4-Sep-04 1:54 
GeneralRe: Algorithm for CTime in CTimeSpan Pin
anderslundsgard5-Sep-04 23:31
anderslundsgard5-Sep-04 23:31 
GeneralAlt+Tab, Application Icon Hidding Pin
swarup3-Sep-04 18:18
swarup3-Sep-04 18:18 
GeneralScrollView problem Pin
coolecho3-Sep-04 18:04
coolecho3-Sep-04 18:04 
GeneralCListCtrl sorting issue... Pin
IQ03-Sep-04 13:45
IQ03-Sep-04 13:45 
GeneralVisual C++ Express 2005 Pin
holland3-Sep-04 10:55
holland3-Sep-04 10:55 
GeneralRe: Visual C++ Express 2005 Pin
Jörgen Sigvardsson4-Sep-04 11:15
Jörgen Sigvardsson4-Sep-04 11:15 

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.