Click here to Skip to main content
16,017,351 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionRe: Difference between a Dll and an ActivexDll Pin
lgatcodeproject6-Nov-08 19:31
lgatcodeproject6-Nov-08 19:31 
AnswerRe: Difference between a Dll and an ActivexDll Pin
Saurabh.Garg6-Nov-08 19:52
Saurabh.Garg6-Nov-08 19:52 
QuestionRe: Difference between a Dll and an ActivexDll Pin
lgatcodeproject6-Nov-08 20:11
lgatcodeproject6-Nov-08 20:11 
AnswerRe: Difference between a Dll and an ActivexDll Pin
Saurabh.Garg6-Nov-08 20:21
Saurabh.Garg6-Nov-08 20:21 
GeneralRe: Difference between a Dll and an ActivexDll Pin
lgatcodeproject6-Nov-08 20:44
lgatcodeproject6-Nov-08 20:44 
GeneralRe: Difference between a Dll and an ActivexDll Pin
Saurabh.Garg6-Nov-08 21:11
Saurabh.Garg6-Nov-08 21:11 
Questiongrab the result from sql query using visual c++ 2003 Pin
Arif Liminto6-Nov-08 17:13
professionalArif Liminto6-Nov-08 17:13 
QuestionMultiple Windows Threads Pin
Bram van Kampen6-Nov-08 14:46
Bram van Kampen6-Nov-08 14:46 
Hi,
I'm coding a small fragment which gets called when the system fails to secure a resource on the local network. (it is to replace a Retrycancel Message, with a Dialog box on a different thread, telling that the system is busy, offering a 'Cancel button. The further idea is, that when the resource becomes available, the box disappears, and normal porocess follows. The entire Project is Dialog based.
The Escence of the code is as follows:-
<br />
int ProcDlg::Do(){<br />
	if(!m_bIsRunning){		<br />
		AfxBeginThread(ThreadProc,this);<br />
		m_bIsRunning=TRUE;<br />
		return IDOK;<br />
	}<br />
	else if(m_bDoCancel){<br />
		return EndDialog(IDCANCEL);<br />
	}<br />
<br />
	else return IDOK;<br />
}<br />
<br />
void WaitDlg::OnCancel(){<br />
	...<br />
	m_pInfo->m_bDoCancel=TRUE;<br />
}<br />
<br />
UINT ThreadProc(void* pParam){<br />
	WaitDlg dlg;<br />
	dlg.m_pInfo=(ProcDlg*)pParam;<br />
	dlg.DoModal();<br />
	return 0;<br />
}<br />

The General Idea is, that the Wait Dialog sets a Flag in the Process Dialog, which, when stumbled upon, will do the cleanup.

To make the code readable, and to get to the nubb of the problem, I left out a lot of supporting code, including Synchronisation objects.

The thread that runs the Notification Dialog, gets locked up!
It locks the thread in:
<br />
	if (hWndParent != NULL && ::IsWindowEnabled(hWndParent))<br />
	{<br />
		::EnableWindow(hWndParent, FALSE);<br />
		bEnableParent = TRUE;<br />
	}<br />


in particular in ::EnableWindow.

Traceing into that in the Disassembly Window lands at an opcode 0x0F, where it stops.

What's going on here!


Confused | :confused:

Bram van Kampen

AnswerRe: Multiple Windows Threads Pin
Mark Salsbery6-Nov-08 15:13
Mark Salsbery6-Nov-08 15:13 
GeneralRe: Multiple Windows Threads Pin
Bram van Kampen6-Nov-08 16:54
Bram van Kampen6-Nov-08 16:54 
GeneralRe: Multiple Windows Threads Pin
Mark Salsbery7-Nov-08 3:43
Mark Salsbery7-Nov-08 3:43 
GeneralRe: Multiple Windows Threads Pin
Bram van Kampen8-Nov-08 13:20
Bram van Kampen8-Nov-08 13:20 
GeneralRe: Multiple Windows Threads Pin
Mark Salsbery8-Nov-08 14:46
Mark Salsbery8-Nov-08 14:46 
GeneralRe: Multiple Windows Threads Pin
Bram van Kampen16-Nov-08 13:21
Bram van Kampen16-Nov-08 13:21 
Question2D Arrays Pin
livin lie6-Nov-08 11:47
livin lie6-Nov-08 11:47 
AnswerRe: 2D Arrays Pin
Saurabh.Garg6-Nov-08 15:16
Saurabh.Garg6-Nov-08 15:16 
QuestionRe: 2D Arrays Pin
David Crow6-Nov-08 16:45
David Crow6-Nov-08 16:45 
AnswerRe: 2D Arrays Pin
livin lie7-Nov-08 6:21
livin lie7-Nov-08 6:21 
QuestionTutorial Object Array Pin
Reagan Conservative6-Nov-08 9:02
Reagan Conservative6-Nov-08 9:02 
AnswerRe: Tutorial Object Array Pin
sashoalm6-Nov-08 10:18
sashoalm6-Nov-08 10:18 
GeneralRe: Tutorial Object Array Pin
Reagan Conservative6-Nov-08 11:22
Reagan Conservative6-Nov-08 11:22 
QuestionI need help with my program, new c++ programmer Pin
OverdoS6-Nov-08 7:56
OverdoS6-Nov-08 7:56 
QuestionRe: I need help with my program, new c++ programmer Pin
David Crow6-Nov-08 8:17
David Crow6-Nov-08 8:17 
AnswerRe: I need help with my program, new c++ programmer Pin
CPallini6-Nov-08 10:30
mveCPallini6-Nov-08 10:30 
AnswerRe: I need help with my program, new c++ programmer Pin
led mike6-Nov-08 8:52
led mike6-Nov-08 8:52 

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.