Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8090439
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T19:43:17+00:00 2026-06-05T19:43:17+00:00

I’m using the MozNet plugin from Se7enSoft. This is a WebBrowser control for FireFox

  • 0

I’m using the MozNet plugin from Se7enSoft. This is a WebBrowser control for FireFox 3.6. It uses XulRunner.

The first thing I have to do is to execute an Initialize(…) method.

var binDirectory = Path.GetDirectoryName(
    Assembly.GetExecutingAssembly().Location);
var xulRuntimeDirectory = Path.Combine(binDirectory, "xul");
Se7enSoft.MozNet.Xpcom.Initialize(xulRuntimeDirectory, null);

I have to pass it the directory into which we’ve installed XulRunner.
The Initialize method of this plugin internally uses the following DLLImport.

[DllImport("xpcom", CharSet = CharSet.Ansi, 
           EntryPoint = "NS_CStringContainerFinish",   
           CallingConvention = CallingConvention.Cdecl)]
internal static extern int Moz_CStringContainerFinish(ACString container);

The NS_CStringContainerFinish method from the XulRunner’s xpcom.dll is required.

Just before this method is called the very first time, the MozNet plugin temporarily changes the PATH environment variable.

Environment.SetEnvironmentVariable("path", 
    Environment.GetEnvironmentVariable("path") + ";" + 
    binDirectory, EnvironmentVariableTarget.Process);

The XulRunner’s location is temporarily added to the PATH environment variable to make sure it can resolve the xpcom.dll (and others).

However it still cannot find it. I’m receiving the following exception.

Unable to load DLL 'xpcom': Cannot find method. 
    (Exception from    HRESULT: 0x8007007F)
at Se7enSoft.MozNet.Native.MozNativeMethods.Moz_CStringContainerInit(
   ACString container)
at Se7enSoft.MozNet.Xpcom.XpCom_Init()
at Se7enSoft.MozNet.Xpcom.Initialize(String mozPath, String profPath)

This problem only occurs on 3 PC’s (Windows 2000 & XP). Works fine for hundreds of others.

I can reproduce the problem if I debug and step over the Environment.SetEnvironmentVariable(…) method.

Are there any issues with SetEnvironmentVariable that might prevent it from changing the PATH environment variable?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T19:43:21+00:00Added an answer on June 5, 2026 at 7:43 pm

    Found the cause.

    The DLLImport statement automatically locates the xpcom.dll file using the dynamic link library search order.

    [DllImport("xpcom", CharSet = CharSet.Ansi, 
               EntryPoint = "NS_CStringContainerFinish",   
               CallingConvention = CallingConvention.Cdecl)]
    internal static extern int Moz_CStringContainerFinish(ACString container);
    

    In short, it searches:

    1. The directory in which your application is installed.
    2. System directory
    3. 16-bit system directory
    4. Windows directory
    5. Current directory
    6. Directories in PATH environment variable.

    Turned out the 3 PCs which had the issue, had a different xpcom.dll lingering around. This was found first and BOOM…exceptions galore.

    A directory (UNC path) listed in the PATH environment variable pointed to a couple DLLs which were dependencies of xpcom.dll, namely:

    • nspr4.dll
    • nss3.dll
    • plc4.dll
    • plds4.dll

    We fixed it by changing the PATH variable for our process only. Made sure our path was searched before any other by adding it at the beginning of the PATH environment variable.

    var pluginDirectory = @"C:\....\xulrunner\");
    var path = Environment.GetEnvironmentVariable("path");
    Environment.SetEnvironmentVariable(
        "path", 
        pluginDirectory + ";" + path, 
        EnvironmentVariableTarget.Process);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
For some reason, after submitting a string like this Jack’s Spindle from a text
this is what i have right now Drawing an RSS feed into the php,
I have this code to decode numeric html entities to the UTF8 equivalent character.
We're building an app, our first using Rails 3, and we're having to build
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I have a text area in my form which accepts all possible characters from
Does anyone know how can I replace this 2 symbol below from the string
I have thousands of HTML files to process using Groovy/Java and I need to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.