MFC App in VS2017 on Win10 Fails

  • Thread starter Thread starter FrankDMuir
  • Start date Start date
F

FrankDMuir

Guest
Hello,


I've followed the instructions for the MFCAnimationWalkthrough example. VS2017 Community compiled both a Debug/x86 and a Release/x64 configuration

before any changes were made. After all changes were made both configurations failed to compile. 8 errors for the Debug/x86 and 5 errors for the Release/x64 centered on 3 statements in the Animate Method of the MFCAnimationWalkthroughView Class. The code for that method follows and the 3 statements are in bold type

:

void CMFCAnimationWalkthroughView::Animate(BOOL bDirection)
{
m_bCurrentDirection = bDirection;
static UI_ANIMATION_SECONDS duration = 3;
static DOUBLE dblSpeed = 35.;
static BYTE nStartColor = 50;
static BYTE nEndColor = 255;
BYTE nRedColorFinal = bDirection nStartColor : nEndColor;
BYTE nGreenColorFinal = bDirection nStartColor : nEndColor;
BYTE nBlueColorFinal = bDirection nStartColor : nEndColor;
CLinearTransition* pRedTransition =
new CLinearTransition(duration, (DOUBLE)nRedColorFinal);
CSmoothStopTransition* pGreenTransition =
new CSmoothStopTransition(duration, (DOUBLE)nGreenColorFinal);
CLinearTransitionFromSpeed* pBlueTransition =
new CLinearTransitionFromSpeed(dblSpeed, (DOUBLE)nBlueColorFinal);
m_animationColor.AddTransition(pRedTransition,
pGreenTransition,
pBlueTransition);
CRect rectClient;
GetClientRect(rectClient);
rectClient.top += nInfoAreaHeight;
int nLeftFinal = bDirection ? rectClient.left : rectClient.CenterPoint().x;
int nTopFinal = bDirection ? rectClient.top : rectClient.CenterPoint().y;
int nRightFinal = bDirection ? rectClient.right : rectClient.CenterPoint().x;
int nBottomFinal = bDirection ? rectClient.bottom : rectClient.CenterPoint().y;
CLinearTransition* pLeftTransition =
new CLinearTransition(duration, nLeftFinal);
CLinearTransition* pTopTransition =
new CLinearTransition(duration, nTopFinal);
CLinearTransition* pRightTransition =
new CLinearTransition(duration, nRightFinal);
CLinearTransition* pBottomTransition =
new CLinearTransition(duration, nBottomFinal);
m_animationRect.AddTransition(pLeftTransition,
pTopTransition,
pRightTransition,
pBottomTransition);
CBaseKeyFrame* pKeyframeStart =
CAnimationController::GetKeyframeStoryboardStart();
CKeyFrame* pKeyFrameEnd =
m_animationController.CreateKeyframe(nAnimationGroup,
pBlueTransition);
pLeftTransition->SetKeyframes(pKeyframeStart, pKeyFrameEnd);
pTopTransition->SetKeyframes(pKeyframeStart, pKeyFrameEnd);
pRightTransition->SetKeyframes(pKeyframeStart, pKeyFrameEnd);
pBottomTransition->SetKeyframes(pKeyframeStart, pKeyFrameEnd);
m_animationController.AnimateGroup(nAnimationGroup);
}


The errors didn't make any sense to me. They said a ";" was missing before the label nStartColor and that the label was redefind in the last two statements in question. A search of the web found a couple listings of that method which matched mine to a tee. They didn't indicate that there were any errors.


Any suggestions would be greatly appreciated!


Regards!

Continue reading...
 
Back
Top