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
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Find the line no. on which the cursor is present?

Find the line no. on which the cursor is present?

Scheduled Pinned Locked Moved C / C++ / MFC
questionc++tutorial
3 Posts 2 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.
  • S Offline
    S Offline
    SanjaySMK
    wrote on last edited by
    #1

    Hello, I am not able to find any function which will get me the line no. on which the cursor is present in RichEdit Control in MFC? How to get it? Is there any function to get it? If yes, then what is it? Thanks,

    Software Developer Sanjay Khapre

    J 1 Reply Last reply
    0
    • S SanjaySMK

      Hello, I am not able to find any function which will get me the line no. on which the cursor is present in RichEdit Control in MFC? How to get it? Is there any function to get it? If yes, then what is it? Thanks,

      Software Developer Sanjay Khapre

      J Offline
      J Offline
      jhwurmbach
      wrote on last edited by
      #2

      SanjaySMK wrote:

      line no. on which the cursor is present in RichEdit Control in MFC

      Hmm - never needed that. But does GetSel() followed by LineFromChar() work? -- modified at 7:58 Thursday 17th August, 2006 Just found it in the Doku for LineFromChar(): "If [the Parameter] nIndex is –1, it specifies the current line, that is, the line that contains the caret."


      "We trained hard, but it seemed that every time we were beginning to form up into teams we would be reorganised. I was to learn later in life that we tend to meet any new situation by reorganising: and a wonderful method it can be for creating the illusion of progress, while producing confusion, inefficiency and demoralisation." -- Caius Petronius, Roman Consul, 66 A.D.

      S 1 Reply Last reply
      0
      • J jhwurmbach

        SanjaySMK wrote:

        line no. on which the cursor is present in RichEdit Control in MFC

        Hmm - never needed that. But does GetSel() followed by LineFromChar() work? -- modified at 7:58 Thursday 17th August, 2006 Just found it in the Doku for LineFromChar(): "If [the Parameter] nIndex is –1, it specifies the current line, that is, the line that contains the caret."


        "We trained hard, but it seemed that every time we were beginning to form up into teams we would be reorganised. I was to learn later in life that we tend to meet any new situation by reorganising: and a wonderful method it can be for creating the illusion of progress, while producing confusion, inefficiency and demoralisation." -- Caius Petronius, Roman Consul, 66 A.D.

        S Offline
        S Offline
        SanjaySMK
        wrote on last edited by
        #3

        Thanks a lot jhwurmbach, I was trying so many things, but finally found your reply apt and exact. LineFromChar worked perfectly. Thanks a ton. Regards,

        Software Developer Sanjay Khapre

        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