The following mwe is basically extracted from this example. The full example compiles and works fine, however my mwe does not compile with Visual Studio 2013 and I don't see why not.
#include <dwrite_2.h>
#include <atlbase.h>
using namespace std;
void main()
{
IDWriteFactory2* m_spdwriteFactory;
DWriteCreateFactory(
DWRITE_FACTORY_TYPE_SHARED,
__uuidof( IDWriteFactory2 ),
&( m_spdwriteFactory )
);
}
The error message reads:
------ Build started: Project: Test, Configuration: Debug x64 ------
1> Source.cpp
1>Source.cpp(16): error C2664: 'HRESULT DWriteCreateFactory(DWRITE_FACTORY_TYPE,const IID &,IUnknown **)' : cannot convert argument 3 from 'IDWriteFactory2 **' to 'IUnknown **'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========