LogWindows: Windows GetLastError: The operation completed successfully

Hi guys basically what I’m trying to achieve is to create recursive function for my code everything going fine until this function is running but when my function stops Executing unreal crushes and gives me this error :

LogWindows: Windows GetLastError: The operation completed successfully.

have anyone had same problem? I’ve tried to google this error but couldn’t find any real solution.

PS. my function looks like this

void UShowAnswers::OnDelayTimerHandle()
{
	
	GetWorld()->GetTimerManager().ClearTimer(DelayTimerHandle);
	UWidget* UAnswerText = CurrentWidget->GetWidgetFromName("AnswerText");
	UEditableText* UEAnswerText = Cast<UEditableText>(UAnswerText);
	UEAnswerText->SetText(FAnswerPropertiesStruct[j].FTanswer);
	j++;
	if (j < FAnswerPropertiesStruct.Num()) {
		UE_LOG(LogTemp, Warning, TEXT("SUCCEED Struct.Length : %d, Index.Length : %d"), FAnswerPropertiesStruct.Num(), j);
		GetWorld()->GetTimerManager().SetTimer(DelayTimerHandle, this, &UShowAnswers::OnDelayTimerHandle, FAnswerPropertiesStruct[j].DelayTime, false);
	}	
	else {
		UE_LOG(LogTemp, Warning, TEXT("FAILED Struct.Length : %d, Index.Length : %d"), FAnswerPropertiesStruct.Num(), j);
		TimeToEnd = true;

	}
}

This line is suspect. You assume that FAnswerPropertiesStruct will always have an entry for the value j.
UEAnswerText->SetText(FAnswerPropertiesStruct[j].FTanswer);

I have never set a timer in the method I want it to call. I would refactor my code to not do this.

To me recursive means a function calling itself. This technique would not qualify for that term.

It also feels like there is more to what is being reported as an error. What you have shared does not point to this function.

thanks for reply i’ve already found solution
and by the way you were right SetText line was the error’s main causing reason :stuck_out_tongue:

Glad you found it!