Thanks, this does help. Of course, I cannot call this code directly from my C# app. But I believe I can place the code somewhere along with the IWebBrowser et al implementation classes in mozilla. I'll need to create a custom interface with method CreateProfile and expose it e.g., from the same class that implements IWebBrowser. I can then QI for this interface from my app and call the CreateProfile method.
Regards, Sami "Niky Williams" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Well, I have some horribly written code LOL for you to register a profile. > This is how I got it to work. One of those "Get working now, will fix and > comment later" type of things. > > ////////////////////////////////////////////////////////////////////// > nsCOMPtr<nsIFile> nsCOMPtr_nsIFile = NULL; > > nsCOMPtr<nsILocalFile> nsCOMPtr_nsILocalFile = NULL; > > nsCOMPtr<nsProfileDirServiceProvider> nsCOMPtr_nsProfileDirServiceProvider > = > NULL; > > > > rv = NS_GetSpecialDirectory(NS_APP_APPLICATION_REGISTRY_DIR, > getter_AddRefs(nsCOMPtr_nsIFile)); > > rv = nsCOMPtr_nsIFile->Append(NS_LITERAL_STRING("GeckoTest1")); > > nsCOMPtr_nsILocalFile = do_QueryInterface(nsCOMPtr_nsIFile); > > rv = NS_NewProfileDirServiceProvider(PR_TRUE, > getter_AddRefs(nsCOMPtr_nsProfileDirServiceProvider)); > > rv = nsCOMPtr_nsProfileDirServiceProvider->Register(); > > rv = > nsCOMPtr_nsProfileDirServiceProvider->SetProfileDir(nsCOMPtr_nsILocalFile); > > ////////////////////////////////////////////////////////////////////// > > I'm not sure how/if you can do it through the XPCOM/COM object thingy you > have. If not, just put this bit of code somewhere right after you > initialize your XPCOM/Embedding. The only thing you may have with this is > possibly link errors and "can't find this function" type of thing. Make > sure > to include: nsProfileDirServiceProvider.h and nsLiteralString.h among a > few > others. Also be sure you have all the libs linked...this is what I've > linked and it seems to work good. > > xpcom.lib embed_base_s.lib nspr4.lib plc4.lib plds4.lib > profdirserviceprovider_s.lib > > Hope this helps, > Niky > > > "Sami Vaaraniemi" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> >> "Michal Ceresna" <[EMAIL PROTECTED]> wrote in message >> news:[EMAIL PROTECTED] >> > On Monday 13 June 2005 12:02, Sami Vaaraniemi wrote: >> > Hello, >> > >> >> Assertion failures (in no particular order): >> >> >> >> ASSERTION: RootScrollFrame is not scrollable?, file >> >> d:/mozilla/layout/html/base/src/nsPresShell.cpp, line 3573 >> >> >> >> ASSERTION: Could not get profile directory lock.: 'Error', file >> >> d:/mozilla/profile/src/nsProfile.cpp, line 1183 >> >> >> >> ASSERTION: failed to open cookies.txt for writing: 'Error', file >> >> d:/mozilla/netwerk/cookie/src/nsCookieService.cpp, line 1043 >> > Seeing the error you get, did you initialize (create) the profile on >> > startup? >> > >> > best regards, >> > Michal Ceresna >> >> Thanks for your reply. >> >> No, I did not create a profile. I just built it, registered the COM >> component and started to use it. How do I create the profile, I could not >> find anything on the COM component that would allow me to do this? >> >> Regards, >> Sami >> >> > > _______________________________________________ mozilla-embedding mailing list [email protected] http://mail.mozilla.org/listinfo/mozilla-embedding
