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


Reply via email to