<div>That &quot;dir&quot; error is a known problem with beta 3 -- and as you might imagine, sky-high in priority on our list of things to fix for beta 4.</div>
<div>&nbsp;</div>
<div>Viewlets appear to be user controls; you probably need to host one in a Form.<br><br></div>
<div class="gmail_quote">On Fri, Jun 27, 2008 at 6:45 AM, Michael Foord &lt;<a href="mailto:fuzzyman@voidspace.org.uk">fuzzyman@voidspace.org.uk</a>&gt; wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div class="Ih2E3d">Curt Hagenlocher wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">A bit of quality time with Reflector shows that there&#39;s a _viewletsProxy object which hasn&#39;t been initialized. &nbsp;You probably need to call VSLabFSICore.Viewlets.Init() first. &nbsp;It&#39;s static, and in the vslabfsicore module.<br>
</blockquote><br></div>Thanks Curt - your reflector-fu is greater than mine. I should spend some quality time with it.<br><br>Your advice gets me to the next step, I can make a GraphControl flash momentarily into view (on creation), but attempting to show it causes another explosion: 
<div class="Ih2E3d"><br><br>C:\compile\VSLab&gt;C:\compile\IronPython-2.0B3\ipy.exe -X:ExceptionDetail viewlet.<br>py<br></div>Operation unavailable (Exception from HRESULT: 0x800401E3 (MK_E_UNAVAILABLE))<br>&nbsp;at System.Runtime.InteropServices.Marshal.GetActiveObject(Guid&amp; rclsid, IntPt<br>
r reserved, Object&amp; ppunk)<br>&nbsp;at System.Runtime.InteropServices.Marshal.GetActiveObject(String progID)<br>&nbsp;at VSLabFSICore.Viewlet.Show()<br>&nbsp;at GraphViewlet.GraphControl.Show()<br>&nbsp;at _stub_$28##26(Closure , CallSite , CodeContext , Object ) 
<div class="Ih2E3d"><br>&nbsp;at _stub_MatchCaller(Object , CallSite , Object[] )<br>&nbsp;at Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args)<br>&nbsp;at Microsoft.Scripting.Actions.UpdateDelegates.Update2[T,T0,T1,TRet](CallSite<br>
site, T0 arg0, T1 arg1)<br>&nbsp;at S$2.Initialize(CodeContext )<br>&nbsp;at IronPython.Hosting.PythonCommandLine.RunFileWorker(String fileName)<br>&nbsp;at IronPython.Hosting.PythonCommandLine.RunFile(String fileName)<br></div>EnvironmentError: Operation unavailable (Exception from HRESULT: 0x800401E3 (MK_<br>
E_UNAVAILABLE))<br><br>The code that produces this is: 
<div class="Ih2E3d"><br><br>import clr<br>clr.AddReference(&#39;vslabfsicore&#39;)<br>clr.AddReference(&#39;vslabviewlets&#39;)<br><br></div>from VSLabFSICore import Viewlets<br>from GraphViewlet import GraphControl<br><br>
Viewlets.Init()<br>g = GraphControl()<br>g.Show()<br><br>If instead of &#39;g.Show()&#39; I attempt &#39;dir(g)&#39; I get a very odd error! 
<div class="Ih2E3d"><br><br>C:\compile\VSLab&gt;C:\compile\IronPython-2.0B3\ipy.exe -X:ExceptionDetail viewlet.<br>py<br></div>&#39;this&#39; type cannot be an interface itself.<br>&nbsp;at System.RuntimeTypeHandle.GetFirstSlotForInterface(IntPtr interfaceHandle)<br>
&nbsp;at System.RuntimeType.GetInterfaceMap(Type ifaceType)<br>&nbsp;at Microsoft.Scripting.Generation.CompilerHelpers.TryGetCallableMethod(Method<br>Info method)<br>&nbsp;at Microsoft.Scripting.Generation.CompilerHelpers.FilterNonVisibleMembers(Typ<br>
e type, MemberInfo[] foundMembers)<br>&nbsp;at IronPython.Runtime.Types.TypeInfo.MemberBinder.GetMember(Type type, String<br>name, BindingFlags flags)<br>&nbsp;at IronPython.Runtime.Types.TypeInfo.StandardResolver.ResolveMember(MemberBin<br>
der binder, DynamicAction action, Type type, String name)<br>&nbsp;at IronPython.Runtime.Types.TypeInfo.MemberResolver.ResolveMembers(MemberBind<br>er binder, DynamicAction action, Type type)<br>&nbsp;at IronPython.Runtime.Types.TypeInfo.GetResolvedMembers(MemberBinder memberBi<br>
nder, DynamicAction action, Type type)<br>&nbsp;at IronPython.Runtime.Calls.PythonBinder.ResolveMemberNames(CodeContext conte<br>xt, PythonType type, PythonType owner, Dictionary`2 memberNames)<br>&nbsp;at IronPython.Runtime.Types.PythonType.GetMemberNames(CodeContext context, Ob<br>
ject self)<br>&nbsp;at IronPython.Runtime.Operations.PythonOps.GetAttrNames(CodeContext context,<br>Object o)<br>&nbsp;at IronPython.Runtime.Builtin.dir(CodeContext context, Object o)<br>&nbsp;at _stub_$26##24(Closure , CallSite , CodeContext , Object , Object ) 
<div class="Ih2E3d"><br>&nbsp;at _stub_MatchCaller(Object , CallSite , Object[] )<br>&nbsp;at Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args)<br></div>&nbsp;at Microsoft.Scripting.Actions.UpdateDelegates.Update3[T,T0,T1,T2,TRet](CallS<br>
ite site, T0 arg0, T1 arg1, T2 arg2) 
<div class="Ih2E3d"><br>&nbsp;at S$2.Initialize(CodeContext )<br>&nbsp;at IronPython.Hosting.PythonCommandLine.RunFileWorker(String fileName)<br>&nbsp;at IronPython.Hosting.PythonCommandLine.RunFile(String fileName)<br></div>ValueError: &#39;this&#39; type cannot be an interface itself.<br>
<br><br>Incidentally, even when installed with VS Pro I can&#39;t get VSLab to work *anyway* (this is Vista 64bit FWIW), so the code may not be ready for prime time.<br><br>I may try firing up reflector myself and see where it takes me.<br>
<br>Michael Foord<br><br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div>
<div></div>
<div class="Wj3C7c"><br>On Thu, Jun 26, 2008 at 2:58 PM, Michael Foord &lt;<a href="mailto:fuzzyman@voidspace.org.uk" target="_blank">fuzzyman@voidspace.org.uk</a> &lt;mailto:<a href="mailto:fuzzyman@voidspace.org.uk" target="_blank">fuzzyman@voidspace.org.uk</a>&gt;&gt; wrote:<br>
<br>&nbsp; &nbsp;The viewlets that come with VSLab look *really* cool. They&#39;re<br>&nbsp; &nbsp;based on F# so I decided to see if they could be used from IronPython.<br><br>&nbsp; &nbsp;<a href="http://www.codeplex.com/vslab" target="_blank">http://www.codeplex.com/vslab</a><br>
<br>&nbsp; &nbsp;The dependencies are pretty hefty. You need F# installed *and*<br>&nbsp; &nbsp;Managed DirectX (June 2008 SDK ~450mb seems to fulfil the dependency).<br><br>&nbsp; &nbsp;To get at the viewlet assemblies you need Visual Studio Pro<br>&nbsp; &nbsp;installed as well, but they can be extracted from the VSLabs msi<br>
&nbsp; &nbsp;installer without VS Pro.<br><br>&nbsp; &nbsp;Ok, so with all the dependencies installed I attempt to use them -<br>&nbsp; &nbsp;and *boom*. Anyone here got any ideas?<br><br>&nbsp; &nbsp;IronPython 2.0 Beta (2.0.0.3000) on .NET 2.0.50727.1434<br>&nbsp; &nbsp;Copyright (c) Microsoft Corporation. All rights reserved.<br>
&nbsp; &nbsp;&gt;&gt;&gt; import clr<br>&nbsp; &nbsp;&gt;&gt;&gt; clr.AddReference(&#39;vslabfsicore&#39;)<br>&nbsp; &nbsp;&gt;&gt;&gt; clr.AddReference(&#39;vslabviewlets&#39;)<br>&nbsp; &nbsp;&gt;&gt;&gt; clr.AddReference(&#39;vslabcore&#39;)<br>&nbsp; &nbsp;&gt;&gt;&gt; from GraphViewlet import GraphControl<br>
&nbsp; &nbsp;&gt;&gt;&gt; g = GraphControl()<br>&nbsp; &nbsp;Traceback (most recent call last):<br>&nbsp; &nbsp; File &quot;&lt;stdin&gt;&quot;, line 1, in &lt;module&gt;<br>&nbsp; &nbsp; File &quot;vslabviewlets&quot;, line unknown, in .ctor<br>&nbsp; &nbsp; File &quot;vslabfsicore&quot;, line unknown, in .ctor<br>
&nbsp; &nbsp; File &quot;System.Windows.Forms&quot;, line unknown, in get_Controls<br>&nbsp; &nbsp; File &quot;System.Windows.Forms&quot;, line unknown, in get_Properties<br>&nbsp; &nbsp;SystemError: Object reference not set to an instance of an object.<br>
<br><br>&nbsp; &nbsp;Interesting that the explosion is inside winforms. Referencing<br>&nbsp; &nbsp;that assembly first makes knows difference.<br><br>&nbsp; &nbsp;Michael Foord<br><br><br>&nbsp; &nbsp;-- &nbsp; &nbsp;<a href="http://www.ironpythoninaction.com/" target="_blank">http://www.ironpythoninaction.com/</a><br>
&nbsp; &nbsp;<a href="http://www.voidspace.org.uk/" target="_blank">http://www.voidspace.org.uk/</a><br>&nbsp; &nbsp;<a href="http://www.trypython.org/" target="_blank">http://www.trypython.org/</a><br>&nbsp; &nbsp;<a href="http://www.ironpython.info/" target="_blank">http://www.ironpython.info/</a><br>
&nbsp; &nbsp;<a href="http://www.theotherdelia.co.uk/" target="_blank">http://www.theotherdelia.co.uk/</a><br>&nbsp; &nbsp;<a href="http://www.resolverhacks.net/" target="_blank">http://www.resolverhacks.net/</a><br><br>&nbsp; &nbsp;_______________________________________________<br>
&nbsp; &nbsp;Users mailing list<br></div></div>&nbsp; &nbsp;<a href="mailto:Users@lists.ironpython.com" target="_blank">Users@lists.ironpython.com</a> &lt;mailto:<a href="mailto:Users@lists.ironpython.com" target="_blank">Users@lists.ironpython.com</a>&gt; 
<div class="Ih2E3d"><br>&nbsp; &nbsp;<a href="http://lists.ironpython.com/listinfo.cgi/users-ironpython.com" target="_blank">http://lists.ironpython.com/listinfo.cgi/users-ironpython.com</a><br><br><br></div>------------------------------------------------------------------------ 
<div class="Ih2E3d"><br><br>_______________________________________________<br>Users mailing list<br><a href="mailto:Users@lists.ironpython.com" target="_blank">Users@lists.ironpython.com</a><br><a href="http://lists.ironpython.com/listinfo.cgi/users-ironpython.com" target="_blank">http://lists.ironpython.com/listinfo.cgi/users-ironpython.com</a><br>
&nbsp;<br></div></blockquote>
<div>
<div></div>
<div class="Wj3C7c"><br><br>-- <br><a href="http://www.ironpythoninaction.com/" target="_blank">http://www.ironpythoninaction.com/</a><br><a href="http://www.voidspace.org.uk/" target="_blank">http://www.voidspace.org.uk/</a><br>
<a href="http://www.trypython.org/" target="_blank">http://www.trypython.org/</a><br><a href="http://www.ironpython.info/" target="_blank">http://www.ironpython.info/</a><br><a href="http://www.theotherdelia.co.uk/" target="_blank">http://www.theotherdelia.co.uk/</a><br>
<a href="http://www.resolverhacks.net/" target="_blank">http://www.resolverhacks.net/</a><br><br>_______________________________________________<br>Users mailing list<br><a href="mailto:Users@lists.ironpython.com" target="_blank">Users@lists.ironpython.com</a><br>
<a href="http://lists.ironpython.com/listinfo.cgi/users-ironpython.com" target="_blank">http://lists.ironpython.com/listinfo.cgi/users-ironpython.com</a><br></div></div></blockquote></div><br>