回答編集履歴
1
訂正
test
CHANGED
@@ -43,3 +43,39 @@
|
|
43
43
|
|
44
44
|
|
45
45
|
こんな感じ
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
---
|
50
|
+
|
51
|
+
|
52
|
+
|
53
|
+
`FORMAT_MESSAGE_ALLOCATE_BUFFER`を使わない場合
|
54
|
+
|
55
|
+
|
56
|
+
|
57
|
+
```c++
|
58
|
+
|
59
|
+
CHAR msg[1000];
|
60
|
+
|
61
|
+
if(FormatMessageA(
|
62
|
+
|
63
|
+
FORMAT_MESSAGE_FROM_SYSTEM |
|
64
|
+
|
65
|
+
FORMAT_MESSAGE_IGNORE_INSERTS,
|
66
|
+
|
67
|
+
NULL,
|
68
|
+
|
69
|
+
last_error,
|
70
|
+
|
71
|
+
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
|
72
|
+
|
73
|
+
msg,
|
74
|
+
|
75
|
+
sizeof(msg), NULL )) puts(msg);
|
76
|
+
|
77
|
+
else
|
78
|
+
|
79
|
+
puts("エラーメッセージの取得に失敗しました。");
|
80
|
+
|
81
|
+
```
|