For Programmers: Free Programming Magazines  


Home > Archive > VC++ > July 2004 > try/catch unreachable code C2407 migrating from vs 6.0 to vs 7.1 .NET









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author try/catch unreachable code C2407 migrating from vs 6.0 to vs 7.1 .NET
michael

2004-07-01, 8:57 am

I am migrating C++ unmanaged to managed VC 7.1. I continue to have
problems with try catch blocks through-out my code. The compile tells
me the the code is unreachable C2407 at the catch portion of the
block. I am using /clr /EHsc switches. The class does not have the
prefix "public _gc class CAccountExposure :
System::Windows::Forms::Form " but "class CAccountExposure : public
CDialog." The following is a snippet of code representing the problem:

try
{

statements that automate excel


}
catch(COleException *e)
{
char buf[500];
sprintf(buf, "COleException. SCode: %60x. ", (long)e->m_sc);
::MessageBox(NULL, buf, "COleException", MB_SETFOREGROUND | MB_OK);
}

mbiagion@travelers.com
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2010 codecomments.com