Click here to Skip to main content
16,005,120 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: To check and Create Folder in Win32 API Pin
Cristian Amarie13-Jan-07 4:35
Cristian Amarie13-Jan-07 4:35 
QuestionRetrieve jpg file from Access database Pin
Vishvanathan12-Jan-07 0:39
Vishvanathan12-Jan-07 0:39 
QuestionRe: Retrieve jpg file from Access database Pin
CPallini12-Jan-07 3:01
mveCPallini12-Jan-07 3:01 
AnswerRe: Retrieve jpg file from Access database Pin
Vishvanathan12-Jan-07 4:01
Vishvanathan12-Jan-07 4:01 
QuestionGET_X_LPARAM Pin
Astricks12-Jan-07 0:08
Astricks12-Jan-07 0:08 
AnswerRe: GET_X_LPARAM Pin
toxcct12-Jan-07 0:22
toxcct12-Jan-07 0:22 
AnswerRe: GET_X_LPARAM Pin
CPallini12-Jan-07 0:34
mveCPallini12-Jan-07 0:34 
QuestionCWinThread and leak Pin
NorGUI11-Jan-07 23:39
NorGUI11-Jan-07 23:39 
Hallo,

I have a thread that use object , when I end the thread the object used into the thread do not call the destructor and the let me some leak !

Why the object m_OPCServer & m_OPCStock are not destructed when I stop the thread ?

What can I change into my code that those object will be destructed!

The code:

CWinThread* newthread=NULL;

stop=false;

newthread=AfxBeginThread(ThreadAddOpcServer,LPVOID(&stop),THREAD_PRIORITY_BELOW_NORMAL ,0,CREATE_SUSPENDED );
newthread->ResumeThread();

UINT ThreadAddOpcServer(LPVOID nparam)
{
bool* sstop=static_cast<bool*>(nparam);

static int i=10;

OPCServer m_OPCServer;
StockIOWINCC m_OPCStock(&m_OPCServer);

double movevalue=0;

while(!*sstop) {
m_OPCStock.ChangeStatus("INTERN\\test_opc2",movevalue++);
m_OPCStock.ChangeStatus("INTERN\\test_opc1",10*movevalue);

}

AfxEndThread(0,true);

return 0;

}

Thank for help


AutreChien

AnswerRe: CWinThread and leak Pin
Cedric Moonen11-Jan-07 23:50
Cedric Moonen11-Jan-07 23:50 
GeneralRe: CWinThread and leak Pin
toxcct12-Jan-07 0:38
toxcct12-Jan-07 0:38 
GeneralRe: CWinThread and leak Pin
NorGUI12-Jan-07 0:54
NorGUI12-Jan-07 0:54 
AnswerRe: CWinThread and leak Pin
Roger Stoltz12-Jan-07 2:35
Roger Stoltz12-Jan-07 2:35 
QuestionCString Pathnames - backslash Pin
im7911-Jan-07 23:19
im7911-Jan-07 23:19 
AnswerRe: CString Pathnames - backslash Pin
_AnsHUMAN_ 11-Jan-07 23:41
_AnsHUMAN_ 11-Jan-07 23:41 
AnswerRe: CString Pathnames - backslash Pin
CPallini11-Jan-07 23:45
mveCPallini11-Jan-07 23:45 
AnswerRe: CString Pathnames - backslash Pin
toxcct12-Jan-07 0:04
toxcct12-Jan-07 0:04 
AnswerRe: CString Pathnames - backslash Pin
ThatsAlok12-Jan-07 2:36
ThatsAlok12-Jan-07 2:36 
GeneralRe: CString Pathnames - backslash Pin
im7912-Jan-07 2:51
im7912-Jan-07 2:51 
GeneralRe: CString Pathnames - backslash Pin
toxcct12-Jan-07 3:07
toxcct12-Jan-07 3:07 
GeneralRe: CString Pathnames - backslash Pin
im7916-Jan-07 0:34
im7916-Jan-07 0:34 
GeneralRe: CString Pathnames - backslash Pin
toxcct16-Jan-07 1:26
toxcct16-Jan-07 1:26 
GeneralRe: CString Pathnames - backslash Pin
#realJSOP12-Jan-07 23:31
professional#realJSOP12-Jan-07 23:31 
GeneralRe: CString Pathnames - backslash Pin
toxcct13-Jan-07 0:15
toxcct13-Jan-07 0:15 
GeneralRe: CString Pathnames - backslash Pin
#realJSOP13-Jan-07 3:29
professional#realJSOP13-Jan-07 3:29 
GeneralRe: CString Pathnames - backslash Pin
ThatsAlok14-Jan-07 18:22
ThatsAlok14-Jan-07 18:22 

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.