1 Reply Latest reply on Apr 16, 2014 8:26 AM by MarkPerry301

    Integration with .Net Web application in RoboHelp

    SanduSangee

      Hi all:

       

             I was trying to integrate the .net web application with robohelp. I tried calling the helpfile generated using robohelp.

       

      RH_ShowWebHelp

      method was used to call .

       

      It internally called

       

       

      private bool ShowHelpURL(string strURL)

       

      method.

       

      But i am getting an error

       

      ActiveX control '8856f961-340a-11d0-a96b-00c04fd705a2' cannot be instantiated because the current thread is not in a single-threaded apartment.

       

       

       

       

       

      WebBrowser m_browser = new WebBrowser();

       

       

      if (m_browser != null)

      {

      m_browser.Navigate(strURL);

      m_browser.Visible =

       

      true;

       

       

      return true;

      }

       

       

      return false;

       

       

      is giving issue because mine is webapplication. the solution they say is add STTHREAD section.

       

      Can anybody guide me in proper  direction in integrating the .Net web application with robohelp.

        • 1. Re: Integration with .Net Web application in RoboHelp
          MarkPerry301

          Ran into the same issue. Here is the solution I found

           

               protected void btnHelp_Click(object sender, EventArgs e)

                  {

                      OrderIt.Common.Utilities.RoboHelpAPI.CSH_API helpApi = new CSH_API();

                      Thread thread = new Thread(new ThreadStart(STAOparation));

                      thread.SetApartmentState(ApartmentState.STA);

                      thread.Start();

                      thread.Join();

                  }

           

           

                  public void STAOparation()

                  {

                      RoboHelpAPI.CSH_API helpApi = new CSH_API();

                      helpApi.RH_ShowLocalHelp(0, "http://localhost:4606/help/WebHelp/index.htm", OptionConstants.CSH_DISPLAY_CONTEXT, "1");

                  }