Click here to Skip to main content
15,911,762 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Project properties Pin
help_wanted18-Oct-04 17:39
help_wanted18-Oct-04 17:39 
Generalserial port communication Pin
Anonymous18-Oct-04 13:29
Anonymous18-Oct-04 13:29 
GeneralRe: serial port communication Pin
Murlai18-Oct-04 19:02
Murlai18-Oct-04 19:02 
Generalfile problem Pin
Anonymous18-Oct-04 13:12
Anonymous18-Oct-04 13:12 
GeneralRe: file problem Pin
RobJones18-Oct-04 13:14
RobJones18-Oct-04 13:14 
GeneralRe: file problem Pin
Azghar Hussain18-Oct-04 19:01
professionalAzghar Hussain18-Oct-04 19:01 
GeneralRe: file problem Pin
Murlai18-Oct-04 19:26
Murlai18-Oct-04 19:26 
GeneralException handling Pin
RobJones18-Oct-04 13:09
RobJones18-Oct-04 13:09 
Hello,
I am trying to pass data through a CSocket using CSocketFile and CArchive.. Everything works great except if the network connection breaks it thows a CFileException when sending.. I am trying to handle the exception with the following code..

2 problems:
1st) is when I exit the app i get a memory leak, I am guessing that it's because the ar_send.Flush() is what is throwing the exception so the archive data doesn't get flushed..

2nd) the exception throws up a MessageBox and I don't want that, I want to handle the error on my own.. Here is what I have...

CSocketFile sf(&m_sSocket);
CArchive ar_send(&sf, CArchive::store);
	
TRY {
	// Send the data
	ar_send << strSend;
	ar_send.Flush();
 
	ar_send.Close();
	sf.Close();
}
CATCH_ALL(error){
 
	TCHAR szCause[4096];
	error->GetErrorMessage(szCause,4096,NULL);
	TRACE("OnSend() Error: %s\n",szCause);
} END_CATCH_ALL;


Thanks!
Rob

Whoever said nothing's impossible never tried slamming a revolving door!
GeneralRe: Got a little further.. but still need help Pin
RobJones18-Oct-04 17:40
RobJones18-Oct-04 17:40 
Generali need help!!!!!!! Pin
DaBlueSage18-Oct-04 13:00
DaBlueSage18-Oct-04 13:00 
GeneralRe: i need help!!!!!!! Pin
l a u r e n18-Oct-04 15:25
l a u r e n18-Oct-04 15:25 
GeneralRe: i need help!!!!!!! Pin
bryce18-Oct-04 20:39
bryce18-Oct-04 20:39 
GeneralConversion between multibyte and UNICODE Pin
Vancouver18-Oct-04 12:32
Vancouver18-Oct-04 12:32 
GeneralRe: Conversion between multibyte and UNICODE Pin
l a u r e n18-Oct-04 15:26
l a u r e n18-Oct-04 15:26 
GeneralRe: Conversion between multibyte and UNICODE Pin
Vancouver18-Oct-04 15:50
Vancouver18-Oct-04 15:50 
GeneralRe: Conversion between multibyte and UNICODE Pin
PJ Arends18-Oct-04 16:09
professionalPJ Arends18-Oct-04 16:09 
GeneralRe: Conversion between multibyte and UNICODE Pin
Vancouver18-Oct-04 17:54
Vancouver18-Oct-04 17:54 
GeneralRe: Conversion between multibyte and UNICODE Pin
PJ Arends19-Oct-04 5:21
professionalPJ Arends19-Oct-04 5:21 
GeneralRe: Conversion between multibyte and UNICODE Pin
Vancouver19-Oct-04 6:15
Vancouver19-Oct-04 6:15 
GeneralCopy Constructor Pin
Malcolm Smart18-Oct-04 10:46
Malcolm Smart18-Oct-04 10:46 
GeneralRe: Copy Constructor Pin
David Crow18-Oct-04 11:18
David Crow18-Oct-04 11:18 
GeneralRe: Copy Constructor Pin
Malcolm Smart18-Oct-04 11:37
Malcolm Smart18-Oct-04 11:37 
GeneralRe: Copy Constructor Pin
David Crow18-Oct-04 16:16
David Crow18-Oct-04 16:16 
GeneralWM_CLOSE message Pin
help_wanted18-Oct-04 9:10
help_wanted18-Oct-04 9:10 
GeneralRe: WM_CLOSE message Pin
David Crow18-Oct-04 9:19
David Crow18-Oct-04 9:19 

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.