Click here to Skip to main content
15,913,854 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
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 
Also just a guess.

From MSDN:
<quote>
Compiler Error C2712
cannot use __try in functions that require object unwinding

You cannot have objects that require unwinding in a function with structured exception handling.

To avoid this error message, compile using the /GX- option.

The error can be avoided when using the /GX option by not having local variables or parameters with types that have destructors in a function that uses structured exception handling (SEH). Furthermore, SEH cannot be used in constructors or destructors if using /GX. Code that requires SEH can also be moved to another function in order to avoid the error.
</quote>

I would think you could eliminate the problem by using a TCHAR array instead of CStrings, that way there are no destructors to be called.

I think the problem is that if an exception is thrown, the CString destructor is unable to execute, resulting in a memory leak (at least the compiler sees it that way).

HTH




CPUA 0x5041

Sonork 100.11743 Chicken Little

"So it can now be written in stone as a testament to humanities achievments "PJ did Pi at CP"." Colin Davies

Within you lies the power for good - Use it!
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 
GeneralRe: VC++ Pin
Mike Nordell27-Jan-03 9:24
Mike Nordell27-Jan-03 9:24 
GeneralRe: VC++ Pin
Ravi2829-Jan-03 3:26
Ravi2829-Jan-03 3:26 
GeneralRe: VC++ Pin
Ravi2829-Jan-03 3:26
Ravi2829-Jan-03 3:26 
Generalsize of physical/virtual memory used by a process - WindowsNT/2000 Pin
alma27-Jan-03 5:42
alma27-Jan-03 5:42 
GeneralRe: size of physical/virtual memory used by a process - WindowsNT/2000 Pin
Mike Nordell27-Jan-03 9:36
Mike Nordell27-Jan-03 9:36 
GeneralRe: size of physical/virtual memory used by a process - WindowsNT/2000 Pin
alma28-Jan-03 3:59
alma28-Jan-03 3:59 
Generalremove & add a security group Pin
Member 13661827-Jan-03 5:23
Member 13661827-Jan-03 5:23 
GeneralOnInitialUpdate and SDI Pin
Haakon S.27-Jan-03 4:35
Haakon S.27-Jan-03 4:35 
GeneralRe: OnInitialUpdate and SDI Pin
HENDRIK R27-Jan-03 4:39
HENDRIK R27-Jan-03 4:39 
GeneralRe: OnInitialUpdate and SDI Pin
Haakon S.27-Jan-03 4:54
Haakon S.27-Jan-03 4:54 
GeneralRe: OnInitialUpdate and SDI Pin
HENDRIK R27-Jan-03 5:00
HENDRIK R27-Jan-03 5:00 

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.