Click here to Skip to main content
15,914,066 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Worker thread + memory leak.. Pin
RobJones27-Jan-03 9:38
RobJones27-Jan-03 9:38 
GeneralRe: Worker thread + memory leak.. Pin
Joaquín M López Muñoz27-Jan-03 9:44
Joaquín M López Muñoz27-Jan-03 9:44 
Generalerror C2712: Cannot use __try in functions that require object unwinding Pin
Joan M27-Jan-03 6:30
professionalJoan M27-Jan-03 6:30 
GeneralRe: error C2712: Cannot use __try in functions that require object unwinding Pin
Chris Meech27-Jan-03 7:43
Chris Meech27-Jan-03 7:43 
GeneralRe: error C2712: Cannot use __try in functions that require object unwinding Pin
Joan M27-Jan-03 8:32
professionalJoan M27-Jan-03 8:32 
GeneralRe: error C2712: Cannot use __try in functions that require object unwinding Pin
Mike Nordell27-Jan-03 9:20
Mike Nordell27-Jan-03 9:20 
GeneralRe: error C2712: Cannot use __try in functions that require object unwinding Pin
Joaquín M López Muñoz27-Jan-03 9:16
Joaquín M López Muñoz27-Jan-03 9:16 
GeneralRe: error C2712: Cannot use __try in functions that require object unwinding Pin
Joan M28-Jan-03 21:12
professionalJoan M28-Jan-03 21:12 
Hello,

Excuse me for having not said anything till now, I've been out of my office some days...

I've tried it, but the compiler tells me:
error C2653: 'std' : is not a class or namespace name
Also I've tried to write down (just before the class definition)
using namespace std;
but then the message is:
error C2871: 'std' : does not exist or is not a namespace
Moreover, after all of this has been done I've tried to get it work using the normal try/catch exception handlers, but if I place them there it seems that the thread gets locked somewhere/somehow...

the code that I've used is:
try
{
  // Preparació de l'arxiu de log de l'operació de còpia de seguretat.
  hArxiuLog = CreateFile (csFullPathArxiuRegistreCS,GENERIC_WRITE,FILE_SHARE_WRITE | FILE_SHARE_READ,NULL,OPEN_ALWAYS,FILE_ATTRIBUTE_ARCHIVE,NULL);
}
catch(CException *e)
{
  hArxiuLog = INVALID_HANDLE_VALUE;
  e->Delete();
}

<code>// the code below should execute after having detected an exception and having deleted it...</code>
What I've understood (reading to the MSDN) is that if I place a try statement the exceptions that are in the catch clause are handled by the contents of the catch clause. Then, the code that I've implemented should catch all the exceptions (I think that all the CExceptions are derived from CException class) and then as I delete the exception e->Delete() the code should continue executing normally after the catch clause without hanging the thread.

Am I right?

Thank you in advance.
GeneralRe: error C2712: Cannot use __try in functions that require object unwinding Pin
Joaquín M López Muñoz28-Jan-03 21:32
Joaquín M López Muñoz28-Jan-03 21:32 
GeneralRe: error C2712: Cannot use __try in functions that require object unwinding Pin
Joan M28-Jan-03 21:37
professionalJoan M28-Jan-03 21:37 
GeneralRe: error C2712: Cannot use __try in functions that require object unwinding Pin
Joan M28-Jan-03 22:33
professionalJoan M28-Jan-03 22:33 
GeneralRe: error C2712: Cannot use __try in functions that require object unwinding Pin
Joaquín M López Muñoz29-Jan-03 0:09
Joaquín M López Muñoz29-Jan-03 0:09 
GeneralRe: error C2712: Cannot use __try in functions that require object unwinding Pin
Joan M29-Jan-03 0:30
professionalJoan M29-Jan-03 0:30 
GeneralRe: error C2712: Cannot use __try in functions that require object unwinding Pin
Joaquín M López Muñoz29-Jan-03 0:32
Joaquín M López Muñoz29-Jan-03 0:32 
GeneralRe: error C2712: Cannot use __try in functions that require object unwinding Pin
Joan M29-Jan-03 0:57
professionalJoan M29-Jan-03 0:57 
GeneralRe: error C2712: Cannot use __try in functions that require object unwinding Pin
Joaquín M López Muñoz29-Jan-03 2:38
Joaquín M López Muñoz29-Jan-03 2:38 
GeneralRe: error C2712: Cannot use __try in functions that require object unwinding Pin
Joan M29-Jan-03 3:44
professionalJoan M29-Jan-03 3:44 
GeneralRe: error C2712: Cannot use __try in functions that require object unwinding Pin
Joan M29-Jan-03 4:23
professionalJoan M29-Jan-03 4:23 
GeneralRe: error C2712: Cannot use __try in functions that require object unwinding Pin
PJ Arends27-Jan-03 9:18
professionalPJ Arends27-Jan-03 9:18 
GeneralRe: error C2712: Cannot use __try in functions that require object unwinding Pin
Joan M28-Jan-03 21:16
professionalJoan M28-Jan-03 21:16 
GeneralGetDlgItem and CFormView Pin
ElizabethC27-Jan-03 6:04
ElizabethC27-Jan-03 6:04 
GeneralRe: GetDlgItem and CFormView Pin
PJ Arends27-Jan-03 6:59
professionalPJ Arends27-Jan-03 6:59 
GeneralRe: GetDlgItem and CFormView Pin
Bill Gates Antimatter Particle27-Jan-03 7:02
Bill Gates Antimatter Particle27-Jan-03 7:02 
GeneralRe: GetDlgItem and CFormView Pin
ElizabethC27-Jan-03 7:05
ElizabethC27-Jan-03 7:05 
GeneralVC++ Pin
Ravi2827-Jan-03 5:46
Ravi2827-Jan-03 5:46 

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.