Click here to Skip to main content
15,899,679 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Corruption of the heap. Why ? Pin
sdancer758-Jun-12 6:03
sdancer758-Jun-12 6:03 
GeneralRe: Corruption of the heap. Why ? Pin
sdancer759-Jun-12 3:43
sdancer759-Jun-12 3:43 
GeneralRe: Corruption of the heap. Why ? Pin
Aescleal9-Jun-12 9:51
Aescleal9-Jun-12 9:51 
GeneralRe: Corruption of the heap. Why ? Pin
sdancer759-Jun-12 23:58
sdancer759-Jun-12 23:58 
GeneralRe: Corruption of the heap. Why ? Pin
sdancer7512-Jun-12 3:18
sdancer7512-Jun-12 3:18 
QuestionException when debugging Multithread Pin
ForNow7-Jun-12 19:04
ForNow7-Jun-12 19:04 
AnswerRe: Exception when debugging Multithread Pin
«_Superman_»7-Jun-12 19:15
professional«_Superman_»7-Jun-12 19:15 
GeneralRe: Exception when debugging Multithread Pin
ForNow7-Jun-12 23:53
ForNow7-Jun-12 23:53 
I resume the thread

myprog->progsocket->ResumeThread(); // get it going


However one I comment out anything the destroys e.g. EndDialog the Modal Dialog box whose method

I was while creating the CWinThread the exception disappears

I am wondering since I create a UI thread it associates the CWinThread with the modal

Dialog Box and when the modal Dialog Box disappears it destroys anything associated

with it e.g. the CWinThread object and anything releated to that object

code in question don't know whay my pre tags aren't taking

<pre lang='cpp'>

CprogDebug *myprog; // instantiate a Debug Class modless CDialog derived class

myprog = new CprogDebug; // Allocate on the Heap

if (myprog == NULL)
MessageBox("CprogDebug","CprogDebug Error",MB_ICONERROR);


myprog->jobname = jobname; // copy over jobname
myprog->progname = progname; // copy over progname
myprog->proglisting = dlg.GetPathName();
EndDialog(0); // Kill the Dialog
// dlg.~dlg();

myprog->Create(IDD_PROGDBG,NULL); // Attach it to a window

myprog->progsocket = (SockCLeintThread *) AfxBeginThread(RUNTIME_CLASS)
(SockCLeintThread),
THREAD_PRIORITY_NORMAL,
0,CREATE_SUSPENDED);

if (myprog->progsocket == NULL)
MessageBox("Socket","Prog Socket Error",MB_ICONERROR);


myprog->progsocket->sendwindow = (CWnd *) myprog;
// set window to receive TCP/IP messages
myprog->progsocket->m_pActiveWnd = (CWnd *) myprog; // <== point to newwindow
myprog->progsocket->m_pMainWnd = (CWnd *) myprog; // ditto
myprog->progsocket->ipaddr = "192.168.1.4"; // ip address
CHERC_CMDApp *main_app = (CHERC_CMDApp *)AfxGetApp();
int i = 0;
while(main_app->ports[i].busy != 0)
{
i++;
}
myprog->progsocket->port = main_app->ports[i].port; // port
main_app->ports[i].busy = 1;
// Tcpipthread = progsocket->m_nThreadID; // thread id
// myprog.progsocket->thisocket.send_wnd = myprog.progsocket->sendwindow;
myprog->progsocket->thisocket->send_wnd = (CWnd *) myprog;
strcpy((char *)&myprog->progsocket->thread_id,"DebugSocket");
myprog->progsocket->thisocket->thread_no = i; //
myprog->Tcpipthread = myprog->progsocket->m_nThreadID;
myprog->progsocket->ResumeThread();

</pre>

Event though I explictily point to another modless dialog I create on the heap

while in the modless Dialog Box method
GeneralRe: Exception when debugging Multithread Pin
ForNow7-Jun-12 23:58
ForNow7-Jun-12 23:58 
AnswerRe: Exception when debugging Multithread Pin
Erudite_Eric7-Jun-12 20:34
Erudite_Eric7-Jun-12 20:34 
AnswerRe: Exception when debugging Multithread Pin
Richard MacCutchan7-Jun-12 21:53
mveRichard MacCutchan7-Jun-12 21:53 
GeneralRe: Exception when debugging Multithread Pin
Erudite_Eric7-Jun-12 23:35
Erudite_Eric7-Jun-12 23:35 
GeneralRe: Exception when debugging Multithread Pin
Richard MacCutchan8-Jun-12 0:19
mveRichard MacCutchan8-Jun-12 0:19 
QuestionCalculate checksum using ASLR Pin
Giggsey737-Jun-12 8:39
Giggsey737-Jun-12 8:39 
QuestionRe: Calculate checksum using ASLR Pin
David Crow7-Jun-12 8:43
David Crow7-Jun-12 8:43 
AnswerRe: Calculate checksum using ASLR Pin
Giggsey737-Jun-12 8:46
Giggsey737-Jun-12 8:46 
AnswerRe: Calculate checksum using ASLR Pin
David Crow7-Jun-12 8:55
David Crow7-Jun-12 8:55 
GeneralRe: Calculate checksum using ASLR Pin
Giggsey737-Jun-12 9:08
Giggsey737-Jun-12 9:08 
GeneralRe: Calculate checksum using ASLR Pin
Giggsey738-Jun-12 8:34
Giggsey738-Jun-12 8:34 
GeneralRe: Calculate checksum using ASLR Pin
Randor 8-Jun-12 9:48
professional Randor 8-Jun-12 9:48 
GeneralRe: Calculate checksum using ASLR Pin
Giggsey738-Jun-12 18:48
Giggsey738-Jun-12 18:48 
GeneralRe: Calculate checksum using ASLR Pin
Randor 9-Jun-12 4:36
professional Randor 9-Jun-12 4:36 
GeneralRe: Calculate checksum using ASLR Pin
Giggsey739-Jun-12 4:52
Giggsey739-Jun-12 4:52 
GeneralRe: Calculate checksum using ASLR Pin
Randor 9-Jun-12 5:28
professional Randor 9-Jun-12 5:28 
GeneralRe: Calculate checksum using ASLR Pin
Giggsey739-Jun-12 6:51
Giggsey739-Jun-12 6:51 

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.