-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathMessage.c
52 lines (42 loc) · 883 Bytes
/
Message.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/*
* CLCL
*
* Message.c
*
* Copyright (C) 1996-2019 by Ohno Tomoaki. All rights reserved.
* https://www.nakka.com/
*/
/* Include Files */
#define _INC_OLE
#include <windows.h>
#undef _INC_OLE
#include "General.h"
#include "Memory.h"
#include "String.h"
/* Define */
/* Global Variables */
extern HINSTANCE hInst;
/* Local Function Prototypes */
/*
* message_get_error - エラー値からメッセージを取得
*/
BOOL message_get_error(const int err_code, TCHAR *err_str)
{
if (err_str == NULL) {
return FALSE;
}
*err_str = TEXT('\0');
FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, err_code, 0, err_str, BUF_SIZE - 1, NULL);
return TRUE;
}
/*
* message_get_res - リソースからメッセージを取得
*/
TCHAR *message_get_res(const UINT id)
{
static TCHAR buf[BUF_SIZE];
LoadString(hInst, id, buf, BUF_SIZE - 1);
return buf;
}
/* End of source */