<div>That "dir" 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> </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 <<a href="mailto:fuzzyman@voidspace.org.uk">fuzzyman@voidspace.org.uk</a>> 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's a _viewletsProxy object which hasn't been initialized. You probably need to call VSLabFSICore.Viewlets.Init() first. It'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>C:\compile\IronPython-2.0B3\ipy.exe -X:ExceptionDetail viewlet.<br>py<br></div>Operation unavailable (Exception from HRESULT: 0x800401E3 (MK_E_UNAVAILABLE))<br> at System.Runtime.InteropServices.Marshal.GetActiveObject(Guid& rclsid, IntPt<br>
r reserved, Object& ppunk)<br> at System.Runtime.InteropServices.Marshal.GetActiveObject(String progID)<br> at VSLabFSICore.Viewlet.Show()<br> at GraphViewlet.GraphControl.Show()<br> at _stub_$28##26(Closure , CallSite , CodeContext , Object )
<div class="Ih2E3d"><br> at _stub_MatchCaller(Object , CallSite , Object[] )<br> at Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args)<br> at Microsoft.Scripting.Actions.UpdateDelegates.Update2[T,T0,T1,TRet](CallSite<br>
site, T0 arg0, T1 arg1)<br> at S$2.Initialize(CodeContext )<br> at IronPython.Hosting.PythonCommandLine.RunFileWorker(String fileName)<br> 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('vslabfsicore')<br>clr.AddReference('vslabviewlets')<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 'g.Show()' I attempt 'dir(g)' I get a very odd error!
<div class="Ih2E3d"><br><br>C:\compile\VSLab>C:\compile\IronPython-2.0B3\ipy.exe -X:ExceptionDetail viewlet.<br>py<br></div>'this' type cannot be an interface itself.<br> at System.RuntimeTypeHandle.GetFirstSlotForInterface(IntPtr interfaceHandle)<br>
at System.RuntimeType.GetInterfaceMap(Type ifaceType)<br> at Microsoft.Scripting.Generation.CompilerHelpers.TryGetCallableMethod(Method<br>Info method)<br> at Microsoft.Scripting.Generation.CompilerHelpers.FilterNonVisibleMembers(Typ<br>
e type, MemberInfo[] foundMembers)<br> at IronPython.Runtime.Types.TypeInfo.MemberBinder.GetMember(Type type, String<br>name, BindingFlags flags)<br> at IronPython.Runtime.Types.TypeInfo.StandardResolver.ResolveMember(MemberBin<br>
der binder, DynamicAction action, Type type, String name)<br> at IronPython.Runtime.Types.TypeInfo.MemberResolver.ResolveMembers(MemberBind<br>er binder, DynamicAction action, Type type)<br> at IronPython.Runtime.Types.TypeInfo.GetResolvedMembers(MemberBinder memberBi<br>
nder, DynamicAction action, Type type)<br> at IronPython.Runtime.Calls.PythonBinder.ResolveMemberNames(CodeContext conte<br>xt, PythonType type, PythonType owner, Dictionary`2 memberNames)<br> at IronPython.Runtime.Types.PythonType.GetMemberNames(CodeContext context, Ob<br>
ject self)<br> at IronPython.Runtime.Operations.PythonOps.GetAttrNames(CodeContext context,<br>Object o)<br> at IronPython.Runtime.Builtin.dir(CodeContext context, Object o)<br> at _stub_$26##24(Closure , CallSite , CodeContext , Object , Object )
<div class="Ih2E3d"><br> at _stub_MatchCaller(Object , CallSite , Object[] )<br> at Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args)<br></div> 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> at S$2.Initialize(CodeContext )<br> at IronPython.Hosting.PythonCommandLine.RunFileWorker(String fileName)<br> at IronPython.Hosting.PythonCommandLine.RunFile(String fileName)<br></div>ValueError: 'this' type cannot be an interface itself.<br>
<br><br>Incidentally, even when installed with VS Pro I can'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 <<a href="mailto:fuzzyman@voidspace.org.uk" target="_blank">fuzzyman@voidspace.org.uk</a> <mailto:<a href="mailto:fuzzyman@voidspace.org.uk" target="_blank">fuzzyman@voidspace.org.uk</a>>> wrote:<br>
<br> The viewlets that come with VSLab look *really* cool. They're<br> based on F# so I decided to see if they could be used from IronPython.<br><br> <a href="http://www.codeplex.com/vslab" target="_blank">http://www.codeplex.com/vslab</a><br>
<br> The dependencies are pretty hefty. You need F# installed *and*<br> Managed DirectX (June 2008 SDK ~450mb seems to fulfil the dependency).<br><br> To get at the viewlet assemblies you need Visual Studio Pro<br> installed as well, but they can be extracted from the VSLabs msi<br>
installer without VS Pro.<br><br> Ok, so with all the dependencies installed I attempt to use them -<br> and *boom*. Anyone here got any ideas?<br><br> IronPython 2.0 Beta (2.0.0.3000) on .NET 2.0.50727.1434<br> Copyright (c) Microsoft Corporation. All rights reserved.<br>
>>> import clr<br> >>> clr.AddReference('vslabfsicore')<br> >>> clr.AddReference('vslabviewlets')<br> >>> clr.AddReference('vslabcore')<br> >>> from GraphViewlet import GraphControl<br>
>>> g = GraphControl()<br> Traceback (most recent call last):<br> File "<stdin>", line 1, in <module><br> File "vslabviewlets", line unknown, in .ctor<br> File "vslabfsicore", line unknown, in .ctor<br>
File "System.Windows.Forms", line unknown, in get_Controls<br> File "System.Windows.Forms", line unknown, in get_Properties<br> SystemError: Object reference not set to an instance of an object.<br>
<br><br> Interesting that the explosion is inside winforms. Referencing<br> that assembly first makes knows difference.<br><br> Michael Foord<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></div></div> <a href="mailto:Users@lists.ironpython.com" target="_blank">Users@lists.ironpython.com</a> <mailto:<a href="mailto:Users@lists.ironpython.com" target="_blank">Users@lists.ironpython.com</a>>
<div class="Ih2E3d"><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><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>
<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>