Click here to Skip to main content
15,886,659 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionRe: How to Recognise a window Pin
john56328-May-09 3:42
john56328-May-09 3:42 
GeneralBasics Pin
Anil Kumar.Arvapalli8-May-09 2:04
Anil Kumar.Arvapalli8-May-09 2:04 
GeneralRe: Basics Pin
_AnsHUMAN_ 8-May-09 2:11
_AnsHUMAN_ 8-May-09 2:11 
QuestionHelp in win32 dll & c# Pin
ashish8patil8-May-09 1:40
ashish8patil8-May-09 1:40 
AnswerRe: Help in win32 dll & c# Pin
_AnsHUMAN_ 8-May-09 1:51
_AnsHUMAN_ 8-May-09 1:51 
GeneralRe: Help in win32 dll & c# Pin
ashish8patil8-May-09 2:10
ashish8patil8-May-09 2:10 
GeneralRe: Help in win32 dll & c# Pin
_AnsHUMAN_ 8-May-09 2:14
_AnsHUMAN_ 8-May-09 2:14 
QuestionMulti-thread Synchronization with Mutex [modified] Pin
barot8-May-09 1:31
barot8-May-09 1:31 
Hi All,

Can someone point me in the right direction? This is a reference to the article: "Synchronized multi-threading in C++ (No MFC!)"

Synchronized multi-threading in C++ (No MFC!)

I have been using the thread code and it worked well for me. But this time around, nothing has changed and it returns an unhandled exception on "thread::wait", line "return false" when "wait("MyMutex")" is called during a receive from a worker thread.

unhandled exception in kernel32 (0xE06D7363) on Thread::wait ( line "return false")
Thread::wait(const char * 0x004768e8 `string', long 0x00001388)

Thanks for your help.

Code Section

bool Thread::wait(const char* m,long ms) {
	HANDLE h = OpenMutex(MUTEX_ALL_ACCESS,FALSE,m);
	if(h == NULL) {
		throw ThreadException("Mutex not found");
	}
	DWORD d = WaitForSingleObject(h,ms);
	switch(d) {
	case WAIT_ABANDONED:
		throw ThreadException("Mutex not signaled");
		break;
	case WAIT_OBJECT_0:
		return true;
	case WAIT_TIMEOUT:
		throw ThreadException("Wait timed out");
		break;
	}
	return false;
}


modified on Friday, May 8, 2009 8:49 AM

QuestionTab Control Pin
zakkas24838-May-09 1:15
zakkas24838-May-09 1:15 
AnswerRe: Tab Control Pin
Stuart Dootson8-May-09 2:16
professionalStuart Dootson8-May-09 2:16 
GeneralRe: Tab Control Pin
zakkas24838-May-09 2:36
zakkas24838-May-09 2:36 
QuestionRe: Tab Control Pin
David Crow8-May-09 2:54
David Crow8-May-09 2:54 
GeneralRe: Tab Control Pin
Stuart Dootson8-May-09 3:18
professionalStuart Dootson8-May-09 3:18 
QuestionHow to display Images in a List Control or any other control one by one Pin
Shiv Murti Pal8-May-09 1:09
Shiv Murti Pal8-May-09 1:09 
AnswerRe: How to display Images in a List Control or any other control one by one Pin
Hamid_RT8-May-09 2:16
Hamid_RT8-May-09 2:16 
QuestionFlash ActiveX and DX Pin
GamerGoon8-May-09 0:33
GamerGoon8-May-09 0:33 
QuestionDll address Pin
gopalraja8-May-09 0:12
gopalraja8-May-09 0:12 
AnswerRe: Dll address Pin
_AnsHUMAN_ 8-May-09 0:23
_AnsHUMAN_ 8-May-09 0:23 
Questionhow to add word in a special position where cursor at Pin
jeansea7-May-09 23:51
jeansea7-May-09 23:51 
AnswerRe: how to add word in a special position where cursor at Pin
_AnsHUMAN_ 7-May-09 23:56
_AnsHUMAN_ 7-May-09 23:56 
QuestionDebugging problem Pin
pani687-May-09 23:50
pani687-May-09 23:50 
AnswerRe: Debugging problem Pin
_AnsHUMAN_ 7-May-09 23:53
_AnsHUMAN_ 7-May-09 23:53 
GeneralRe: Debugging problem Pin
Rajesh R Subramanian8-May-09 0:06
professionalRajesh R Subramanian8-May-09 0:06 
GeneralRe: Debugging problem Pin
_AnsHUMAN_ 8-May-09 0:09
_AnsHUMAN_ 8-May-09 0:09 
GeneralRe: Debugging problem Pin
Rajesh R Subramanian8-May-09 0:45
professionalRajesh R Subramanian8-May-09 0:45 

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.