Automation sample ToolWindow Add-Ins (Automation Samples for Visual Studio NET 2002)

Automation sample ToolWindow Add-Ins (Automation Samples for Visual Studio NET 2002)

Post by c3RldmV » Sun, 18 Apr 2004 13:06:04


Dear Sirs or Madams

this Add-In sample works fine, but i have one problem
In the OnConnection Event of the AddIn (connect.cs) we get the DTE object (OnConnection(object application,...), then the Class VSUserControlHostLib.IVSUserControlHostCtl is created via CreateToolWindow (..) and this object creates and hosts the Usercontrol with the GUI and my code
How can I get the DTE application object in my Usercontrol code? The sample does not show this
Do I have to extend the HostUserControl function

Please for help
Thanks from Vienna, Austria, in advance
 
 
 

Automation sample ToolWindow Add-Ins (Automation Samples for Visual Studio NET 2002)

Post by Carlos J. » Tue, 20 Apr 2004 19:58:51

Hi,

In your addin code you have the DTE instance and you create the usercontrol
that will be hosted by the shim, so you can pass the DTE instance to the
usercontrol in the constructor or in another initialization function. Later,
you call HostUserControl method of the shim control to host the usercontrol.

Am I missing anything?

--

Carlos J. Quintero (Visual Developer - .NET MVP)

FAQs, Knowledge Base, Files, Docs, Articles, Utilities, etc. for .NET
addins:
http://www.yqcomputer.com/ (free join)



"steves" < XXXX@XXXXX.COM > escribien el mensaje
>> Dear Sirs or Madams, >> >> this Add-In sample works fine, but i have one problem: >> In the OnConnection Event of the AddIn (connect.cs) we get the DTE object
(OnConnection(object application,...), then the Class
VSUserControlHostLib.IVSUserControlHostCtl is created via CreateToolWindow
(..) and this object creates and hosts the Usercontrol with the GUI and my
code. >> How can I get the DTE application object in my Usercontrol code? The
sample does not show this. >> Do I have to extend the HostUserControl function? >> >> Please for help. >> Thanks from Vienna, Austria, in advance. >>

 
 
 

Automation sample ToolWindow Add-Ins (Automation Samples for Visual Studio NET 2002)

Post by c3RldmV » Wed, 21 Apr 2004 02:31:05

Dear Carlos

thanks for your answer
My problem was following: (Because of explaining it in the newsgroup, i found the solution
My UserControl is created by VSUserControlHostLib.IVSUserControlHostCtl (Com Object, written in C++) via Reflection:
objControl.HostUserControl(asm.Location, "Test.TestUserControl") with no possibility for parameters
I didnt know in the first place, that HostUserControl returns the created Usercontrol
After the creation, i can pass the DTE Object withhin a funtion
thank
Stepha



Hi

In your addin code you have the DTE instance and you create the usercontro
that will be hosted by the shim, so you can pass the DTE instance to th
usercontrol in the constructor or in another initialization function. Later
you call HostUserControl method of the shim control to host the usercontrol

Am I missing anything

--

Carlos J. Quintero (Visual Developer - .NET MVP

FAQs, Knowledge Base, Files, Docs, Articles, Utilities, etc. for .NE
addins
http://www.yqcomputer.com/ (free join



"steves" < XXXX@XXXXX.COM > escribi en el mensaj

> Dear Sirs or Madams
>> this Add-In sample works fine, but i have one problem
> In the OnConnection Event of the AddIn (connect.cs) we get the DTE objec
(OnConnection(object application,...), then the Clas
VSUserControlHostLib.IVSUserControlHostCtl is created via CreateToolWindo
(..) and this object creates and hosts the Usercontrol with the GUI and m
code
> How can I get the DTE application object in my Usercontrol code? Th
sample does not show this
> Do I have to extend the HostUserControl function
>> Please for help
> Thanks from Vienna, Austria, in advance
>
 
 
 

Automation sample ToolWindow Add-Ins (Automation Samples for Visual Studio NET 2002)

Post by Carlos J. » Wed, 21 Apr 2004 18:10:29

> My problem was following: (Because of explaining it in the newsgroup, i
found the solution)

It happens often :-)


--

Carlos J. Quintero (Visual Developer - .NET MVP)

FAQs, Knowledge Base, Files, Docs, Articles, Utilities, etc. for .NET
addins:
http://www.yqcomputer.com/ (free join)