dcsimg
www.webdeveloper.com
Results 1 to 2 of 2

Thread: Embedding Mozilla in c#: Browser is not in a valid state

Hybrid View

  1. #1
    Join Date
    Mar 2007
    Posts
    6

    Embedding Mozilla in c#: Browser is not in a valid state

    Hi,

    New to mozilla embedding. In .Net C# I have an app that loads the
    browser when I place it in a new form and it runs.

    But I want to load the browser as a Browser (in the native browser
    window) when I try to do this:

    AxMozillaBrowser BrowserApp=new AxMozillaBrowser();
    BrowserApp.Navigate("http://www.somesite.com");

    I get this error:
    Exception of type 'System.Windows.Forms.AxHost
    +InvalidActiveXStateException' was thrown.

    If I try this:
    MozillaBrowser BrowserApp=new MozillaBrowser();
    BrowserApp.Navigate("http://www.somesite.com", ref o, ref o, ref o,
    ref o);

    I get this error:
    Browser is not in a valid state

    System.Runtime.InteropServices.COMException was unhandled
    Message="Browser is not in a valid state"
    Source="Mozilla.Browser.1"
    ErrorCode=-2147418113
    StackTrace:
    at MOZILLACONTROLLib.MozillaBrowserClass.Navigate(String URL,
    Object& Flags, Object& TargetFrameName, Object& PostData, Object&
    Headers)
    at SimpleBrowser.SimpleBrowser.Main() in C:\MozBrowser
    \MozBrowser.cs:line 30
    at System.AppDomain.nExecuteAssembly(Assembly assembly,
    String[] args)
    at System.AppDomain.ExecuteAssembly(String assemblyFile,
    Evidence assemblySecurity, String[] args)
    at
    Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
    at System.Threading.ThreadHelper.ThreadStart_Context(Object
    state)
    at System.Threading.ExecutionContext.Run(ExecutionContext
    executionContext, ContextCallback callback, Object state)
    at System.Threading.ThreadHelper.ThreadStart()

    I must be missing some initialization call, I don't what it is.

    Anyone here done this successfully and have any tips?

    Thanks!

  2. #2
    Join Date
    May 2005
    Posts
    2,040
    Why aren't you asking this in the .NET board?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles