Click here to Skip to main content
15,923,557 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionHow to capture "[" and "]" keys on OnKeyDown()? Pin
TooShy2Talk20-May-08 17:36
TooShy2Talk20-May-08 17:36 
AnswerRe: How to capture "[" and "]" keys on OnKeyDown()? Pin
Rajkumar R20-May-08 18:22
Rajkumar R20-May-08 18:22 
GeneralRe: How to capture "[" and "]" keys on OnKeyDown()? Pin
TooShy2Talk21-May-08 21:55
TooShy2Talk21-May-08 21:55 
QuestionMedia Decoder Application Pin
Akin Ocal20-May-08 15:33
Akin Ocal20-May-08 15:33 
AnswerRe: Media Decoder Application Pin
Rajkumar R20-May-08 17:40
Rajkumar R20-May-08 17:40 
QuestionBest way to setup this code - two client views Pin
Kwanalouie20-May-08 14:21
Kwanalouie20-May-08 14:21 
AnswerRe: Best way to setup this code - two client views Pin
Rajkumar R20-May-08 19:07
Rajkumar R20-May-08 19:07 
QuestionException caught but not handled completely Pin
Royce Fickling20-May-08 10:27
Royce Fickling20-May-08 10:27 
I have an exception handling problem that I don't understand. My thread function is throwing an unhandled exception which is being caught by my catch(...) handler but not completely handled. This causes my thread to be prematurely terminated so that my cleanup logic is not executed. How can I change my handler so as to completely handle the exception and execute my cleanup logic? My code is below.

UINT CVarFileEvent::MultiFileProcessThread( LPVOID lpParam )
{
	// This is the threaded multi-file processor. It 
	//	searches for and processes all VAR files in the
	//	Inbox or until it is cancelled by a call from
	//	DataMovement due to a Cancel message from PC-GBS.
	CVarFileEvent* pEvent = (CVarFileEvent*)lpParam;
	TRACE( "> > > > Entering CVarFileEvent::MultiFileProcessThread()\n" );

	// We must call ::CoInitialize() each time the database is accessed
	HRESULT hRes = ::CoInitialize(NULL);
	try
	{
		vector<cstring> vecVarFiles = UtilK::findAllFiles( "*.var", 
						pDataMovement->getInboxPath(), 
						false );
		TRACE( "> > > > > Beginning processing of %d VAR files\n", 
						(int)vecVarFiles.size() );

		CDataMovement* pDataMovement = pEvent->getDataMovementParent();
		CFlightDataHandler FlightDataHandler( pDataMovement->getLogWriter() );
		// run until we are cancelled or all files processed
		for( vector<cstring>::iterator iterFile = vecVarFiles.begin();
				iterFile != vecVarFiles.end()  &&  m_bIsThreadRunning;
				iterFile++ )
		{
            			FlightDataHandler.importVARFile( *iterFile );
			// now delete the input file and remove the event 
			//	for this file from the queue if it exists
			::DeleteFile( *iterFile );
			pDataMovement->deleteFileEvent( *iterFile );
		}
	}
	catch(...)
	{
		CString strMsg( "importVARFile() failed with unexpected exception" );
		TRACE( "> > > > CVarFileEvent::MultiFileProcessThread() exception < %s >\n", strMsg );
		CLogWriter* pLogWriter = pDataMovement->getLogWriter();
		pLogWriter->writeEntry( "CVarFileEvent", CLogWriter::LE_OPERATION_FAILED, strMsg );
	}

	// Cleanup
	::CoUninitialize();
	// the main thread is waiting so indicate we have stopped processing
	pDataMovement->setInboxProcessEndEvent();
	m_bIsThreadRunning = false;
	return 1;
}</cstring></cstring>


Thanks
AnswerRe: Exception caught but not handled completely Pin
led mike20-May-08 11:46
led mike20-May-08 11:46 
QuestionMFC components and minGW... Pin
greghint20-May-08 9:58
greghint20-May-08 9:58 
AnswerRe: MFC components and minGW... Pin
Rajkumar R20-May-08 20:08
Rajkumar R20-May-08 20:08 
GeneralRe: MFC components and minGW... Pin
greghint11-Jun-08 16:27
greghint11-Jun-08 16:27 
Questioninitial position of pop-up dialog box Pin
Kwanalouie20-May-08 7:45
Kwanalouie20-May-08 7:45 
AnswerRe: initial position of pop-up dialog box Pin
David Crow20-May-08 7:48
David Crow20-May-08 7:48 
AnswerRe: initial position of pop-up dialog box Pin
Nelek21-May-08 6:56
protectorNelek21-May-08 6:56 
QuestionLoss of data using CList::AddTail() Pin
piul20-May-08 5:55
piul20-May-08 5:55 
QuestionRe: Loss of data using CList::AddTail() Pin
Ernest Laurentin20-May-08 7:51
Ernest Laurentin20-May-08 7:51 
QuestionRe: Loss of data using CList::AddTail() Pin
David Crow20-May-08 7:55
David Crow20-May-08 7:55 
QuestionHow can i copy raw image buffer to a dc? Pin
Soumyadipta20-May-08 5:09
Soumyadipta20-May-08 5:09 
AnswerRe: How can i copy raw image buffer to a dc? Pin
CPallini20-May-08 6:22
mveCPallini20-May-08 6:22 
GeneralRe: How can i copy raw image buffer to a dc? Pin
Soumyadipta20-May-08 18:49
Soumyadipta20-May-08 18:49 
GeneralRe: How can i copy raw image buffer to a dc? Pin
CPallini20-May-08 21:09
mveCPallini20-May-08 21:09 
GeneralRe: How can i copy raw image buffer to a dc? Pin
Soumyadipta20-May-08 23:08
Soumyadipta20-May-08 23:08 
GeneralRe: How can i copy raw image buffer to a dc? Pin
CPallini20-May-08 23:47
mveCPallini20-May-08 23:47 
GeneralRe: How can i copy raw image buffer to a dc? Pin
Soumyadipta21-May-08 0:26
Soumyadipta21-May-08 0:26 

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.