Having started out on a mozilla embedding project and also being a JAVA but not C/C++ guy, let me try to answer a little bit of these questions.
1.) There are XPCOM interface wrappers (such as nsIVarian) so that XPCOM can talk to COM. Check out Adam Lock's website for more info: http://www.iol.ie/~locka/mozilla/mozilla.htm. He shows how to go about embedding and writing plugins for mozilla that interface with ActiveX/OLE COM objets. I am still running my embedded environment in an EXE, but there's no reason you couldn't do it in JAVA 2.) "string"/"wstring"/"domstring",--there actually all quite different in some respects. But basically they are types of strings similar to what you would see in MS COM's be all end all BSTR type. You'd have to look in the code for how each one works directly or ask someone who knows more than I. Keep in mind though that Mozilla's String library is the most complicated And robust code of any String library I have every seen!!!! It is built For performance and is not trivial to understand all the time. 3.) Similar to COM, every interface inherits from nsISupports (rather than IUnknown). Standard methods such as QueryInterface, AddRef, and Relase are implemented on every interface and an idl is compiled with a tool called XPIDL which allows you code (usually Javascript && C++) do access methods and properties. Check out the xpcom/xpconnect sections on the mozilla website and http://www.xulplanet/xpcomref for more details. 4.) Hmmmm. . . don't know about that one, gonna have to defer for now. But yes all documentation is too little in mozilla :) 5.) I don't know about this one for sure but if you mean registered as in regsvr32, like a COM Component, once again I must point you to Adam Lock's site. (See number 1 above). Hope this helps Sean Snider Software Engineer [EMAIL PROTECTED] -----Original Message----- From: jml [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 17, 2002 12:58 AM To: [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: HELP!!! swt + mozilla Hi, Mozilla community, please help! I think maybe the group is not very active, or just want to ignore my newbie questions, I didn't receive response I posted yesterday. Here, let me explain my situation. I am a Java programmer (I think pretty good java programmer). Understand COM quite well, though not doing C/C++ coding for that. I program in Windows, do not have any experience in GTK and other unix GUI toolkit. Now I am trying to do something as embed mozilla in swt for the windows platform. SWT is an IBM widget toolkit for Java, I see someone discuss about it on the maillist before about it. It use native widget and wrap it in java. Also, SWT provide a lot of native methods that doing OS call and memory copy between Java and the native system. Also, swt for windows also provide COM/OLE support, it provides a very easy way for using COM/OLE object and implement COM/OLE object in Java. This seem to me a very good candidate to embed Mozilla in Java. So I begin trying, and got a lot of questions (don't forget I am newbie in mozilla :-) 1. Is XPCOM binary compatible with COM/OLE? In swt, it use vtbl to call COM/OLE methods. I want to just use that provided by swt, then I needn't write my native code. 2. what is the "string"/"wstring"/"domstring" mean in XPCOM? What is the binary format of each of them? Since I need to package the java String into a memory buffer then pass the pointer of the buffer to XPCOM methods, so I need to know the format for this buffer. 3. Is there anything similiar to IDispatch? How I do dynamically get property and call methods? 4. How does nsIComponentRegistrar.enumeratoeContractID work? What will the nsISimpleEnumerator.getNext() return then? It seemed in mozilla, the documentation is too little. 5. How I make the webbrowser component to be registered? I did soemthing be able to call NS_InitXPCOM2, NS_GetComponentManager, then when I try to createInstanceByContractID(), I get NS_ERROR_FACTORY_NOT_REGISTERED. I don't know how to register it. I am using the "c:/mozilla" directory as the working directory, and pass NULL to the NS_InitXPCOM2() method. I also tried to call NS_GetComponentRegistrar.autoRegister(NULL), but still fail. Thanks in advance. jml
