locked
Access Violation Using DirectWrite API

    Question

  • I am using the DirectWrite API and I am implementing my own layout and text rendering engine. I have already created my IDWriteTextLayout object successfully. When I make the following call I receive an Access Violation error and I have no idea why:

    DWRITE_LINE_METRICS m_lineMetrics;
    UINT32 m_lineCount;
    
    DX::ThrowIfFailed(
       m_textLayout->GetLineMetrics(&m_lineMetrics,31,&m_lineCount)
        );

    Any Help is appreciated.

    Thanks,

    James Pack


    James Mason Pack

    Sunday, March 10, 2013 11:25 PM

Answers

  • I figured it out. I was reading the documentation for the function wrong I guess. You can pass either a pointer to a  single DWRITE_LINE_METRICS structure or an array of DWRITE_LINE_METRICS structures.

    James Mason Pack

    • Marked as answer by James Pack Monday, March 11, 2013 12:12 AM
    Monday, March 11, 2013 12:11 AM

All replies

  • I figured it out. I was reading the documentation for the function wrong I guess. You can pass either a pointer to a  single DWRITE_LINE_METRICS structure or an array of DWRITE_LINE_METRICS structures.

    James Mason Pack

    • Marked as answer by James Pack Monday, March 11, 2013 12:12 AM
    Monday, March 11, 2013 12:11 AM
  • Thanks for sharing the solution.

    Best regards,
    Jesse


    Jesse Jiang
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, March 11, 2013 3:22 AM