Re: Cannot initialize OLE

nummish <[email protected]> Thu, 24 Mar 2005 09:16:30 -0500
Newsgroups gmane.comp.lib.wxwindows.wxnet
Message-ID <[email protected]>
This is a windows error that you won't find in GTK/OSX dev afaik. In
C#, you can define an [STAThread] attribute right before the Main
function to get around this. (Search MSDN for Single Threaded
Apartment)

eg.

[STAThread]
public static void Main(string[] args)

- nummish

On Thu, 24 Mar 2005 11:26:32 +0200, George Prisecaru <[email protected]> wrote:
>  Hello Group !
>  
>  The test below works fine, but I receive the message "Cannot initialize
> OLE" at startup.
>  The used language is Boo ().
>  Any idea?
>  
>  Thanks!
>  gp
> ------------------------------------------------------------------------------
>  
>  import System
>  import System.Drawing from System.Drawing
>  import wx from "wx.NET"
>  
>  class MainFrame(wx.Frame):
>      enum Cmd:
>          Open
>          Quit
>          About
>  
>      def constructor(title as string, pos as System.Drawing.Point, size as
> System.Drawing.Size):
>          super(title, pos, size)
>  
>          # menu
>  
>          menu_0 as wx.Menu = wx.Menu()
>          item_0_0 as wx.MenuItem = wx.MenuItem(menu_0, cast(int, Cmd.Open),
> "&Open")
>          menu_0.Append(item_0_0)
>  
>          item_0_1 as wx.MenuItem = wx.MenuItem(menu_0, -1, "-", "",
> wx.ItemKind.wxITEM_SEPARATOR)
>          menu_0.Append(item_0_1)
>  
>          item_0_2 as wx.MenuItem = wx.MenuItem(menu_0, cast(int, Cmd.Quit),
> "E&xit")
>          menu_0.Append(item_0_2)
>  
>          menuBar as wx.MenuBar = wx.MenuBar()
>          menuBar.Append(menu_0, "&File")
>          MenuBar = menuBar
>  
>          # statusbar
>  
>          CreateStatusBar(2)
>          StatusText = "Welcome !"
>  
>          EVT_MENU(cast(int, Cmd.Quit), OnQuit)
>  
>      def OnQuit(sender, e as wx.Event):
>          Close()
>  
>  class TestApp(wx.App):
>  
>      override def OnInit() as bool:
>          main as MainFrame = MainFrame("Minimal wxWidgets App", 
>                                        System.Drawing.Point(50, 50), 
>                                        System.Drawing.Size(450, 340))
>          main.Show(true)
>          return true
>  
>  def main():
>      app as TestApp = TestApp()
>      app.Run()
>  
>  try:
>      main()
>  except e:
>      print e

-- 
Bigger 1:23
This address if for mailing list traffic only. 
Please direct non-list correspondence to 0x90.org


-------------------------------------------------------
This SF.net email is sponsored by Microsoft Mobile & Embedded DevCon 2005
Attend MEDC 2005 May 9-12 in Vegas. Learn more about the latest Windows
Embedded(r) & Windows Mobile(tm) platforms, applications & content.  Register
by 3/29 & save $300 http://ads.osdn.com/?ad_id=6883&alloc_id=15149&op=click