Hi everyone,
I'm using the Extensibility Addin Project type to create a new add-in project. I have added a simple User Control (just a button).
I've used the new EnvDTE80 (DTE2) objects to create a new Tool Window with my button. The relevant code is below:
windowToolWindow = (((EnvDTE80.Windows2)(applicationObject.Windows)).CreateToolWindow2(addInInstance, "C:\\Documents and Settings\\palleb.EU\\My Documents\\Visual Studio\\Projects\\AddinTOOLB\\AddinTOOLB\\bin\\AddinTOOLB.dll", "AddinTOOLB.Control", "C# Tool window", guidstr, ref objTemp));
windowToolWindow.Visible = true;
The first call is successful in creating a new window but I get the following error when I examine the window object and obviously the second line of code gives me an exception.
Any ideas Thanks!
****************************************************************
- windowToolWindow {System.__ComObject} EnvDTE.Window {System.__ComObject}
+ [System.__ComObject] {System.__ComObject} System.__ComObject
AutoHides false bool
Caption "C# Tool window" string
+ Collection {System.__ComObject} EnvDTE.Windows {System.__ComObject}
+ ContextAttributes 'windowToolWindow.ContextAttributes' threw an exception of type 'System.Runtime.InteropServices.COMException' EnvDTE.ContextAttributes {System.Runtime.InteropServices.COMException}
Document null EnvDTE.Document
+ DTE {System.__ComObject} EnvDTE.DTE {System.__ComObject}
Height 100 int
HWnd 0 int
IsFloating false bool
Kind "Tool" string
Left 86 int
Linkable true bool
LinkedWindowFrame null EnvDTE.Window
LinkedWindows null EnvDTE.LinkedWindows
+ Object {ControlAxSourcingSite [AddinTOOLB.Control]} object {AddinTOOLB.Control}
ObjectKind "{858C3FCD-8B39-4540-A592-F31C1520B174}" string
Project null EnvDTE.Project
ProjectItem null EnvDTE.ProjectItem
Selection null object
Top 112 int
Type vsWindowTypeToolWindow EnvDTE.vsWindowType
Visible false bool
Width 200 int
+ WindowState 'windowToolWindow.WindowState' threw an exception of type 'System.Runtime.InteropServices.COMException' EnvDTE.vsWindowState {System.Runtime.InteropServices.COMException}
****************************************************************
- WindowState 'windowToolWindow.WindowState' threw an exception of type 'System.Runtime.InteropServices.COMException' EnvDTE.vsWindowState {System.Runtime.InteropServices.COMException}
- base {"Error HRESULT E_FAIL has been returned from a call to a COM component."} System.Runtime.InteropServices.ExternalException {System.Runtime.InteropServices.COMException}
+ base {"Error HRESULT E_FAIL has been returned from a call to a COM component."} System.SystemException {System.Runtime.InteropServices.COMException}
ErrorCode -2147467259 int
************************************************************************
- ContextAttributes 'windowToolWindow.ContextAttributes' threw an exception of type 'System.Runtime.InteropServices.COMException' EnvDTE.ContextAttributes {System.Runtime.InteropServices.COMException}
- base {"Exception from HRESULT: 0x80043F02"} System.Runtime.InteropServices.ExternalException {System.Runtime.InteropServices.COMException}
- base {"Exception from HRESULT: 0x80043F02"} System.SystemException {System.Runtime.InteropServices.COMException}
- base {"Exception from HRESULT: 0x80043F02"} System.Exception {System.Runtime.InteropServices.COMException}
+ Data {System.Collections.ListDictionaryInternal} System.Collections.IDictionary {System.Collections.ListDictionaryInternal}
HelpLink null string
+ InnerException null System.Exception
Message "Exception from HRESULT: 0x80043F02" string
Source "EnvDTE" string
StackTrace " at EnvDTE.Window.get_ContextAttributes()" string
+ TargetSite {EnvDTE.ContextAttributes get_ContextAttributes()} System.Reflection.MethodBase {System.Reflection.RuntimeMethodInfo}
- Static members
- Non-Public members
_COMPlusExceptionCode -532459699 int
- Non-Public members
+ [System.Runtime.InteropServices.COMException] {"Exception from HRESULT: 0x80043F02"} System.Runtime.InteropServices.COMException
_className null string
+ _data {System.Collections.ListDictionaryInternal} System.Collections.IDictionary {System.Collections.ListDictionaryInternal}
_dynamicMethods null object
+ _exceptionMethod {EnvDTE.ContextAttributes get_ContextAttributes()} System.Reflection.MethodBase {System.Reflection.RuntimeMethodInfo}
_exceptionMethodString null string
_helpURL null string
_HResult -2147205374 int
_innerException null System.Exception
_message "Exception from HRESULT: 0x80043F02" string
_remoteStackIndex 0 int
_remoteStackTraceString null string
_source "EnvDTE" string
+ _stackTrace {Dimensions:[16]} object {sbyte[]}
_stackTraceString null string
_xcode -532459699 int
_xptrs 0 System.IntPtr
HResult -2147205374 int
IsTransient false bool
ErrorCode -2147205374 int
***********************************************************************

Using VSTS Beta 2 - Strange error COM+ in Add-in
Eugene Osovetsky
Thanks,
Kenneth Lewis
paulballard
http://forums.microsoft.com/msdn/ShowForum.aspx ForumID=20
and
http://forums.microsoft.com/msdn/ShowForum.aspx ForumID=22