Skip to main content
Question

Hi My code is working fine with FME Desktop 2014 but having error while compiling it with FME Desktop 2020 with below error error C2259: 'CtFunction': cannot instantiate abstract class as the IFMEFunction::execute is deprecated and need to upgrade


Hi My code is working fine with FME Desktop 2014 but having error while compiling it with FME Desktop 2020 with below error error C2259: 'CtFunction': cannot instantiate abstract class as the IFMEFunction::execute is deprecated and need to upgrade it.

2 replies

kailinatsafe
Safer
Forum|alt.badge.img+21

Hello @neerajm2​ , thanks for posting! Is this error coming from a workspace or code? If code, what language are you using? Also, may I ask what your workspace or code is trying to do? It looks like something you're using may have been deprecated since FME 2014? Best, Kailin.


  • Author
  • July 7, 2022

Hi @kailinatsafe​ 

Thanks for your response

The error is in a .cpp file of my workspace , in my source code i have created the function like this

FME_MsgNum CtFunction::execute(IFMEFeature& feature,

          const IFMEStringArray &parameterList,

          IFMEString &returnValue)

{

  gLogFile->logMessage(kMessage0,parameterList);

  FME_Real64 xSum = 0;

  FME_Real64 ySum = 0;

  FME_Real64 zSum = 0;

  FME_UInt32 coordNum = 0;

  for (coordNum = 0; coordNum < feature.numCoords(); coordNum++)

  {

    FME_Real64 xValue = 0; 

    FME_Real64 yValue = 0;

    FME_Real64 zValue = 0;

    if (feature.getDimension() == 3)

    {

       feature.getCoordinate(coordNum,

                  xValue, 

                  yValue, 

                  zValue);

    }

    else

    {

       feature.getCoordinate(coordNum,

                  xValue, 

                  yValue);

    }

    xSum += xValue;

    ySum += yValue;

    zSum += zValue;

  }

 

  FME_UInt32 originalNumCoords = feature.numCoords();

  feature.resetCoords();

  feature.addCoordinate(xSum / originalNumCoords,

             ySum / originalNumCoords,

             zSum / originalNumCoords);

 

   feature.setGeometryType(FME_GEOM_POINT);

  returnValue = "howdy";

  return 0;

}

now i have to upgrade it for FME Desktop 2020.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings