I will try that as well. Thanks!<br><br><br><div class="gmail_quote">On Wed, Aug 19, 2009 at 3:47 PM, Dino Viehland <span dir="ltr">&lt;<a href="mailto:dinov@microsoft.com">dinov@microsoft.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
If 2.6 doesn&#39;t work unmodified there&#39;s also adding the 2 needed lines<br>
to 2.0&#39;s pyc:<br>
<br>
     mainMethod = tb.DefineMethod(&#39;Main&#39;, MethodAttributes.Public | MethodAttributes.Static, int, ())<br>
+    if targetKind == System.Reflection.Emit.PEFileKinds.WindowApplication:<br>
+        mainMethod.SetCustomAttribute(clr.GetClrType(System.STAThreadAttribute).GetConstructor(()), System.Array[System.Byte](()))<br>
     gen = mainMethod.GetILGenerator()<br>
<div><div></div><div class="h5"><br>
-----Original Message-----<br>
From: <a href="mailto:users-bounces@lists.ironpython.com">users-bounces@lists.ironpython.com</a> [mailto:<a href="mailto:users-bounces@lists.ironpython.com">users-bounces@lists.ironpython.com</a>] On Behalf Of Michael Foord<br>

Sent: Wednesday, August 19, 2009 3:45 PM<br>
To: <a href="mailto:davidescobar@ieee.org">davidescobar@ieee.org</a>; Discussion of IronPython<br>
Subject: Re: [IronPython] FolderBrowserDialog does not show folders<br>
<br>
David Escobar wrote:<br>
&gt; How would I tag Main with the [STAThread] attribute in IronPython? I<br>
&gt; thought IP didn&#39;t yet have the ability to use attributes...<br>
Unfortunately that is something that needs to be done in the Pyc<br>
compiler. Did you try Curt&#39;s suggestion of using the 2.6 Pyc.py?<br>
<br>
Michael<br>
<br>
&gt;<br>
&gt; On Wed, Aug 19, 2009 at 3:11 PM, Curt Hagenlocher<br>
&gt; &lt;<a href="mailto:curt@hagenlocher.org">curt@hagenlocher.org</a> &lt;mailto:<a href="mailto:curt@hagenlocher.org">curt@hagenlocher.org</a>&gt;&gt; wrote:<br>
&gt;<br>
&gt;     ...which has been fixed for IronPython 2.6. You might be able to<br>
&gt;     use the 2.6 pyc.py script against 2.0.<br>
&gt;<br>
&gt;<br>
&gt;     On Wed, Aug 19, 2009 at 3:09 PM, Curt Hagenlocher<br>
&gt;     &lt;<a href="mailto:curt@hagenlocher.org">curt@hagenlocher.org</a> &lt;mailto:<a href="mailto:curt@hagenlocher.org">curt@hagenlocher.org</a>&gt;&gt; wrote:<br>
&gt;<br>
&gt;         It&#39;s a COM issue. The emitted Main needs to be tagged with the<br>
&gt;         [STAThread] attribute.<br>
&gt;<br>
&gt;         On Wed, Aug 19, 2009 at 11:41 AM, David Escobar<br>
&gt;         &lt;<a href="mailto:davidescobar@ieee.org">davidescobar@ieee.org</a> &lt;mailto:<a href="mailto:davidescobar@ieee.org">davidescobar@ieee.org</a>&gt;&gt; wrote:<br>
&gt;<br>
&gt;             Yes, I am. The full command line I&#39;m using is:<br>
&gt;             *&quot;C:\Program Files\IronPython 2.0.2\ipy.exe&quot; pyc.py<br>
&gt;             /out:FolderBrowserDialogTest<br>
&gt;             /main:FolderBrowserDialogTest.py /target:winexe<br>
&gt;             FolderBrowserDialogTest.py*.<br>
&gt;<br>
&gt;             The dialog window does come up with every control except<br>
&gt;             the tree view of folders.<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;             On Wed, Aug 19, 2009 at 11:27 AM, Dino Viehland<br>
&gt;             &lt;<a href="mailto:dinov@microsoft.com">dinov@microsoft.com</a> &lt;mailto:<a href="mailto:dinov@microsoft.com">dinov@microsoft.com</a>&gt;&gt; wrote:<br>
&gt;<br>
&gt;                 Are you compiling w/ the &quot;/target:winexe&quot; option?<br>
&gt;                 You&#39;ll need to provide that for doing WinForms<br>
&gt;                 development.<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;                 *From:* <a href="mailto:users-bounces@lists.ironpython.com">users-bounces@lists.ironpython.com</a><br>
&gt;                 &lt;mailto:<a href="mailto:users-bounces@lists.ironpython.com">users-bounces@lists.ironpython.com</a>&gt;<br>
&gt;                 [mailto:<a href="mailto:users-bounces@lists.ironpython.com">users-bounces@lists.ironpython.com</a><br>
&gt;                 &lt;mailto:<a href="mailto:users-bounces@lists.ironpython.com">users-bounces@lists.ironpython.com</a>&gt;] *On<br>
&gt;                 Behalf Of *David Escobar<br>
&gt;                 *Sent:* Wednesday, August 19, 2009 11:03 AM<br>
&gt;                 *To:* Discussion of IronPython<br>
&gt;                 *Subject:* [IronPython] FolderBrowserDialog does not<br>
&gt;                 show folders<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;                 I&#39;ve noticed an issue with the FolderBrowserDialog<br>
&gt;                 window from IronPython. When I display it with the<br>
&gt;                 ShowDialog method in a compiled script (through<br>
&gt;                 pyc.py), it does not show the TreeView of folders. It<br>
&gt;                 will display the Description title and the buttons,<br>
&gt;                 however. If I run the script straight through the<br>
&gt;                 interpreter, it will display the folders just fine.<br>
&gt;                 For reference, I also tried the OpenFileDialog and<br>
&gt;                 SaveFileDialog, and those show up correctly in both<br>
&gt;                 methods. Is this a bug, or am I doing something wrong?<br>
&gt;<br>
&gt;                 Sample code below:<br>
&gt;<br>
&gt;                 *import clr<br>
&gt;                 clr.AddReference(&quot;System.Windows.Forms&quot;)<br>
&gt;                 from System import *<br>
&gt;                 from System.Windows.Forms import *<br>
&gt;<br>
&gt;                 dlg = FolderBrowserDialog( )<br>
&gt;                 dlg.Description = &quot;Testing...&quot;<br>
&gt;                 dlg.ShowDialog( )*<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;             _______________________________________________<br>
&gt;             Users mailing list<br>
&gt;             <a href="mailto:Users@lists.ironpython.com">Users@lists.ironpython.com</a> &lt;mailto:<a href="mailto:Users@lists.ironpython.com">Users@lists.ironpython.com</a>&gt;<br>
&gt;             <a href="http://lists.ironpython.com/listinfo.cgi/users-ironpython.com" target="_blank">http://lists.ironpython.com/listinfo.cgi/users-ironpython.com</a><br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; ------------------------------------------------------------------------<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; Users mailing list<br>
&gt; <a href="mailto:Users@lists.ironpython.com">Users@lists.ironpython.com</a><br>
&gt; <a href="http://lists.ironpython.com/listinfo.cgi/users-ironpython.com" target="_blank">http://lists.ironpython.com/listinfo.cgi/users-ironpython.com</a><br>
&gt;<br>
<br>
<br>
--<br>
<a href="http://www.ironpythoninaction.com/" target="_blank">http://www.ironpythoninaction.com/</a><br>
<a href="http://www.voidspace.org.uk/blog" target="_blank">http://www.voidspace.org.uk/blog</a><br>
<br>
<br>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.ironpython.com">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>