Visit Mozilla.org

nsILocalFile:load

From MDC

« XPCOM API Reference

Contents

[edit] Summary

This method is used for opening the dynamically linked library corresponding to this nsILocalFile.

 [noscript] PRLibraryStar load();

[edit] Return Values

PRLibraryStar is a typedef for a pointer to PRLibrary.

[edit] Example Code

 #include "prlink.h"
 #include "nsError.h"
 #include "nsILocalFile.h"

 // Load the DLL corresponding to the given nsILocalFile...

 nsresult LoadDLL(nsILocalFile *aLocalFile)
 {
   PRLibrary *dll;
   nsresult rv = aLocalFile->Load(&dll);
   if (NS_FAILED(rv))
     return rv;

   // Do something with the library now that it is open...

   PR_FreeLibrary(dll);
   return NS_OK;
 }

[edit] See Also

nsILocalFile