Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Visual Studio.NET / Extensibility / November 2006

Tip: Looking for answers? Try searching our database.

locate file position of current edited file?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Khamis Abuelkomboz - 19 Nov 2006 13:25 GMT
Hi

I'm writing a simple addin that should open a file and go to a specific file position, as example
foo.cpp:20.5

I figured out how to open the file using DTE.Documents.Open, but did not figure out, how to go to
the line and column number.

Can somebody please give me a notice, how can do this for the active document?

As I know from a vb6.0 addin, I had to get to a CodePane object of the document to set current
position. Maybe I'm missing the way from a IDocument to ICodePane?

Thanks
Khamis
Khamis Abuelkomboz - 19 Nov 2006 13:52 GMT
> Hi
>
[quoted text clipped - 13 lines]
> Thanks
> Khamis

thanks, found the way of casting:

            EnvDTE.Documents docs = _applicationObject.Documents;
            EnvDTE.Document doc;
            doc = docs.Open(sFile, "Auto", false);
            TextSelection sel = (TextSelection)doc.Selection;
            sel.GotoLine(10, false);
            sel.CharRight(false, 10);

khamis
Signature

Try Code-Navigator on http://www.codenav.com
a source code navigating, analysis and developing tool.
It supports following languages:
    * C/C++
    * Java
    * .NET (including CSharp, VB.Net and other .NET components)
    * Classic Visual Basic
    * PHP, HTML, XML, ASP, CSS
    * Tcl/Tk,
    * Perl
    * Python
    * SQL,
    * m4 Preprocessor
    * Cobol


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.