Error while trying to capture while converting VC6 to VS2008

When I opened the VC6 project in VS2008 and tried to build it, I initially got the error:

Fatal error C1083: Cannot open include file: "iostream.h": no such file or directory

error C2259: "CException": cannot create an abstract class

error BK1506: cannot open file '. \ Debug \ SClientDlg.sbr': no ​​such file or directory BSCMAKE SClient

Now I changed #include"iostream.h"to #include"iostream"and now I get 7errors (as I used try and catch of 7 places) saying:

error C2259: "CException": cannot create an abstract class

The following is a snippet of this code:

void SClientDlg::ProcessDomainName(int *m_pDlg,char* strDomainName,int iLen)
{
    try
    {
    //Do Something

    }
    catch(CException ex)
    {
        printf("Exception: %d",GetLastError()); 
    }


}
+3
source share
1 answer

You probably need to do this:

catch(CException& ex) // const& might be better

CException , , , .

+4

Source: https://habr.com/ru/post/1768173/


All Articles