Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

"LogWindows:Error: WindowsGetLastError: The operation completed successfully." Error - how do I solve this?

Whenever I put some code before the 'UCLASS()' declaration in a .h file, this error occurs and Visual Studio underlines 'UCLASS()' with the unhelpful message 'This declaration has no storage class or type specifier'. Currently I'm trying to create an enum, however this error occurs every time I add extra code before the class declaration.


 // Fill out your copyright notice in the Description page of Project Settings.
 #pragma once
 #include "GameFramework/Character.h"
 #include "Enemy.generated.h"
 enum class EState : uint8
     ESTATE_Idle        UMETA(DisplayName = "Idle"),
     ESTATE_Moving    UMETA(DisplayName = "Moving")
 class MYGAME_API AEnemy : public ACharacter
     // Sets default values for this character's properties
     // Called when the game starts or when spawned
     virtual void BeginPlay() override;
     // Called every frame
     virtual void Tick( float DeltaSeconds ) override;
     // Called to bind functionality to input
     virtual void SetupPlayerInputComponent(class UInputComponent* InputComponent) override;
     // Create variables
     int32 MaxHealth;
     int32 AttackDamage;
     int32 AggroRange;
     int32 AttackRange;
     int32 MovementSpeed;
     float TurnSpeed = 5.f;
     int32 Aggro;
     bool bIsAlive = true;
     int32 CurrentHealth = 100;
     UPROPERTY(EditAnywhere, BlueprintReadWrite)
     EState State = Idle;
     // Create functions
     void TakeDmg(int32 Damage);
     int32 CheckForAggro(int32 Aggro, int32 AggroRange);
     void Attack(int32 PlayerCode);
     void TakeAttack(int32 Damage);
     FRotator GetRotationToPlayer(int32 PlayerCode);
     FVector2D GetVector2DToPlayer(int32 PlayerCode);

How do I get rid of this error? Is it to do with the enum, and if so how do I correctly create an enum? If not, I've also tried coding a 'UUserDefinedEnum' that would be included as a header file, what is the correct syntax for creating one of these?

Thanks in advance

Product Version: UE 4.8
more ▼

asked Aug 07 '15 at 08:57 PM in C++ Programming

avatar image

35 5 4 11

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question