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 / January 2006

Tip: Looking for answers? Try searching our database.

Editor samples

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
GregL - 29 Nov 2004 21:59 GMT
If I run the C++ unmanaged basic editor sample (bscedt), I get a document
window with just a rich edit control. However, when I run the managed C#
Basic Editor sample, I get the left margin with bookmarks enabled in addition
to the edit control.

Why is the margin visible in the managed sample, but no the unmanaged? Thanks.

Greg
"Ed Dore [MSFT]" - 02 Dec 2004 23:02 GMT
Hi Greg,

I don't see bookmarks supported in either of these samples. Neither hosts
the core VS editor. They are both pretty different implementation wise. The
C++ BscEdt sample actually implements the editor as an activex control.
Whereas the C# sample actually implements a UserControl derived object that
hosts a simple textbox control.

Both of these are legitimate samples, but neither actually illustrates how
to host the core VS editor. To do that you need to create an instance of
the COM creatable VsCodeWindow object, and wire it to a COM creatable
VsTextBuffer. You can to this in both VC++ and C#, but in the C# scenario
you'll have to parent the HWND of the VsCodeWindow directly to your editor
pane by PInvoking the SetParent API in USER32.DLL.

Sincerely,
Ed Dore [MSFT]

This post is 'AS IS' with no warranties and confers no rights.
Brian - 13 Jan 2006 18:05 GMT
> Both of these are legitimate samples, but neither actually illustrates how
> to host the core VS editor. To do that you need to create an instance of
> the COM creatable VsCodeWindow object, and wire it to a COM creatable
> VsTextBuffer. You can to this in both VC++ and C#, but in the C# scenario
> you'll have to parent the HWND of the VsCodeWindow directly to your editor
> pane by PInvoking the SetParent API in USER32.DLL.

I'm interested in this, too.  However, I can't find any references to
VsTextBuffer or VsCodeWindow in the VS 2005 documentation.  Where can one
find information about them?

Basically, I'm wanting to create an add-in that will create a simple,
blank document without any dialog intervention.  This would be identical
to the way VC++ 6.0 editor's "New Text File" toolbar button operates.  
Would using these interfaces (VsTextBuffer and VsCodeWindow) be the way to
do that?  If not, is there a method somewhere that just opens a new,
blank, no questions asked, text window.

Thanks,
Brian
"Ed Dore [MSFT]" - 13 Jan 2006 18:36 GMT
Hi Brian,

Those components are actually documented in the Visual Studio SDK, and are
typically utilized when building a new editor to support a new language or
sourcefile type. You can download the Visual Studio SDK from:
https://affiliate.vsipmembers.com/.

If you're just looking to create a toolbar button that will create a new
textfile, you can do this via a macro or an addin by way of the
DTE.ItemOperations.NewFile function. Specifically:

  DTE.ItemOperations.NewFile("General\Text File")

Sincerely,
Ed Dore [MSFT]

This post is 'AS IS' with no warranties, and confers no rights.

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.