I mean you need to run your program under the debugger to trap exactly where the error occurs, what the error is, and what variables, pointers etc. are possibly causing the fault. Without that information it is impossible to guess what may be going wrong.
As a warmup for a more complex project in C#, I have started to code a C++/CLI library to allow simple access of C# applications to features of DirectWrite. (I am aware that there are such helper libraries already out there but I was not able yet to get them to work with in Visual Studio 2015 and with Windows 10.)
So far so good. A first test run showed the text in the target window but not as I would have expected for ClearType display. A screenshot of the displayed text can be found here.
My understanding of the relating MSDN documentation is that ClearType is enabled by default. The title bar text of the window is obviously set up with text in ClearType. I guess I missed a setting in the DWrite factory but I do not know which.
Thank you for your response. You had indeed a good idea but I am afraid that this is not likely the reason:
You can see from the screenshot, the character 'g' is shown completely where other characters like the adjacent are not shown completely.
The text has been sent to DX as one single block, without the explicit specification of leading. I would assume then that DX selects a sufficient leading.
Meanwhile, I have made several more tests with my application but I have not found a way yet to improve the text display. However, I do not give up. ClearType works well on my computer; any application - except mine - is using it successfully.
I have collected my little test in a ZIP file which can be loaded from this location. I am currently using Windows 10 and Visual Studio Community 2015.