shiva wrote:

>  var aFile =
> Components.classes["@mozilla.org/file/local;1"].createInstance();
> 
> where @mozilla.org/file/local;1 is used to call the nsiLocalFile interface.
> so what i wanted is if i have an interface for my code how do i access it. i
> mean lets say the interface is "nsIMyFile" and its stored in c:\shiva\  so
> how do i call this interface and load its components to access the native
> code using XPCOM in javascript

You'll want to check out some of the samples. xpcom/sample and 
js/src/xpconnect/sample.

You have to place the DLL in the components directory and the xpt file. 
This is done via the build process normally. The DLL will need to have 
factory code to create the objects. Again you can look at the samples to 
see how this is done.

 From there when Mozilla starts up, (If it is a debug build) it will 
rebuild the component.reg and xpti.dat files when it notices a new file 
or a modified file. In release, you either have to manually run regxpcom 
or remove the component.reg and xpti.dat files.

In the factory code you'll define a prog ID 
"@mozilla.org/file/MyClass;1" that can be used in the Components.classes 
statement.


Reply via email to