Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. DT_CALCRECT with DT_WORDBREAK

DT_CALCRECT with DT_WORDBREAK

Scheduled Pinned Locked Moved C / C++ / MFC
help
6 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • _ Offline
    _ Offline
    _T No name
    wrote on last edited by
    #1

    CRect rText( 0, 0, 0, 0 ); pDC->;DrawText( str, rText, DT_CENTER |DT_CALCRECT |DT_WORDBREAK); szText = rText.Size(); in rText i dnt get values at all they ramain same as 0 0 0 0 ny body help thankz

    CPalliniC C 2 Replies Last reply
    0
    • _ _T No name

      CRect rText( 0, 0, 0, 0 ); pDC->;DrawText( str, rText, DT_CENTER |DT_CALCRECT |DT_WORDBREAK); szText = rText.Size(); in rText i dnt get values at all they ramain same as 0 0 0 0 ny body help thankz

      CPalliniC Offline
      CPalliniC Offline
      CPallini
      wrote on last edited by
      #2

      (I hope str is not empty...:rolleyes:)

      _T("No name") wrote:

      pDC->;DrawText( str, rText, DT_CENTER |DT_CALCRECT |DT_WORDBREAK);

      Shouldn't be

      pDC->DrawText( str, **&**rText, DT_CENTER |DT_CALCRECT |DT_WORDBREAK);

      ?

      If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
      This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
      [My articles]

      In testa che avete, signor di Ceprano?

      _ 1 Reply Last reply
      0
      • CPalliniC CPallini

        (I hope str is not empty...:rolleyes:)

        _T("No name") wrote:

        pDC->;DrawText( str, rText, DT_CENTER |DT_CALCRECT |DT_WORDBREAK);

        Shouldn't be

        pDC->DrawText( str, **&**rText, DT_CENTER |DT_CALCRECT |DT_WORDBREAK);

        ?

        If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
        This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
        [My articles]

        _ Offline
        _ Offline
        _T No name
        wrote on last edited by
        #3

        no that i have checked already string is nt empty

        CPalliniC 1 Reply Last reply
        0
        • _ _T No name

          no that i have checked already string is nt empty

          CPalliniC Offline
          CPalliniC Offline
          CPallini
          wrote on last edited by
          #4

          Have you added the address of operator to your function call? :)

          If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
          This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
          [My articles]

          In testa che avete, signor di Ceprano?

          1 Reply Last reply
          0
          • _ _T No name

            CRect rText( 0, 0, 0, 0 ); pDC->;DrawText( str, rText, DT_CENTER |DT_CALCRECT |DT_WORDBREAK); szText = rText.Size(); in rText i dnt get values at all they ramain same as 0 0 0 0 ny body help thankz

            C Offline
            C Offline
            Code o mat
            wrote on last edited by
            #5

            Isn't the problem that you are telling DrawText to break the lines with DT_WORDBREAK and you specify an empty rectangle, so how can DrawText know where to break the lines if it does not know the original width?

            > The problem with computers is that they do what you tell them to do and not what you want them to do. < > Life: great graphics, but the gameplay sux. <

            _ 1 Reply Last reply
            0
            • C Code o mat

              Isn't the problem that you are telling DrawText to break the lines with DT_WORDBREAK and you specify an empty rectangle, so how can DrawText know where to break the lines if it does not know the original width?

              > The problem with computers is that they do what you tell them to do and not what you want them to do. < > Life: great graphics, but the gameplay sux. <

              _ Offline
              _ Offline
              _T No name
              wrote on last edited by
              #6

              thanks it helped :)

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups