Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CDocument: go to a line

Status
Not open for further replies.

akyewa

Programmer
Jul 22, 2004
4
ES
Hello!!

I have a CDocument and I need to go to a line (I mean, put the cursor at the line), does anyone knows how can I do this? (I have the number of the line)

Thanks a lot!! Ana

 
int nPos = GetView()->GetRichEditCtrl().LineIndex(Line_Number - 1);
GetView()->GetRichEditCtrl().SetSel(nPos, nPos); //Only cursor without chars selection
 

Thanks!!

I think that code works on the CRichEditDoc class, but I have a CDocument class. I have tried to change my code to use CRichEditDoc instead of CDocument (by adding a view class and a cntr class) but then, when I execute the application, when I try to open a new document, the application crash in "OLELINK.CPP, in the line COleDocument::OnOpenDocument"

how can I solve this problem?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top