I want to use montage in C ++

yes, the method you are using is not about montage, here one that should work :

TheSkelatalMeshToCheck->AnimScriptInstance->Montage_IsPlaying(AnimMontage_Attack01))

“AnimScriptInstance” is your animationBlueprint runtime object

if (bAttack && !IsPlayingSlotAnimation(AnimMontage_Attack01, TEXT(“AttackSlot”)))
{
float a = PlaySlotAnimation(AnimMontage_Attack01, TEXT(“AttackSlot”));
}

if (IsPlayingSlotAnimation(AnimMontage_Attack01, TEXT("AttackSlot")))
{
}

With IsPlayingSlotAnimation()
I’d like to know if the animation is playing now
all false
Is the code wrong?

Thank you for your reply
So does it mean that you can’t manage Animation using slots in C ++?