MCRO
C++23 utilities for Unreal Engine.
Loading...
Searching...
No Matches
WindowsError.h
Go to the documentation of this file.
1
/** @noop License Comment
2
* @file
3
* @copyright
4
* This Source Code is subject to the terms of the Mozilla Public License, v2.0.
5
* If a copy of the MPL was not distributed with this file You can obtain one at
6
* https://mozilla.org/MPL/2.0/
7
*
8
* @author David Mórász
9
* @date 2025
10
*/
11
12
#pragma once
13
14
#include "CoreMinimal.h"
15
#include "
Mcro/Error.h
"
16
17
namespace
Mcro::Windows::Error
18
{
19
using namespace
Mcro::Error
;
20
21
/**
22
* An error wrapping the returned code of GetLastError and attempts to get a string description of it
23
*/
24
MCROWINDOWS_API
class
FLastError
:
public
IError
25
{
26
public
:
27
FLastError
(int32 errorCode);
28
29
/** The result code wrapped by this error */
30
int32
ErrorCode
;
31
32
/** The message what the Windows API communicates to us */
33
FString
SystemMessage
;
34
};
35
36
/**
37
* An error wrapping HRESULT code returned by many Microsoft APIs. It will also collect human readable metadata.
38
*/
39
MCROWINDOWS_API
class
FHresultError
:
public
IError
40
{
41
public
:
42
/**
43
* @param result The input HRESULT
44
*
45
* @param fastMode
46
* Set it true to not gather human readable information about the error and just display the HRESULT code as is.
47
* Use it only in cursed situations where something may fail very often but it still needs a full IError
48
* somehow. Or just avoid such cursed situations in the first place.
49
*/
50
FHresultError
(HRESULT result,
bool
fastMode =
false
);
51
52
void
SetHumanReadable
();
53
54
/** The result code wrapped by this error */
55
HRESULT
Result
;
56
57
/** The message what the Windows API communicates to us */
58
FString
SystemMessage
;
59
60
/** Stores the language-dependent programmatic ID (ProgID) for the class or application that raised the error. */
61
FString
ProgramID
;
62
63
/** A textual description of the error (might be different from Message) */
64
FString
Description
;
65
};
66
}
Error.h
Mcro::Error::IError
Definition
Error.h:64
Mcro::Windows::Error::FHresultError
Definition
WindowsError.h:40
Mcro::Windows::Error::FHresultError::Description
FString Description
Definition
WindowsError.h:64
Mcro::Windows::Error::FHresultError::FHresultError
FHresultError(HRESULT result, bool fastMode=false)
Mcro::Windows::Error::FHresultError::SystemMessage
FString SystemMessage
Definition
WindowsError.h:58
Mcro::Windows::Error::FHresultError::Result
HRESULT Result
Definition
WindowsError.h:55
Mcro::Windows::Error::FHresultError::ProgramID
FString ProgramID
Definition
WindowsError.h:61
Mcro::Windows::Error::FHresultError::SetHumanReadable
void SetHumanReadable()
Mcro::Windows::Error::FLastError
Definition
WindowsError.h:25
Mcro::Windows::Error::FLastError::FLastError
FLastError(int32 errorCode)
Mcro::Windows::Error::FLastError::ErrorCode
int32 ErrorCode
Definition
WindowsError.h:30
Mcro::Windows::Error::FLastError::SystemMessage
FString SystemMessage
Definition
WindowsError.h:33
Mcro::Error
Definition
Error.Fwd.h:19
Mcro::Windows::Error
Definition
WindowsError.h:18
McroWindows_Origin
Public
McroWindows
Error
WindowsError.h
Generated by
1.12.0