keyongtech


  keyongtech > vstudio.* > vstudio.extensibility > 10/2007

 #1  
10-03-07, 08:51 PM
Roman Petrenko
Hello all,

I'm trying to understand how to write packages and I found the sample how to
create your own editor and implemented IVsEditorFactory following way:
===cut===
// Instantiate a code window of type IVsCodeWindow.
Guid clsidCodeWindow = typeof(VsCodeWindowClass).GUID;
Guid iidCodeWindow = typeof(IVsCodeWindow).GUID;
IVsCodeWindow pCodeWindow =
(IVsCodeWindow)this.parentPackage.CreateInstance(r ef clsidCodeWindow, ref
iidCodeWindow, typeof(IVsCodeWindow));
if (pCodeWindow != null)
{
// Give the text buffer to the code window.
// We are giving up ownership of the text buffer!
pCodeWindow.SetBuffer((IVsTextLines)pTextBuffer);
// Now tell the caller about all this new stuff
// that has been created.
ppunkDocView = Marshal.GetIUnknownForObject(pCodeWindow);
ppunkDocData = Marshal.GetIUnknownForObject(pTextBuffer);
// Specify the command UI to use so keypresses are
// automatically dealt with.
pguidCmdUI = VSConstants.GUID_TextEditorFactory;
// This caption is appended to the filename and
// lets us know our invocation of the core editor
// is up and running.
pbstrEditorCaption = " [MyPackage]";
retval = VSConstants.S_OK;
}
}
return retval;
===end of cut===
This code creates for me standard core editor, but I'd like to open file in
HTML editor. I was trying to find something like IVsHTMLWindow and
VsHtmlWindowClass but unsuccessfully.

Can anyone help me with creation of my own HTML based editor?

Thanks in advance,
Roman Petrenko
 #2  
10-04-07, 04:22 PM
Justin Chase
On Oct 3, 2:51 pm, "Roman Petrenko" <romanpetre> wrote:
[..]
> return retval;
> ===end of cut===
> This code creates for me standard core editor, but I'd like to open file in
> HTML editor. I was trying to find something like IVsHTMLWindow and
> VsHtmlWindowClass but unsuccessfully.
>
> Can anyone help me with creation of my own HTML based editor?
>
> Thanks in advance,
> Roman Petrenko


Well I believe that you end up with the same interface but the key is
the Guid. Each window type has it's own Guid and you should be able to
specify which editor you want if you can get the right guid. Try
digging through the registry at [HKEY_LOCAL_MACHINE\Software\Microsoft
\VisualStudio\9.0\Editors] they usually have some helpful names that
will help you figure out what is what. I only have vs2005 on my
machine but the editor with the guid {4D30FDB3-AB3E-4810-
B6F2-64627BCCA384} seems pretty promising.
 #3  
10-05-07, 02:05 AM
Roman Petrenko
Hello,
It sad to say but your surmise doesn't work since class
4D30FDB3-AB3E-4810-B6F2-64627BCCA384 is not registered as many other guids
you can find under Editors key in registry. As far as I understand it should
be one of the classes from ...VisualStudio\8.0\CLSID but how to get correct
one :(

Still waiting for the help,
Roman Petrenko
"Justin Chase" <justncase80> wrote in message
news:9050
[..]
 #4  
10-05-07, 04:33 PM
Justin Chase
On Oct 4, 8:05 pm, "Roman Petrenko" <romanpetre> wrote:
[..]
>>
>>
>>

> - Show quoted text -


Just try looking through all of the editors under that key. They have
plain text names that should allow you to figure out their meaning. :-D
Similar Threads
The reuse of keywords in the C++ standard

Posted here because comp.std.c++ seems to have died an unexpected death. ------- I note with some dismay the proposal to create a new meaning for the C and C++ keyword...

Issue with CMS HTML Editor and Editor Toolbar

Hello, I have a couple of problems with CMS HTML Editor on a CMS 2002 system we use for user acceptance testing. First problem is when I try to edit a page on the site, I am...

HTML Reuse for Web Pages

Hi, I suspect this question has been asked before, but I couldnt find anything specific when I did search. I a using Visual Studio 2003, and .NET 1.1. My problem is in...

how do I force a new mailitem to use the HTML editor but not the WORD editor?

I am using the following code. When outlook opens the message and the Outlook HTML editor is the default editor, there is no problem. If Word is the default editor,...

How to reuse standard C code in a CF c# solution ?

Some ways to reuse C code i tried are not supported when programming for CF


All times are GMT. The time now is 06:31 AM. | Privacy Policy