我正面临一个我正在自杀的问题。我有以下代码:
ComPtr<IDWriteFactory> factory;
DWriteCreateFactory(DWRITE_FACTORY_TYPE_SHARED, __uuidof(IDWriteFactory), factory.GetAddressOf();
ComPtr<IDWriteTextFormat> textFormat;
factory->CreateTextFormat(L"Arial", nullptr, DWRITE_FONT_WEIGHT_NORMAL,
DWRITE_FONT_STYLE_NORMAL, DWRITE_FONT_STRETCH_NORMAL, 20.0f, nullptr,
textFormat.GetAddressOf());
最后一行 textFormat 指向 null 之后。CreateTextFormat() 返回值 E_INVALIDARG。我肯定安装了Arial,根据MSDN,这两个nullptr参数是允许的,所以我看不出什么是无效的。任何人都可以对此有所了解吗?