我想检索DirectX 9的错误字符串,但我可以在网上找到使用FormatMessage()和_com_error.ErrorMessage(),这两个都让我失望.
hr = g_pd3dDevice->GetRenderTargetData(...
... // the debugger tells me hr = 0x8876086c
FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |
FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
NULL, hr, 0, (LPTSTR)&lpBuf, 0, NULL))
// it returns 0 with lpBuf unallocated
Run Code Online (Sandbox Code Playgroud)
FormatMessage()失败,我再次使用GetLastError()来查看FormatMessage()失败的原因:"系统无法在%2的消息文件中找到消息号0x%1的消息文本."
_com_error.ErrorMessage()告诉我"未知错误0x8876086c"
我正在可视化带有graphviz的sddp的图形。但是边缘覆盖了该节点,这很烦人。我将此属性[outputorder = edgesfirst]添加到了图形中,但它似乎不起作用。
输出:

资源:
digraph G {
graph [overlap=false][outputorder=edgesfirst];
0;
1;
2;
3;
.....
330;
331;
0->18 [color=red];
0->325 [style=invis];
2->3 [dir=none];
.....
331->330 [color=red];
}
Run Code Online (Sandbox Code Playgroud)