-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
13 changed files
with
289 additions
and
115 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
// | ||
// Created by Roman on 6/3/2023. | ||
// | ||
|
||
#include "text_consts.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// | ||
// Created by Roman on 6/3/2023. | ||
// | ||
|
||
#ifndef MD5_HASH_TOOL_TEXT_CONSTS_H | ||
#define MD5_HASH_TOOL_TEXT_CONSTS_H | ||
|
||
#include <tchar.h> | ||
|
||
enum errorMsgResolver { | ||
openFileError = 0, | ||
CryptAcquireCtxError, | ||
CryptCreateHashError, | ||
CryptHashDataError, | ||
fileReadError, | ||
clipboardError | ||
}; | ||
|
||
static TCHAR* errorMessages[] = { | ||
_T("Error opening file"), | ||
_T("CryptAcquireContext failed"), | ||
_T("CryptCreateHash failed"), | ||
_T("CryptHashData failed"), | ||
_T("Couldn't read file"), | ||
_T("Clipboard error"), | ||
}; | ||
#endif //MD5_HASH_TOOL_TEXT_CONSTS_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// | ||
// Created by Roman on 6/3/2023. | ||
// | ||
|
||
#include <tchar.h> | ||
#include <stdio.h> | ||
#include "error_handler.h" | ||
|
||
void handleError(struct ERROR_INFO errorInfo) { | ||
|
||
UINT style = MB_OK | MB_ICONERROR; | ||
|
||
TCHAR errorBuff[256] = {0}; | ||
TCHAR statusCodeBuff[5] = {0}; | ||
|
||
_stprintf(statusCodeBuff, "%ld", errorInfo.statusCode); | ||
_tcscpy(errorBuff, errorInfo.failedAction); | ||
_tcscat(errorBuff, ", statusCode: "); | ||
_tcscat(errorBuff, statusCodeBuff); | ||
|
||
MessageBox(NULL, errorBuff, "Error", style); | ||
} | ||
|
||
void initErrorStruct(TCHAR *failedAction, DWORD statusCode) { | ||
struct ERROR_INFO errorInfo = {_T(""),1}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// | ||
// Created by Roman on 6/3/2023. | ||
// | ||
|
||
#ifndef MD5_HASH_TOOL_ERROR_HANDLER_H | ||
#define MD5_HASH_TOOL_ERROR_HANDLER_H | ||
|
||
#include <windows.h> | ||
#include "../global/globalVars.h" | ||
|
||
|
||
void initErrorStruct(TCHAR *failedAction, DWORD statusCode); | ||
|
||
/** | ||
* Handle status error and show the appropriate error to user | ||
* @param status | ||
*/ | ||
void handleError(struct ERROR_INFO errorInfo); | ||
|
||
#endif //MD5_HASH_TOOL_ERROR_HANDLER_H |
Oops, something went wrong.